Anton Kotov
Anton Kotov

Reputation: 11

Error in initialize(...) :variable names are limited to 10000 bytes

I have a spreadsheet in excel where the 4th column contains messages. I need to assign each message one of three tokens “X”, “Y”, “X/Y” depending on whether only “X” or only “Y” or both occur in that message. Next is the code. When running, an error appears "Error in initialize(...) :variable names are limited to 10000 bytes". I don't understand what should be changed.

file_path <- "...xlsx"
data <- read_excel(file_path)

data <- data %>%
  mutate(marker = case_when(
    grepl("X", .[[4]], ignore.case = TRUE) & grepl("Y", .[[4]], ignore.case = TRUE) ~ "X/Y",
    grepl("X", .[[4]], ignore.case = TRUE) ~ "X",
    grepl("Y", .[[4]], ignore.case = TRUE) ~ "Y",
    TRUE ~ NA_character_   #
  ))

I don't know what to do

Upvotes: 1

Views: 34

Answers (0)

Related Questions