Re: [R] Passing variable name

2020-12-27 Thread Rui Barradas
Hello, Or maybe V1 and V2 are variables that hold column names? If so see thess StackOverflow posts [1], [2]. The trick is to use [[, not $ to extractthe columns. V1 <- "Gender" V2 <- "Hand" MyT2 <- table(MyData[[V1]], MyData[[V2]]) [1]:

Re: [R] Passing variable name

2020-12-27 Thread Jim Lemon
Sorry, Bert, I also forgot to copy to the list. Hi Seyet Ali, If you have created the data frame, you probably know that "Gender", "Hand" and "Gr" are the names of the vectors of values that are joined in the data frame "MyData". You now wish to change those names. I don't know why you would

Re: [R] Passing variable name

2020-12-27 Thread Bert Gunter
This is a *plain text* list. As you can see from the included text that I received, the HTML version that you sent was somewhat mangled by the server. I do not know whether or not enough got through for you to get a helpful reply, but if not, re-send *to the list, not me* in *plain text*. Bert

[R] Passing variable name

2020-12-27 Thread Seyit Ali KAYIS
Dear R users, � I have a data frame as below. In part 1, I have created a table for Gender and Hand, performed Chi-Square test and made graph using ggplot. � I want to replace the original variable names (Gender and Hand) with V1 and V2 and to be able to perform those things again as in