data <- read.csv("survey_599469_R_data_file.csv", quote = "'\"", na.strings=c("", "\"\""), stringsAsFactors=FALSE, fileEncoding="UTF-8-BOM") # LimeSurvey Field type: F data[, 1] <- as.numeric(data[, 1]) attributes(data)$variable.labels[1] <- "id" names(data)[1] <- "id" # LimeSurvey Field type: DATETIME23.2 data[, 2] <- as.character(data[, 2]) attributes(data)$variable.labels[2] <- "submitdate" names(data)[2] <- "submitdate" # LimeSurvey Field type: F data[, 3] <- as.numeric(data[, 3]) attributes(data)$variable.labels[3] <- "lastpage" names(data)[3] <- "lastpage" # LimeSurvey Field type: A data[, 4] <- as.character(data[, 4]) attributes(data)$variable.labels[4] <- "startlanguage" names(data)[4] <- "startlanguage" # LimeSurvey Field type: A data[, 5] <- as.character(data[, 5]) attributes(data)$variable.labels[5] <- "seed" names(data)[5] <- "seed" # LimeSurvey Field type: DATETIME23.2 data[, 6] <- as.character(data[, 6]) attributes(data)$variable.labels[6] <- "startdate" names(data)[6] <- "startdate" # LimeSurvey Field type: DATETIME23.2 data[, 7] <- as.character(data[, 7]) attributes(data)$variable.labels[7] <- "datestamp" names(data)[7] <- "datestamp" # LimeSurvey Field type: A data[, 8] <- as.character(data[, 8]) attributes(data)$variable.labels[8] <- "Single choice question with answer codes and labels (code a/b/c):" data[, 8] <- factor(data[, 8], levels=c("a","b","c"),labels=c("Option A", "Option B", "Option C")) names(data)[8] <- "Q00" # LimeSurvey Field type: F data[, 9] <- as.numeric(data[, 9]) attributes(data)$variable.labels[9] <- "Yes/No question (code 1/0):" data[, 9] <- factor(data[, 9], levels=c(1,0),labels=c("Yes", "No")) names(data)[9] <- "Q01" # LimeSurvey Field type: A data[, 10] <- as.character(data[, 10]) attributes(data)$variable.labels[10] <- "Yes/No question (code Y/N):" data[, 10] <- factor(data[, 10], levels=c("Y","N"),labels=c("Yes", "No")) names(data)[10] <- "Q02"