![]() Let's consider the following data present in the file named input.csv. The csv file is a text file in which the values in the columns are separated by a comma. This result depends on your OS and your current directory where you are working. When we execute the above code, it produces the following result − # Get and print current working directory. You can also set a new working directory using setwd()function. You can check which directory the R workspace is pointing to using the getwd() function. Getting and Setting the Working Directory Of course we can also set our own directory and read files from there. The file should be present in current working directory so that R can read it. In this chapter we will learn to read data from a csv file and then write data into a csv file. R can read and write into various file formats like csv, excel, xml etc. We can also write data into files which will be stored and accessed by the operating system. In R, we can read data from files stored outside the R environment. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |