我的表格有这样困难的标题:
Subject Cat Nbr Title Instruction..Mode!
1 XYZ 101 Intro I ONLINE
2 XYZ 102 Intro II CAMPUS
3 XYZ 135 Advanced CAMPUS
我想用dplyr::rename()
df %>%
rename(subject = Subject,
code = Cat Nbr,
title = title,
mode = Instruction..Mode!)
但我得到Error: unexpected symbol in:
我如何协调这个?
答案 0 :(得分:13)
要引用包含非标准字符或以数字开头的变量,请在后面的刻度中包装名称,例如`Instruction..Mode!`