Saturday, 15 May 2010

Create logical variable in new column in R based of rows. -



Create logical variable in new column in R based of rows. -

in dataframe "hive1_phase2" want create new column titled "wifi" value "0" in rows 1:141960, "1" "141961:413614" , "0" 1 time again 413615:632161 (the lastly row)

what right code? mine not working.

hive1_phase2$wifi <- rep(0,(1:141960)(hive1_phase2)

rep(1,(141961:413614)(hive1_phase2)) rep(0,(413614:632161)(hive1_phase2))

thanks!

r

No comments:

Post a Comment