When knitting I get the error line: Quitting from lines 70-96 (218276.Rmd) Error: Column Gender
is unknown Execution halted
This is the code between the lines:
### 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)
The code itself runs and produces the table. There is no typo with gender. I cannot just ignore the error as it will be knitted by a marker with errors enabled. When gender or condition is removed from the code an error is still found with the other column name. I've tried using data$Gender but does not work.