How to fix: Error: unexpected '>' in ">"

Hi there,

This is my code:

> cor(a_LSshort[c("WLLP", "WRT", "Cody", "Lernen", "mob_z", "INT_z", "EXT_z")]) # correlation matrix

When I ran it I got this error:

Error: unexpected '>' in ">"

Could anyone please tell me how to fix it?

Thanks!

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

1 Like

I assume you are copying the code from somewhere, just omit the ">" symbol.

2 Likes

Thanks!

Unfortunately now after omitting the ">" symbol in the code:
cor(a_LSshort[c("WLLP", "WRT", "Cody", "Lernen", "mob_z", "INT_z", "EXT_z")]) # correlation matrix

I got the following error:
Error in cor(a_LSshort[c("WLLP", "WRT", "Cody", "Lernen", "mob_z", "INT_z", :
supply both 'x' and 'y' or a matrix-like 'x'

Would you know how to overcome this?

what class is a_LSshort ?

Thanks, problem was solved when I turned my data into a table rather than a lits :slight_smile: