Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“将 case 列拆分为两列, 并删除原列”与“tstrsplit(DT$rate, split = "/")][, rate := NULL]”中的字符,似乎没有统一符号 #5

Open
shenjian5 opened this issue Jun 22, 2022 · 0 comments

Comments

@shenjian5
Copy link

感谢张老师对R语言资料的分享。张老师的R语言书籍,总结了常用的知识点和技巧,真的是良心之作。

ps: 书本2.7节(第200页),预计是笔误了(“将 case 列拆分为两列, 并删除原列”与“tstrsplit(DT$rate, split = "/")][,
rate := NULL]”中的字符,似乎没有统一符号)。

DT = as.data.table(table3)

将 case 列拆分为两列, 并删除原列

DT[, c("cases", "population") := tstrsplit(DT$rate, split = "/")][, rate := NULL]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant