Hi there, I'm a new learner in R. had a trouble to sum the data, which showed below
|bwgp|smoke|value|
|3|0|35|
|3|1|11|
|2|0|29|
|2|1|17|
|1|0|22|
|1|1|16|
|0|0|29|
|0|1|30|
this excel data is named as bwtsmk.
to obtain the sum for value by smoke status, I used the code below, but failed
smk0<-sum(bwtsmk$(value & smoke=0))
which code should I use to get it. appreciate much if someone can help.
Jason