Access data in workspace R

I’m a tutorial with R. Maybe very simple things that I may not be familiar with. If so, I apologize.

I am trying to access data provided to me by an external source. It works like a workspace. My process is as follows:

>ls() [1] "2003OHT-HR" > attach(2003OHT-HR) Error: unexpected symbol in "attach(2003OHT" 

I assume that β€œ-” is an illegal character or something else, but I don’t know what to do with it. I looked around and tried a couple of other things, but I can’t access it. Anything I could do to access the data would be great, even exporting it to a different format or something like that. Thank you so much for your help.

+4
source share
1 answer

You can get around it by including the data frame in the back ticks:

 > `2003OHT-HR` <- data.frame(Normal=rnorm(100)) > head(`2003OHT-HR`) Normal 1 -1.28498109551429 2 -0.71140764617235 3 -0.21274972139595 4 1.36845373456725 5 0.05221904829256 6 -1.64995142910773 > 
+4
source

Source: https://habr.com/ru/post/1484740/


All Articles