The first line creates a sequence variable. The second like selects the first 30 observations.
smalldata$suji <- 1:nrow(smalldata)
smalldata<-filter(smalldata,suji <= 30)
In SAS's datastep, this would be:
suji=_n_;
if suji <=30;
My Statistical tools and consulting service
Statsitics, Research Methods, SAS, R, HLM, Rasch model
The first line creates a sequence variable. The second like selects the first 30 observations.
smalldata$suji <- 1:nrow(smalldata)
smalldata<-filter(smalldata,suji <= 30)
In SAS's datastep, this would be:
suji=_n_;
if suji <=30;