Comments (4)
library(stringr)
str_c(c("a", NA_character_, "c"), c("1", "2", "3", "4"))
#> Warning in stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE):
#> longer object length is not a multiple of shorter object length
#> [1] "a1" NA "c3" "a4"
paste0(c("a", NA_character_, "c"), c("1", "2", "3", "4"))
#> [1] "a1" "NA2" "c3" "a4"
Created on 2021-04-12 by the reprex package (v2.0.0)
stringr::str_c() 设计更安全些
from r_for_data_science.
library(stringr) str_c(c("a", NA_character_, "c"), c("1", "2", "3", "4")) #> Warning in stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE): #> longer object length is not a multiple of shorter object length #> [1] "a1" NA "c3" "a4" paste0(c("a", NA_character_, "c"), c("1", "2", "3", "4")) #> [1] "a1" "NA2" "c3" "a4"Created on 2021-04-12 by the reprex package (v2.0.0)
stringr::str_c() 设计更安全些
----更安全指的是什么?
from r_for_data_science.
安全性指的是,缺失值的处理、向量长度不是整数倍时有警告提醒以及速度提升等等
from r_for_data_science.
明白了,谢谢,可以写一个有对比效果的例子吗?
from r_for_data_science.
Related Issues (15)
- 能否将其生成一个pdf或者epub的文件方便下载 HOT 1
- 关于28.16 stat_summar的一点疑问 HOT 2
- # ggplot2之科研数据可视化 {#tidyverse-ggplot2-academic}关于这章的疑问 HOT 3
- 关于中文R语言书 HOT 2
- 作者讲的特别好,感谢,思路清晰。 给R的初学者提供了清晰的道路!
- 老师太厉害了,向老师致敬
- 感谢信 HOT 1
- 基础篇-第8章-8.5 更多部分的单词拼写似乎存在问题 HOT 1
- Chapter 32 question HOT 2
- rmd文件为何不能按照网站上的章节命名 HOT 1
- 为何不能做成jupyter notebook的形式 HOT 2
- “为了让每列更加直观,也可以tribble()创建” HOT 2
- Potential typo in the proportional odds model HOT 1
- 有些函数过时了,要是能换成最新的就更好了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r_for_data_science.