Dot Notation

考虑四种string的方法:

1、 len()

2、 str()

3、 lower()

4、 upper()


对于string类的实例word和int实例number,四种方法分别为:

1. len(word)

2. str(number)

3. word.lower()

3. word.upper()


区别在于: 

lower()和upper()只能对string操作,故采用dot notation形式;

而,len()、str()除对string操作外,还能对其他类型操作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
> ggplot()+ + geom_histogram(binwidth = 200,data=data,aes(x=SII,y=..frequency..),alpha = 0.8,colour="gold3",fill="gold3")+ + scale_y_continuous(sec.axis = sec_axis(~.*4000, name = "HR (95%CI) for 2-year all-cause mortality"))+ + geom_line(data=HR, aes(SII,yhat/4000), + linetype="solid",size=1,alpha = 0.7,colour="steelblue1")+ + geom_ribbon(data=HR, + aes(SII,ymin = lower/4000, ymax = upper/4000), + alpha = 0.1,fill="blue")+ + theme_classic()+ + geom_hline(yintercept=1/4000, linetype=2,size=1)+ + geom_vline(xintercept=570,size=1,linetype=2,color = '#d40e8c')+ + geom_vline(xintercept=1000,size=1,linetype=2,color = '#d40e8c')+#查表HR=1对应的age + labs(x="Systemic immune-inflammation index", y="Density")+ + xlim(0,4000)+ + labs(title = " ")+ + theme(plot.title = element_text(hjust = 0.5)) Error in `geom_histogram()`: ! Problem while mapping stat to aesthetics. ℹ Error occurred in the 1st layer. Caused by error in `map_statistic()`: ! Aesthetics must be valid computed stats. ✖ The following aesthetics are invalid: ✖ `y = ..frequency..` ℹ Did you map your stat in the wrong layer? Run `rlang::last_error()` to see where the error occurred. Warning messages: 1: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. ℹ Please use `linewidth` instead. This warning is displayed once every 8 hours. Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 2: The dot-dot notation (`..frequency..`) was deprecated in ggplot2 3.4.0. ℹ Please use `after_stat(frequency)` instead. This warning is displayed once every 8 hours. Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 3: Removed 70 rows containing non-finite values (`stat_bin()`).
06-08

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值