Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types in formula #5728

Merged
merged 6 commits into from
Nov 11, 2024
Merged

Conversation

boutinb
Copy link
Contributor

@boutinb boutinb commented Nov 5, 2024

The formula in R Syntax should add the the types of the variables (if they are changed):
formula = ~ contNormal + contBinom.scale

The generation of the formula and the parsing of the formula should be then adapted for this.

Fixes jasp-stats/jasp-issues#2990

Also the R wrappers are updated (hopefully thanks to the R Syntax project, the generation of the wrappers will be automated!)

To test it:

  • Open the R Syntax, change the variables, and apply it.
  • Copy the R Syntax, open a new analysis, paste it and apply it
  • Duplicate analyses to check that the options can be read again in a new analysis.

@JorisGoosen
Copy link
Contributor

afbeelding afbeelding

And there is no need to escape the columnName.type just for the dot, dots are normal parts of names in R

@boutinb
Copy link
Contributor Author

boutinb commented Nov 8, 2024

@JorisGoosen This is ready to be tested.

@@ -50,6 +50,7 @@ class ColumnTypesModel : public QAbstractListModel
void setTypes(columnTypeVec types);
bool hasType(columnType type) const;
bool hasAllTypes() const;
bool hasMandatoryType() const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat is een mandatory type precies?


Json::Value ListModel::getVariableTypes(const Terms& terms, bool onlyChanged) const
{
if (onlyChanged && _listView->hasMandatoryType()) // Don't need to ask for the changed types: this avoids to add the type in formula when it is not necessary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok mss wel duidelijk

@JorisGoosen JorisGoosen merged commit e6abf6d into jasp-stats:development Nov 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: R Syntax doesn't work
2 participants