Create empty dataframe in R with same columns

后端 未结 3 476
鱼传尺愫
鱼传尺愫 2020-12-29 03:21
 names(U1)

[1] \"username\"     \"review_count\" \"forum_posts\"  \"age\"          \"avg_interval\"
[6] \"avg_sim\"      \"class\"

So how do I cre

3条回答
  •  半阙折子戏
    2020-12-29 03:51

    Using dplyr, there are a few good options:

    slice(U1, 0)
    filter(U1, FALSE)
    filter(U1, NA)
    

    The slice approach is probably clearest.

提交回复
热议问题