I have a dataframe, with one column as factor. I want to subtract 1 from all rows in my column, but when i try i get an error message that " - " is not meaningful for factors.
How can i do this?
I have a dataframe, with one column as factor. I want to subtract 1 from all rows in my column, but when i try i get an error message that " - " is not meaningful for factors.
How can i do this?
Factors aren't numbers even though there is a numbering system under them. Thus, when you try to substract 1 from factor levels, software will error. This is a logic error, not a software error.
Did you want factors, or was your data converted to factors when you imported it? If you want numeric data, you can convert factors to numbers by using one command.