Q: Getting warning message I am trying to run this code: 
 x = 0
 y = 0

newdata <- subset(data, subject_ids == 25773861)

for(i in newdata$classification_id){
   if(newdata$value == "Yes"){
     x = x + 1
   } else {
     y = y + 1 
   }
} 

But keep getting this warning:
Warning messages:
1: In if (newdata$value_simple == 0) { :
   the condition has length > 1 and only the first element will be used
2: In if (newdata$value_simple == 0) { :
   the condition has length > 1 and only the first element will be used

Any advice or help in solving this? 

A: The general code of 
if(condition){
  some code
}else{
  some code}

only look at the first value in the vector. So it is basically warning you that it is only looking at the first value in the object newdata$value. I am assuming you are getting all in either x or y not a split like you would want. 
The two things I would fix in that code, start at the first two lines of the for loop
x = 0
 y = 0

newdata <- subset(data, subject_ids == 25773861)

for(i in seq_along(newdata$classification_id)){ #seq_along makes a vector 1 to the length of your vector
   if(newdata$value[[i]] == "Yes"){ #This will subset the newdata$Value into single values
     x = x + 1
   } else {
     y = y + 1 
   }
} 

Another option is to use the tidyverse, assuming you have it installed
library(tidyverse)
 data %>%
       filter(subject_ids == 25773861) %>%
       group_by(value) %>%
       count()

