How to read csv file using php?

What folder does R look at when trying to import a file?  I'm using the read.csv command.

  • Answer:

    R looks at the current working directory for importing a file, if full path of the file is not given. getwd() gives the current working directory and working directory can be changed using setwd().

Answer Wiki at Quora Visit the source

Was this solution helpful to you?

Other answers

You can use getwd() to see where R is looking, and setwd() to change it. Or you can use the full path of the filename.

Michael Hochster

You can use full address. (e.g., "C:/. . .")

David Jorjani

If you are on Windows, you can also use: file.choose() where the filename goes and a window pops up in which you can make a choice.

Patrick Burns

To add it further you can use this to write and read files, much elegant way of handling files http://stackoverflow.com/questions/4216753/check-existence-of-directory-and-create-if-doesnt-exist

Utkarsh Naiknaware

I have very interesting question about file import into R.  I have a file mydata.cvs   This file is updating by the software every 2 seconds and data is added. How do you work out this problem ? I mean how to refresh data in R ?  Do you use some file read/write ? I just wondering why doesn't exist stream data package in such useful language ? I know that R doesnt support streams by itself, but would be nice to have one. Nowadays the data changes  very quickly and it will be very usefull

Rimantas Venckus

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.