小编use*_*674的帖子

使用apply或其他矢量化方法合并列的内容

我有一个几乎完全空白的data.frame,但每行都有一个值.如何使用矢量化或其他r-locald方法将每行的内容合并为一个向量?

样本数据:

raw_data  <- structure(
    list(
        col1 = c("", "", "", "", ""),
        col2 = c("", "", "", "", ""),
        col3 = c("", "", "", "", ""),
        col4 = c("", "", "", "Millburn - Union", ""),
        col5 = c("", "", "Cranston (aka Garden City Center)", "",""),
        col6 = c("", "", "", "", ""),
        col7 = c("", "", "", "", ""),
        col8 = c("", "", "", "", "Colorado Blvd"), 
        col9 = c("", "", "", "", ""),
        col10 = c("", "", "", …
Run Code Online (Sandbox Code Playgroud)

r apply

5
推荐指数
2
解决办法
54
查看次数

标签 统计

apply ×1

r ×1