Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

5
Can someone explain to me what's wrong with my if statement?
Post Body

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

Author
Account Strength
60%
Account Age
8 years
Verified Email
No
Verified Flair
No
Total Karma
1,398
Link Karma
614
Comment Karma
784
Profile updated: 5 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago