1

I have a dataframe df1, out of which I am trying to fetch the unique values from a column "parameter" which in turn giving me a "factor"

I want to create an if condition like

if (unique(df1$parameterName) == "effectivetemp"){
   print('yes')
}

by doing this it says

Warning message: In if (as.factor(unique(Daily_Avg_Count$parameterName)) == "cteffectiveness") { : the condition has length > 1 and only the first element will be used.

Any suggestion will be helpful.

akrun
  • 874,273
  • 37
  • 540
  • 662
Tarun Das
  • 35
  • 5
  • Please show what you really wanted. Is it just to print 'yes', then `if('effectivetemp' %in% unique(df1$parameterName)) print("yes")` where `df1 <- data.frame(parameterName = c('a', 'b', 'effectivetemp'))` – akrun Feb 14 '18 at 07:11

0 Answers0