Reputation: 11
So, I have this "easy" homework: I have a set of 50 numbers and I have to get the mean, standard deviation and other related measures out of them. I know the R functions for that; the problem is that, I can´t get the dataset into R Studio, so that I can apply functions to it.
I created an Excel file with the data, called "Datos taller de Est", which consist of one column with the name of the variable at the start of it, ("Horas de espera", which is spanish for hours waiting, since the numbers are about the hours that some patients wait before getting treated by a doctor at a clinic), and then the 50 numbers - so, is a column of 51 entries-.
Then, I clicked on "Import dataset", excel file, and is there, at another tab, I´ve got the column with the data. But, when I go back to the first tab, where I´m supposed to type the code, I´ve tried it all to bring it there so that I can work with it but I always get the error message:
"The following object is masked from Datos_taller_de_Est (pos = 5):
Horas de espera"
First, I typed:
> attach (Datos_taller_de_Est)
, and I got the aforementioned error message.
Afterwards, by visiting this website: https://www.r-bloggers.com/to-attach-or-not-attach-that-is-the-question/
I typed:
"Datos_taller_de_Est" = read_excel(Datos_taller_de_Est)
names(Datos_taller_de_Est)
attach (Datos_taller_de_Est)
rm(Datos_taller_de_Est)
And what I got was that the console read the first entry "Horas de espera", like this:
[1] "Horas de espera"
But it didn´t read the 50 integers!
How will I be able to read the 50 integers from the Excel file?
Upvotes: 0
Views: 4392
Reputation: 2493
First advice, don't use empty spaces in your variable names, using underscores is a good practice in R.
Second advice, if you just need to load this data once, use the datapasta
package, you just have to select your data on Excell, press Ctrl + c, and then go to R console and type datapasta::df_paste()
.
Third advice, this kind of questions are more suited for https://community.rstudio.com
Upvotes: 1