數據集是從ISLR包「工資」中刪除數字或文本元素如何從所有列在這個問題中使用
library(ISLR)
head(Wage)
year age maritl race education region jobclass health
1 2006 18 1. Never Married 1. White 1. < HS Grad 2. Middle Atlantic 1. Industrial 1. <=Good
2 2004 24 1. Never Married 1. White 4. College Grad 2. Middle Atlantic 2. Information 2. >=Very Good
3 2003 45 2. Married 1. White 3. Some College 2. Middle Atlantic 1. Industrial 1. <=Good
health_ins logwage wage
1 2. No 4.318063 75.04315
2 2. No 4.255273 70.47602
3 1. Yes 4.875061 130.98218
到第九列第三列包含不想要的字符(第一元件),例如1或2個。
如何刪除所有不必要的字符和數字爲所有提到的列
宣嗨,看看這裏https://stackoverflow.com/help/how-to-ask這裏:https://stackoverflow.com/questions/5963269/如何使一個偉大的可重現的例子和修改你的問題。也可以在http://tidyverse.org/看看你的直接問題 – Jan