# [R] Extracting arithmetic mean for specific values from multiple .txt-files

Tue Jul 10 19:59:30 CEST 2012

```Hello,

As for this second question, you should explain yourself better.

1. What is a test subject, which column records its id? vpNum?
2. You say "divided per trials or trialCount". Does this mean per trial
number (example: divide by 1, by 2, by 3, etc, by 149) or per number of
trials (149 in the previous example)
3. 'correct' now seems to be categorical. Divide WHAT by trial or
trialCount?

Hint: post a small data example with three or four subjects and the
wanted output.

Em 10-07-2012 18:06, vimmster escreveu:
> Dear Rui,
>
> thank you very much.
>
>
> One last question:
>
> I need to write a function, with ONE value (here: a ratio) for the correct
> reactions divided per trials or trialCount, respectively, FOR EACH test
> subject.
>
> "/" means "divided by" in the following.
>
> I need the ratio correct (reactions)/trial or correct
> (reactions)/trialCount, respectively (because trial and trialCount are the
> same WITHIN test SUBJECTS; BUT they differ in length between BETWEEN test
> SUBJECTS!).
>
> It would be very helpful, if I had a data frame in the end in R, with one
> column for
> "trialCount"/"trial", one column for "correct reactions"(= 1) AND (more
> importantly) one column for "correct (= 1) answers / trialCount".
>
> legend (just as additional information) for the variable "correct":
> 1 = correct reaction
> 2 = false reaction
> 3 = reaction too slow
> 4 = reaction too fast
> 5 = more than one button pressed
> 6 = no reaction within RT window
>
> I would be very thankful for an answer!
>
> Sorry for the questions, but I am doing this for the first time!
>
> Kind regards
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Extracting-arithmetic-mean-for-specific-values-from-multiple-txt-files-tp4635809p4636020.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help