.xlsx
or .xls
file.
The .xlsx
or .xls
file has to be in specified fixed
format. The first row contains the minimum of the rating scale, the names of
the elements and the maximum of the rating scale. Below every row contains
the left construct pole, the ratings and the right construct pole.
importExcel(file, dir = NULL, sheetIndex = 1, min = NULL, max = NULL)
.xlsx
or .xls
.
If no file is supplied a selection pop up menu is opened to select
the files.NULL
).numeric
, default NULL
)
for minimum rating value in grid.numeric
, default NULL
)
for maximum rating value in grid.repgrid
object in case one file and
a list of repgrid
objects in case multiple files are imported.
1 & element 1 & element 2 & element 3 & 5 |
1 & element 1 & element 2 & element 3 & 5 |
1 & element 1 & element 2 & element 3 & 5 |
1 & element 1 & element 2 & element 3 & 5 |
Note that the maximum and minimum value has to be defined using the
min
and max
arguments if no values are supplied at the
beginning and end of the first row. Otherwise the scaling range is inferred
from the available data and a warning is issued as the range may be
erroneous. This may effect other functions that depend on knowing the correct
range and it is thus strongly recommended to set the scale range correctly.
A sample Excel file can be found here: http://www.openrepgrid.uni-bremen.de/data/grid.xlsx.
importGridcor
,
importGridstat
,
importScivesco
,
importGridsuite
,
importTxt
## Not run:
#
# # using the pop-up selection menu
# rg <- importExcel()
#
# # supposing that the data file sample.txt is in the current directory
# file <- "grid.xlsx"
# rg <- importExcel(file)
#
# # specifying a directory (arbitrary example directory)
# dir <- "/Users/markheckmann/data"
# rg <- importExcel(file, dir)
#
# # using a full path
# rg <- importExcel("/Users/markheckmann/data/grid.xlsx")
#
# # import more than one Excel file via R code
# files <- c("grid_1.xlsx", "grid_2.xlsx")
# rg <- importExcel(files)
# ## End(Not run)
Run the code above in your browser using DataLab