It invokes a text editor to enter data manually. A empty data frame needs to be created first, then edit() needs to be invoked. edit() df<-edit(df) fix(df), it adds more elements into the data frame edit() needs to be assigned to a data frame, otherwise the data will be erased once the editor is closed. header = TRUE, then the first row will be treated as the column df<-read.table(text=file) names. read.table() df<-read.table(“file.csv”) sep = ““ white space is the default separator. It reads delimited text file in table formant and saves it as a data frame. df<-read.table(“URL”) text=file, text is the default format of file. URL is a web address. header = TRUE is the default df<-read.delim(“file.txt”) sep = “\t“ tab is the default separator. Another method to import data from a delimited text file. I tis a special case of read.delim df<-read.delim(“URL”) row.names = “variable_name” to select a specific index for each row. read.table() URL is a web address. header = TRUE is the default df<-read.csv(“file.csv”) sep = “,“ comma is the default separator. read.csv It can read both csv (comma-separated values) in both txt and csv files. df<-read.csv(“URL”) row.names = “variable_name” to select a specific index for each row. URL is a web address.
source() source(“file.r”) It processes commands from a script file
readLines() df<-readLines(“file.txt”) n=p, pass p as the number of lines to read It reads unstructured text, line by line.