【发布时间】:2017-05-04 11:05:29
【问题描述】:
我在 R 中有一个字符列表。我正在执行以下查询:
> a <- c("sepal_length" ,"sepal_width", "petal_length" ,"petal_width" , "species")
> a
[1] "sepal_length" "sepal_width" "petal_length" "petal_width"
[5] "species"
> warning(a)
Warning message:
sepal_lengthsepal_widthpetal_lengthpetal_widthspecies
请注意,上述警告消息正在删除字符值之间的空格。我只想使用警告功能,有什么办法可以得到以下格式化输出。
> warning(f(a))
Warning message:
[1] "sepal_length" "sepal_width" "petal_length" "petal_width"
[5] "species"
【问题讨论】:
-
你在写奇怪的警告信息...
-
哈哈.. 实际上整个警告信息会是这样的。警告:列名更改为“sepal_length”“sepal_width”“petal_length”“petal_width”“species”
标签: r