Removing numbers in data

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
dandak
Posts: 3
Joined: Sun Mar 07, 2021 4:31 am

Removing numbers in data

Post by dandak »

I need some basic help in jamovi. I have data in a column that has text and numbers (e.g., AZ - 5). I want to remove the hyphen and number in the data and just keep the text. Is there anyway I can do this besides retyping it? Any advice would be appreciated. Thanks!
User avatar
jonathon
Posts: 2625
Joined: Fri Jan 27, 2017 10:04 am

Re: Removing numbers in data

Post by jonathon »

you could compute a new variable and use the SPLIT() function.

SPLIT(variable, ' ', 1)

what this does is splits the values up where spaces occur, so "AZ - 5" becomes "AZ", "-", "5". the third argument (1 in this case) refers to the first of those elements, so we're just left with "AZ".

here's some more details on computed variables:

https://blog.jamovi.org/2017/11/28/jamovi-formulas.html

if you're wanting to transform multiple variables in this way, you may be better off with transformed variables:

https://blog.jamovi.org/2018/10/23/tran ... ables.html
Screen Shot 2021-03-07 at 16.25.09.png
Screen Shot 2021-03-07 at 16.25.09.png (74.34 KiB) Viewed 2434 times
cheers

jonathon
dandak
Posts: 3
Joined: Sun Mar 07, 2021 4:31 am

Re: Removing numbers in data

Post by dandak »

Jonathan -

Thank you so much for your quick help and thorough explanation. It worked!!! ;)

I have one more question - where can I find more posts about manipulating the data and columns? I can't find help on this and this is the part of jamovi I'm struggling with. For example, I also have two combine two columns of data into one. I've Googled this and looked through the information on jamovi but can't find information like that. So, if you have any advice, I'd appreciate it. I'm so grateful already for what you've done.

Amanda
User avatar
jonathon
Posts: 2625
Joined: Fri Jan 27, 2017 10:04 am

Re: Removing numbers in data

Post by jonathon »

hi amanda,

those two blog posts, and the fx box in jamovi are your main sources of help (you'll notice a small button to the left of the formula box in computed/transformed variables, with a fx on it, if you click that it lists all the functions available).

depending on what you're combining, a formula like:

varNameA + varNameB

may be just what you need.

cheers

jonathon
dandak
Posts: 3
Joined: Sun Mar 07, 2021 4:31 am

Re: Removing numbers in data

Post by dandak »

Thanks for the tip about the fx box - wasn't aware of that. I think I'll be good to go from here. Thank you again for your help. I really appreciate it!

Amanda
User avatar
jonathon
Posts: 2625
Joined: Fri Jan 27, 2017 10:04 am

Re: Removing numbers in data

Post by jonathon »

yeah, it's easy to not notice the fx box ... i've never been able to think of a good way to draw people's attention to it.

cheers

jonathon
Post Reply