Import Data From FormScanner

Share:

Description

This function imports data from the FormScanner software.

Usage

1
read.formscanner(file, col.names, conc = NULL, id = NULL, dummy = NULL)

Arguments

file

the name of the csv file to be imported.

col.names

the names of the columns. If NULL the names of the columns are those given in the csv file.

conc

a vector containing which columns to concatenate. Columns can be specified by name or number.

id

name of the column that uniquely identifies the row.

dummy

a vector containing the columns to convert to dummy variables. Columns can be specified by name or number.

Details

If some columns are concatenated using argument conc, the name of the newly created variable is the name of the first column.

test and questionnaire are instances of the output of function read.formscanner.

When id is obtained as the concatenation of different columns using argument conc, id should be set equal to the first column concatenated.

Value

A data frame.

Author(s)

Michela Battauz

References

Borsetta, A. (2016). FormScanner, [Computer Software], URL http://sourceforge.net/projects/formscanner/.

See Also

addkey, addweights

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# find the directory with package fsia
dir_pkg <- find.package("fsia")
# the example files are in the directory examples
# create the path
questionnaire_path <- file.path(dir_pkg, "examples", "scan_results_questionnaire.csv")
test_path <- file.path(dir_pkg, "examples", "scan_results_test.csv")
# import file "scan_results_questionnaire.csv"
questionnaire_imp<-read.formscanner(questionnaire_path, dummy = "Q5.sources")
questionnaire_imp
# questionnaire_imp is equal to the data questionnaire
# import file "scan_results_test.csv"
test_imp <- read.formscanner(test_path, conc = paste("id", 1:6, sep = ""), id = "id1")
test_imp
# test_imp is equal to the data test