【发布时间】:2016-08-17 00:52:56
【问题描述】:
我正在尝试从列中读取数据,然后将我想要的信息连接成一个字符串。
到目前为止,我为单个字符串输入成功编写了 R 脚本,但我无法为 n 元素执行此操作。
reprows <- strsplit("Day1_XExp2B3_500x_Y_Z", "_", fixed = T)
lenreprows <- length(reprows[[1]])
temprepnamelisttopaste <- c(2:(lenreprows-2))
temprepname <- paste(sapply(reprows[temprepnamelisttopaste]),collapse='.')
每一行的数据看起来像:
Day1_XExp2B3_500x_Y_Z
我的输出应该是:
XExp2B3.500x
【问题讨论】: