You can define a grid in a Microsoft Excel file (suffix .xlsx
). The file must have one of
two formats (wide
or long
, see format sections below).
importExcel(file, sheet = 1, format = "wide", rmin = NULL, rmax = NULL)
A repgrid
object (one input file) or a named list with repgrid
objects (several input files). List names are
filename + sheet.
Path(s) to Excel file(s) (suffix .xlsx
).
Names or indexes of sheet with grid data to import.
Two formats are supported. wide
(default): each column represents one element, each row represent
one constructs. long
: each row contains one rating value for a element-construct combination. See
sections below and examples.
Min and max of the rating scale (numeric
, default NULL
).
In the wide
format, each element has a separate column, and each row contains the ratzings for one construct.
It is a common way to represent grid data and looks like this:
1 | element_1 | element_2 | element_3 | element_4 | 5 | preferred |
left_pole_1 | 1 | 5 | 3 | 4 | right_pole_1 | left |
left_pole_2 | 3 | 1 | 1 | 3 | right_pole_2 | right |
left_pole_3 | 4 | 2 | 5 | 1 | right_pole_3 | NA |
The header row contains the minimum of the rating scale (1
), the names of the elements (element_1
to element_4
),
the maximum of the rating scale (5
), and optionally the column preferred
, indicating the preferred pole.
Each row contains the constructs entries (left pole, ratings, right pole, preferred pole). The preferred pole
must be one of left
, right
, none
, NA
(see preferredPoles()
).
The long
format has this name because it has few columns and many rows. It is a common format
in data analytics. Here, each row contains a different element-construct combination and the corresponding rating
value. The format looks like this:
element | left_pole | right_pole | rating | preferred_pole | rmin | rmax |
element 1 | left pole 1 | right pole 1 | 1 | left | 1 | 5 |
element_2 | left pole 1 | right pole 1 | 5 | left | 1 | 5 |
element_3 | left pole 1 | right pole 1 | 4 | left | 1 | 5 |
The columns element
, left_pole
, right_pole
, and rating
are mandatory, the columns preferred_pole
, rmin
,
and rmax
are optional. rmin
and rmax
contain the min and max of the rating scale. Alternatively, you may
pass rmin
and rmax
as arguments in the function call.
Import data
importDataframe()
,
importGridcor()
,
importGridstat()
,
importGridsuite()
,
importScivesco()
,
importTxt()