Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[New to JASP] Help creating categories to use as filters

I am very new to JASP and need help with pretty basic things! I was wondering if there was a way to filter my data based on categories I want to make. For example, lets say that I have all sorts of information on t-shirts including their color (a column with "blue" "green" "red" etc for each shirt.) and I want to mass group all the shirts into "warm" or "cool" colors. Is is possible for me to create a filter where I could say "if shirt's color column says 'x,y, or z' then mark as 'cool'" and "if shirt is 'a,b, or c' mark as 'warm'" and then my all my data would be reorganized on the basis of this filter? Any advice would be welcomed, thanks!

Comments

  • Hey,

    You could make a computed column. If you scroll to the right in your dataview you will see a "plus"-symbol in the columns-header. Assuming you are using 9.1.0 anyway.
    Then you can create a column using R:

    Assuming your column with shirt colors is called "Shirt" you can fill it in by entering the following code:
    ifelse(Shirt == "Red" | Shirt == "Orange" | Shirt == "Terracotta" , "Warm", "Cold")

    If you want to add more colors you can simply add another '| Shirt == "ColourName" ' to the first argument.
    Make sure to capitalize everything correctly.

    Thanked by 2JASP_novice EJ
  • THANK YOU! This was exactly what I was looking for!

Sign In or Register to comment.