Skip to main content

Posts

Showing posts from August, 2014

How to read data from .csv file

Use read.table() It actually reads data into RAM. This is not good practice to use this for big data set. Use read.csv() or read.csv2() Assign to a variable nedat <- b="" data.csv="" orkingdirectory="" read.table=""> nedat    V1                                  V2 1  NA ,"EmpNo","EmpName","Location","Age" 2   1                  ,1,"AAAA","KOL",20 3   2                  ,2,"BBBB","MUM",23 4   3                  ,3,"CCCC","DEL",24 5   4                  ,4,"DDDD","CHE",45 6   5                  ,5,"EEEE","KOL",67 7   6                  ,6,"FFFF","MUM",54 8   7                  ,7,"GGGG","DEL",34 9   8                  ,8,"HHHH","CHE",65 10  9                  ,9,"IIII","KOL",45 11 10                 ,

Download a csv file

Identify current working directory getwd() Set working directory setwd() setwd("D:/Workingdirectory") Download file to your local directory URL <- https:="" p="" s3-xxxx="" testr.csv="" xxxxxx=""> download.file(URL, destfile = "data.csv", method="curl")