Read 'SurveyXact' Data

Imports data from the 'SurveyXact' commercial service < https://rambollxact.com>, adds variable labels, and converts value labels to factors in the same order as exported from 'SurveyXact'.


readSX

Lifecycle:stable CRANstatus R-CMD-check Codecov testcoverage Codecov testcoverage

The goal of readSX is to import survey data collected from the proprietary service SurveyXact. SurveyXact exports data in multiple tables: raw data, variable labels (and types), and value labels.

Installation

install.packages("readSX")

You can install the development version of readSX like so:

library(devtools)
devtools::install_github("NIFU-NO/readSX")

Example

library(readSX)
ex_survey2_xlsx <-
      read_surveyxact(filepath =
                      system.file("extdata", "ex_survey2.xlsx",
                      package = "readSX", mustWork = TRUE))

Features

  • Fixes legacy bugs in the SurveyXact data export.
  • Ensures data can be read no matter which data export format (Excel, CSV, ansi/utf8, comma/semicolon-separated).
  • Can read non-ASCII characters correctly - tested with Norwegian æøå.
  • As of version 1.8.2, applies factors for labelled values. (prior versions used the value labels-system of the labelled-package, which is only intended for Stata/SPSS/SAS where there can be multiple missing value codes). In SurveyXact, only blanks can be used for explicit missing, so this feature was redundant and confusing. Stick to R’s native factor vectors.
  • As of 1.8.4, contains function to ensure uploaded CSV file with respondents is in correct format.

TODO:

  • Tick boxes do not get correct label suffix? Automatically fix NA/FALSE for these?
  • Get SX to fix the bug in labels header
  • Get SX to fix the bug in Excel-sheets being separated into dataset(1)(2), etc.
  • Get SX to fix bug in Structure.csv having a phantom column at the end…

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("readSX")

0.8.8 by Stephan Daus, 7 months ago


https://github.com/NIFU-NO/readSX, https://NIFU-NO.github.io/readSX/


Report a bug at https://github.com/NIFU-NO/readSX/issues


Browse source code at https://github.com/cran/readSX


Authors: Stephan Daus [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, readxl, rlang, utils

Suggests covr, testthat


See at CRAN