如何在行名中生成括号?
data.frame("gender"=c("man","woman"),"number(live in school)"=c(2340,1890))
gender number.live.in.school.
1 man 2340
2 woman 1890
我想要的格式输出是:
gender number(live in school)
1 man 2340
2 woman 1890
答案 0 :(得分:5)
使用参数check.names = FALSE
:
data.frame("gender" = c("man","woman"), "number(live in school)" = c(2340,1890),
check.names = FALSE)
# gender number(live in school)
# 1 man 2340
# 2 woman 1890