This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
If wmorder is abcd, then participants complete the Beta task first, and the Alpha task second. If wmorder is cdab, then participants complete the Alpha task first, and the Beta task second. Participants were randomly assigned to conditions abcd or cdab. The final score is computed as the score on the first task they did minus the score on the second task they did (i.e., Time 2 - Time 1, but Time 2 and Time 1 could be Alpha or Beta, respectively). Does this make sense?
Given this setup, I'm not sure what's wrong with the logic of my if statement, so I think it's a syntax issue. Can someone help me out?
data$WMIndex <- (if(data$wmorder=="abcd"){(data$BetaScore - data$AlphaScore)})
&& (if(data$wmorder == "cdab"){(data$AlphaScore - data$BetaScore)})
When I run this it returns the following message. Moreover, even when I only run the first line before the and, it still fails.
Warning message:
In if (data$wmorder == "abcd") { :
the condition has length > 1 and only the first element will be used
Subreddit
Post Details
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Rlanguage/c...