## Not run:
#
# # identification number is in column "File name"
# # key is given in the first row
# data(mchoice1)
# data(key)
# key1 <- key
# key1$File.name <- 0
# mchoice1k <- rbind(key1[, colnames(mchoice1)], mchoice1)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1k, "mchoice1k.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1k.csv", keyline = 1, id = "File.name")
# head(fs1$data)
# fs1$key
#
# # identification number is in column "File name"
# # key is given in a separate file
# data(mchoice1)
# data(key)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1, "mchoice1.csv", row.names = FALSE)
# # NOTE: the following line creates a file with the key
# write.csv2(key, "key.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1.csv", keyfile = "key.csv", id = "File.name")
# head(fs1$data)
# fs1$key
# # in this case, fs1 is equal to the data set exam1
#
#
# # identification number is in column "File name"
# # key is given in an R dataset
# data(mchoice1)
# data(key)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1, "mchoice1.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1.csv", keydata = key, id = "File.name")
# head(fs1$data)
# fs1$key
# # in this case, fs1 is equal to the data set exam1
#
# # identification number is created by concatenating different fields
# # key is given in the first row
# data(mchoice1id)
# data(key)
# key1 <- key
# key1$File.name <- "CCF27112014_01000"
# key1$N1 <- key1$N2 <- key1$N3 <- key1$N4 <- key1$N5 <- key1$N6 <- 0
# mchoice1idk <- rbind(key1[, colnames(mchoice1id)], mchoice1id)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1idk, "mchoice1idk.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1idk.csv", keyline = 1, id = "N1",
# conc = c("N1", "N2", "N3", "N4", "N5", "N6"))
# head(fs1$data)
# fs1$key
#
# # identification number is created by concatenating different fields
# # key is given in a separate file
# data(mchoice1id)
# data(key)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1id, "mchoice1id.csv", row.names = FALSE)
# # NOTE: the following line creates a file with the key
# write.csv2(key, "key.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1id.csv", keyfile = "key.csv", id = "N1",
# conc = c("N1", "N2", "N3", "N4", "N5", "N6"))
# head(fs1$data)
# fs1$key
#
# # identification number is created by concatenating different fields
# # key is given in an R dataset
# data(mchoice1id)
# data(key)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1id, "mchoice1id.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1id.csv", keydata = key, id = "N1",
# conc = c("N1", "N2", "N3", "N4", "N5", "N6"))
# head(fs1$data)
# fs1$key
#
# # identification number is created by concatenating different fields
# # key is NULL
# data(mchoice1id)
# # NOTE: the following line creates a file with the same format of FormScanner
# write.csv2(mchoice1id, "mchoice1id.csv", row.names = FALSE)
# fs1 <- read.formscanner(file = "mchoice1id.csv", id = "N1",
# conc = c("N1", "N2", "N3", "N4", "N5", "N6"))
# head(fs1$data)
# fs1$key
# ## End(Not run)
Run the code above in your browser using DataLab