You may also want to have a look at the rio package. It is a bit like a universal can opener though I have also seen it described as a Swiss Knife. It really simplifies a lot of data import.
Posit Cloud is running on a server, not your computer. To access a file on your local drive, you need to upload it to the server. Click on the Files tab (in the lower right pane) then on Upload. In the Upload Files dialog, click on Choose File, navigate to the file and click on Open. You can also change the target directory for the upload. You may have a created a data folder in the project folder and want to upload the file to there.
Yeah. I have done that but I'm finding it difficult to make use of the data on the Posit Cloud. I feel like I need a video illustration of how this thing works and not just them showing me codes. It's really stressing me here: sleepy:
I just uploaded the file airline.xlsx to Posit Cloud without putting it into a folder (it appears at the same level on the Files tab as project.Rproj) and then imported it as a tibble named df. A tibble is a enchanced kind of data frame. Because the file is at the top level you do not need to specify a path other than the file name. This code worked with no problems. If I had put it in a folder named data, it would be "data/airline.xlsx"
I am on Linux so my equivalent is something like
mydata <- import("/home/john/RJunk/filename.xlsx")
If the file is in your working directory then
mydata <- import("filename.xlsx")
is all you need.
To check what is your working directory do:
getwd()
`rio` has two or three commands for dealing with different data structures but `import` should handle most of what you are likely to encounter at the moment.
yes I did. for once it did upload but then the R session restarts and I lost everything I upload. So I started saving my workspace to not loose the uploaded file. but now it shows error can't read_csv file even if in history it shows as read. the view file shows but when I try to read_csv, it is showing error
Hi!
I tried it all still getting errors to load the file, I have used rio package and realxl package. I am still getting the error.
code: chocolatedata<- import("C:\courseera\flavors_of_cacao.csv")