you read from the text file into a test data.frame object.
You then never refer to this again; thats a mistake
to use select you must pass the object to select from as the first param either directly or indirectly with the pipe |> (modern R4.2+) or magrittr pipe %>%
you have written the select with an equal sign , implying to do a rename at the time of selection;
the message is clear in that there is no Total column to choose and rename to be .test
you can find the names of your columns in test with the names command
names(test)
Note : R is case sensitive so Total will not match total
Thanks it works now
I have just an issue with your multipliying colums example
Do you know why I have "NA"?
> test$Units * test$Total
Error in test$Units * test$Total :
non-numeric argument to binary operator
> test$Units(as.numeric) * test$Total(as.numeric)
Error: attempt to apply non-function
> as.numeric(test$Units) * as.numeric(test$Total)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[27] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Warning message:
NAs introduced by coercion
either of Units or Total are not suitable to be directly interpreted as numerics; often times this is because of punctuation. if you are able to use libraries, you might find it convenient to try readr package as its parse_number() function is somewhat more forgiving as to inputs its presented with. Aside from that ... You should explore the contents of your columns to understand what they are.
If you would like assistance consider making a reprex.
test$Units is a vector object being used as a function object which won't work. A function object applied to another function object is fine so long as the return value can be used with a binary operator such as *