[R] detecting measurement of specific id in column in R

Jeff Newmiller jdnewmil @ending from dcn@d@vi@@c@@u@
Thu Nov 22 17:53:09 CET 2018


You hope... but no... not really. You need to enhance your question with a (minimal) example of the data just after importing into R, and another example of what you think the result should look like. Also, you should provide your current best guess at what a calculation would include expressed in R to help clarify your description. In your case you might be able to separate your problem into "find a row number for the first reading" and then what calculations would make if you knew "n" was that row number... but those are guesses because I don't know what your data look like.

A recommended technique to provide data is to use the dput function to format R data and paste it into your email... read more at [1][2][3].

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) 

On November 22, 2018 1:33:39 AM PST, Romy Rehschuh via R-help <r-help using r-project.org> wrote:
>Dear all,
>
>I hope this is the right way to ask questions.
>I have a problem with R regarding the detection of the measurement of a
>specific sample_id (see example file attached). I have to substract the
>"IN" values (means the air which goes into the chambers) from the
>values of
>"d13C", "ppm_CO2" and "ppm_13CO2" for every single chamber (=sample
>ID).
>The "IN" values have to be the ones which were measured* before *the
>measurements of the single chambers in time. I measured "IN" once and
>then
>up to 10 chambers in a row to safe time, then "IN" again, but it can
>change.
>Therefore, searching for the closest "IN" does not work.
>
>Do you have any suggestions? Would it be possible to write a loop for
>this?
>I would really much appreciate your help!
>
>Best, Vicci
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list