I want to create a function that is going to search through data and find experience values where the condition value equals a particular string. This however yields this error:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions
subset = function(data, ttt="string") {
subset.cond <- subset(data, Condition==ttt)
row.cond <- subset.cond[ which(subset.cond$experience != 0),]
row.cond$experience <- factor(row.cond$experience) #drop factor levels
exp.cond <- levels(row.cond$experience) #get experience names
cond <- data[ which(data$experience==exp.cond ), ] #cleaned data
return(list(subset.cond=subset.cond,row.cond=row.cond,exp.cond=exp.cond))
}
subset(data=data_1, ttt="drug1")
Does anyone have any tips? Thanks a lot!
greplfunction that checks if a specific pattern is matched or not. As an example use thisgrepl("an", c("use","another","example","man"))- AntoniosK