Description Usage Arguments Details Value Author(s) References Examples
ImportTxtInternal is the parser for importTxt that constructs an import object.
The .txt
file has to be in a fixed format. There are three mandatory blocks each starting and ending
with a predefined tag in uppercase letters. The first block starts with ELEMENTS
and ends with END ELEMENTS
and contains one element in each line.
The other mandatory blocks contain the constructs and ratings (see below). In the
block containing the constructs the left and right pole are seperated by a
colon (:). To define missing values use NA
like in the example below.
One optional block contains the range of the rating scale used defined by two numbers.
The order of the blocks is arbitrary. All text not contained within the blocks
is discarded and can thus be used for comments.
A description of the gridstat data fromat can be found in Bell (2009, p. 5)
1 | importTxtInternal(file, dir, min, max)
|
file |
Filename including path if file is not in current working directory. File can also be a complete URL. The fileformat is .dat. |
dir |
Alternative way to supply the directory where the file is located
(default |
min |
Optional argument ( |
max |
Optional argument ( |
---------------- .txt file ----------------- |
anything not contained within the tags will be discarded |
ELEMENTS |
element 1 |
element 2 |
element 3 |
END ELEMENTS |
CONSTRUCTS |
left pole 1 : right pole 1 |
left pole 2 : right pole 2 |
left pole 3 : right pole 3 |
left pole 4 : right pole 4 |
END CONSTRUCTS |
RATINGS |
1 3 2 |
4 1 1 |
1 4 4 |
3 1 1 |
END RATINGS |
RANGE |
1 4 |
END RANGE |
---------------- end of file ---------------- |
Note that the maximum and minimum value has to be defined using the min
and
max
arguments if no RANGE
block is contained in the data file.
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.
List of relevant data.
Mark Heckmann
Bell, R. C. (2009). Gridstat version 5 - A Program for Analyzing the Data of A Repertory Grid (manual). University of Melbourne, Australia: Department of Psychology.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# supposing that the data file sample.txt is in the current directory
file <- "sample.txt"
imp <- importTxtInternal(file)
# specifying a directory (arbitrary example directory)
dir <- "/Users/markheckmann/data"
imp <- importTxtInternal(file, dir)
# using a full path
imp <- importTxtInternal("/Users/markheckmann/data/sample.txt")
# load Gridsuite data from URL
imp <- importTxtInternal("http://www.openrepgrid.uni-bremen.de/data/sample.txt")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.