R学习及报错记录-字符串分割及作图报错

R语言以点切割字符串

strsplit("t.s.l.f", ".", fixed = TRUE)
[[1]]
[1] "t" "s" "l" "f"

注意fixed=TRUE

R切割字符串后不是以list形式保存

library(stringr)#需要加载stringr包
s = str_split(fs,"-",simplify = T)[,1]

以点切割字符串

library(stringr)
str_split(aa,"\\.",simplify=T)

#R出图报错1

Error in grid.Call(C_convert, x, as.integer(whatfrom), as.integer(whatto),  : 
  Viewport has zero dimension(s)
  
Error in plot.new() : figure margins too large

这两种错误都是把出图的屏幕拉大即可

#R出图报错2

Error in .Call.graphics(C_palette2, .Call(C_palette2, NULL)) : 
  invalid graphics state

R作图太多,清空所有历史记录的图就可
或者R关闭重启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值