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

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


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

Great - thanks for your help!