import_query {vivainsights} | R Documentation |
Import a query from Viva Insights Analyst Experience
Description
Import a Viva Insights Query from a .csv file, with variable classifications optimised for other functions in the package.
Usage
import_query(
x,
pid = NULL,
dateid = NULL,
date_format = "%m/%d/%Y",
convert_date = TRUE,
encoding = "UTF-8"
)
Arguments
x |
String containing the path to the Viva Insights query to be
imported. The input file must be a .csv file, and the file extension must
be explicitly entered, e.g. |
pid |
String specifying the unique person or individual identifier
variable. |
dateid |
String specifying the date variable. |
date_format |
String specifying the date format for converting any
variable that may be a date to a Date variable. Defaults to |
convert_date |
Logical. Defaults to |
encoding |
String to specify encoding to be used within
|
Details
import_query()
uses data.table::fread()
to import .csv files for
speed, and by default stringsAsFactors
is set to FALSE. A data frame is
returned by the function (not a data.table
). Column names are automatically
cleaned, replacing spaces and special characters with underscores.
Value
A tibble
is returned.
See Also
Other Import and Export:
copy_df()
,
create_dt()
,
export()