I created two new variables using my original data, but I can't get them to show up in my data set. I tried using mutate and a few other functions but I am not having any luck. I am assuming the variables need to be in the data table because next, I need to generate bar charts and box plots using all the data in the file. When I run summary(on my original data) my new variables don't show up either I have to run summary(on my new variables) separately in order to generate summary data.
mutate(), like other tidyverse functions, doesn't perform in-place modifications, you have to manually assign the changes to a new object (or the same object if you want) using the assign operator <-, take a look at this example.
Hello! Thank you for the recommendation and the example. It was helpful. It turns out I do not have the add-on package dplyr and therefore the mutate function will not be an option for me. I was unable to download it from the Rstudio library because I have the open source version (3.6) of Rstudio. By chance is there any other option I have to add newly created variables to my data table if I have this basic open source version?
I belive you are confusing R with Rstudio they are two different pieces of software, even though, using the open source version of Rstudio doesn't prevent you from installing any R package. (almost all of them are open source).
You just have to install it using
Hello!! Thank you for the response! Sorry for the delayed response. I ended up using a cbind() to include the newly created variables to my data table. I did try installing library("tidyverse") and it looked like they were installing correctly in the beginning and then at the last minute something went wrong (again). I will talk with my professor regarding why on earth I keep receiving the message that the open software is the problem.
Hello!! Thank you for your help! Sorry for the delayed response. I ended up using a cbind() to include the newly created variables to my data table. I did try installing the install.packages('dplyr') and it looked like they were installing correctly in the beginning and then at the last minute something went wrong (again). I will talk with my professor regarding why on earth I keep receiving the message that the open software is the problem.
Thanks again, I appreciate your help and I'm sure I'll have more questions soon.