使列名称好R [英] Making good column names R
本文介绍了使列名称好R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用RODBC从Microsoft Access读取了一个表.有些变量的名称中带有空格.
I read a table from Microsoft Access using RODBC. Some of the variables had a name with a space in it.
R没问题,但我有. 我不知道如何指定空格
R has no problem with it but I do. I cannot find out how to specify the space
names(alltime)
[1] "ID" "LVL7" "Ref Pv No" "Ref Pv Name" "DOS" "Pt Last Name" "Pt First Name" "MRN" "CPT" "CPT Desc" "DxCd1" "DxCd2" "DxCd3" "DxCd4"
[15] "DOE"
但是如果我想做这样的事情怎么办
But what do I do if I want to do something such as this
> alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT Desc,]
Error: unexpected symbol in "alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT Desc"
推荐答案
另请参见make.names
这篇关于使列名称好R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文