What are the R equivalents to the Stata command egen?
egen temp = anycount(t0vas t30vas t60vas t120vas t240vas t360vas),
values(0,1,2,3,4,5,6,7,8,9,10)
egen temp2 = rowtotal(t0vas t30vas t60vas t120vas t240vas t360vas)
__
R-help@r-project.org mailing li
For each variable x, y and z I would like to run the same set of
commands. I have tried
for (n in FICB[,"calct30"], FICB[, "calct60]") {
FICB[,"temp"] <- format([n],digits=2)
etc
}
How do I do this correctly?
__
R-help@r-project.org mailing list
https:
> (FICB[,"temp"])
[1] "0.30" "0.55" "0.45" "2.30" "0.45" "0.30" "0.25" "0.30" "0.30"
"1.05" "1.00" "1.00"
[13] "0.30" "0.30" "0.30" "0.55" "0.30" "0.30" "0.30" "0.25" "1.00"
"0.30" "0.30" "0.45"
[25] "0.30" "1.30" "0.30" "0.30" "0.45" "0.30" "0.30" "0.30" " NA"
"NA" " NA" " NA"
[37] "0.30" " N
One variable contains values (1.30 - one hour and thirty minutes, 1.2
(which is supposed to be 1.20 - one hour and twenty minutes)). I would
like to convert to a minute variable so 1.2 is converted to 80
minutes. How?
__
R-help@r-project.org mailing list
4 matches
Mail list logo