Unfortunately, I am neither able to save data in my working directory nor loading the data from it.

Hi, as a beginner, I am working through the monograph "Introduction to R for Social Scientists by Ryan Kennedy and Philip D. Waggoner. Up to now I have set the working directory, set up an R project and loaded packages (e. g. tidyverse and here). But now I am stuck. Unfortunately, I am neither able to load the library, save data in my working directory (nor loading the data from it).

If you could help me, I would be very grateful. J

I think you should be more specific for people to understand the issue. What errors are you getting?

Thank you for your answer.

I have just created an RStudio project but I am not able to keep data files there. I really do not know how to save them or export datasets (with Mac) into R.

Where is your data stored? On what kind of media (a file, a database, etc)? If it is a file, what kind of file (csv, xlsx, txt, etc)?

Ideally, to help us help you, you should prepare a reproducible example (reprex) illustrating your issue. Please have a look at this guide, to see how to create one:

The Link
https://uofh-my.sharepoint.com/personal/rkennedy_cougarnet_uh_edu/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Frkennedy_cougarnet_uh_edu%2FDocuments%2FI2RSS%2Fdata.zip&parent=%2Fpersonal%2Frkennedy_cougarnet_uh_edu%2FDocuments%2FI2RSS&originalPath=aHR0cHM6Ly91b2ZoLW15LnNoYXJlcG9pbnQuY29tLzp1Oi9nL3BlcnNvbmFsL3JrZW5uZWR5X2NvdWdhcm5ldF91aF9lZHUvRWZRVHBQSmt4X3BJaWVPaUhWOTBocEFCM0dmdV9RVElyX1JjUjNNWW9FOHRlZz9ydGltZT0zS1NsRE5iNTJFZw

The data is stored in "Statescsv.csv".

But I have no idea how to save the file in the working directory and then open it.

Thank you! J

Your working directory is just a folder in your computer you could simply download the file on that folder like you would do with any other file.

Now to load the data into memory (I think this is what you mean by "open it") you can use the read.csv() function.

Check the documentation to learn how to use it

https://www.rdocumentation.org/packages/utils/versions/3.6.2/topics/read.table

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

Great - thanks for your help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.