Skip to content

Commit aa1e452

Browse files
boutinbJorisGoosen
authored andcommitted
Update r-analyses-guide.md
1 parent c3e3163 commit aa1e452

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Docs/development/r-analyses-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Where `.binomReadData()` looks like
144144
Take note that the column titles in the data.frame returned by `.readDataSetToEnd()` will look a bit jumbled, e.g., the first column is titled `JaspColumn_.1._Encoded`, the second column is titled `JaspColumn_.2._Encoded`. This is due to the encoding we perform on the column titles, which allows us to handle foreign characters. The values in `options$variables` are NOT encoded and therefore do not match the column names in the dataset. Obviously this will present difficulties if we try to subset data later during the computation phase. The way we solve this is by using `decodeColNames()` to decode column names and `encodeColNames` to encode column names. To exemplify this, the following would return `TRUE`:
145145

146146
- `"firstColumnTitle" == decodeColNames("JaspColumn_.1._Encoded")`
147-
- `encodeColNames("JaspColumn_.1._Encoded") == "firstColumnTitle"`
147+
- encodeColNames("firstColumnTitle") == "JaspColumn_.1._Encoded"
148148

149149
Hence, whenever you wish to match an option to a data.frame column you must encode or decode one of the two. It is quite possible that an analysis crashes when it encounters uncommon characters. Such an error can be caused by the code in the analysis itself, but it can also be caused by a dependency that cannot handle these characters. To play it safe, we recommend only decoding column names at the very last moment before presenting output in a table of plot. To subset in a data set we recommend *encoding* the names in `options$variables`. For example,
150150

0 commit comments

Comments
 (0)