При вязании появляется строка ошибки: Выход из строк 70-96 (218276.Rmd) Ошибка: Столбец Gender
неизвестен Выполнение остановлено
Это код между строками:
### Create any descriptives and/or tables you want to review or include in the report and save each inside an object:
# table_name <- ...table code...
# To make a table appear in a particular place in your report,
# create a code chunk in the corresponding place in this Rmd file
# and put the name of the table object there
# Gender and condition by age
age_desc <- data %>%
group_by(Gender, Condition) %>%
summarise(
n = n(),
perc = n()/nrow(data) * 100,
mean_age = mean(Age),
sd_age = sd(Age),
min_age = min(Age),
max_age = max(Age)
)
age_desc %>%
kable(col.names = c("Gender", "Condition", "N", "%", "Age-Mean", "Age-SD", "Min-Age", "Max-Age"),
caption = "Table 1: Descriptive statistics by Gender and Condition",
digits = 2) %>%
kable_styling(fixed_thead = T)
Сам код запускается и создает таблицу. Нет опечаток с полом. Не могу просто игнорировать ошибку, так как она будет связана маркером с включенными ошибками. Когда пол или условие удаляются из кода, ошибка по-прежнему обнаруживается с другим именем столбца. Я пробовал использовать data $ Gender, но не работает.