import_data_file {eufmdis.adapt}R Documentation

Import data from csv file in Shiny App

Description

The function is used in the ADAPT app to import data from uploaded csv files into a data frame. Only relevant columns are returned, the column names are matched and unified, so that data produced by different versions of the EuFMDiS software can be used.

Usage

import_data_file(
  pattern,
  names_files,
  paths_files,
  def_columns,
  transpose = FALSE
)

Arguments

pattern

Character string containing a regular expression to identify the correct file by its name.

names_files

Character vector of file names as they were uploaded (= file name on the original file system from which they were uploaded)

paths_files

Character vector of file names + absolute paths of the files in the local hard drive to which they were uploaded. Each entry of paths_files corresponds to an entry of names_files. They must have the same length.

def_columns

Data frame of meta information containing the possible column names in the different versions of the EuFMDiS output files. The data frame must contain columns Datensatz (name of the relevant data frame; this corresponds to values used in pattern), Name_Parameter (the unified column name in the generated return value) and columns containing possible variations of the name in the different versions of EuFMDiS. Each column contains the notation in one version of EuFMDiS; the column names must begin with the string Spalte

transpose

Logical flag (default = FALSE). COntrols whether the data frame should be transposed prior to any data manipulation/extraction.

Value

Data frame containing the columns defined in def_columns for the relevant Datensatz according to the argument pattern.


[Package eufmdis.adapt version 0.1.0 Index]