Is there an equivalent R function to Stata 'order' command?

后端 未结 6 1229
旧时难觅i
旧时难觅i 2021-01-13 11:09

\'order\' in R seems like \'sort\' in Stata. Here\'s a dataset for example (only variable names listed):

v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v

6条回答
  •  萌比男神i
    2021-01-13 11:45

    This should give you the same file:

    #snip
    gtinfo <- rbind(tweetinfo, noretweetinfo)
    gtinfo$deleted=""
    retweetinfo <- transform(retweetinfo, reTweetId="", reUserId="")
    gtinfo <- rbind(gtinfo, retweetinfo)
    gtinfo <-gtinfo[,c(1:16,18,17)]
    #snip
    

    It is possible to implement a function like Strata's order function in R, but I don't think there is much demand for that.

提交回复
热议问题