Repository navigation
readDatasetFromJaspFile keeps the level order of the file - #25
Merged
Merged
Conversation
…columns The bridge gives nominal columns as factors and ordinal columns as ordered factors, with their levels in the order of the file, but readDatasetFromJaspFile turned them into character vectors. Loaded again with loadDataSet(), their levels were then ordered alphabetically: in puppies.jasp (jaspAnova) Dose became "15 mins", "30 mins", "No puppies" instead of "No puppies", "15 mins", "30 mins", so its simple and custom contrasts compared other levels than in JASP. The factors are now kept, and loadDataSet() keeps their level order (jasp-stats#19). Version 1.4.3 (after 1.4.2 of readAnalysisResultsFromJaspFile). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boutinb
added a commit
to jasp-stats/jaspTools
that referenced
this pull request
Nov 16, 2026
jaspSyntax 1.4.3 (jasp-stats/jaspSyntax#25) gives nominal and ordinal columns as factors with their levels in the order of the file, instead of character vectors. The tests compare categorical columns by their values, so they pass with both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 16, 2026
Run the analyses of a .jasp file again through jaspSyntax and the R wrapper
jasp-stats/jaspTools#101
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
readDatasetFromJaspFile()turned nominal and ordinal columns into character vectors. When thatdata.frameis loaded again withloadDataSet(), the levels are then ordered alphabetically instead of in the order of the file (the order JASP shows).That changes results whenever the level order matters. For example, in
puppies.jaspandpuppy_love.jaspof jaspAnova,Dosehas the levels "No puppies", "15 mins", "30 mins". Alphabetically "No puppies" comes last, so the simple contrasts use another reference level and the custom weights-2, 1, 1apply to the wrong levels. jaspTools'extractDatasetFromJASPFile()+runAnalysis()therefore gave other contrast tables than those saved in the file.Change
readDatasetFromJaspFile()now keeps the factors the bridge gives (normalize = FALSE): nominal columns are factors, ordinal columns ordered factors, with their levels in file order.loadDataSet()keeps that order since #19.readDatasetFromJaspFileupdated.test-jasp-file-factor-levels.Ronfixtures/jasp-files/puppies-levels.jasp(puppies.jasp without its results, 12 KB): the level order is that of the file, and it survivesloadDataSet().normalize = FALSE.With this change, the old jaspTools path gives the contrast tables saved in both files.
Behaviour change for callers: categorical columns come back as factors instead of characters. jaspTools' tests of
extractDatasetFromJASPFile()are updated for that in jasp-stats/jaspTools#101.Version 1.4.3: this follows #24 (1.4.2). If this one is merged first, the version line conflicts trivially.
🤖 Generated with Claude Code