# Choose a file interactively
file.choose()
# Read CSV file
<- read.csv(pathfile)
d
# Read text file.
# Set header = TRUE if the first row of the data
# corresponds to the names of the variables
<- read.table(pathfile, header = TRUE)
d
# Vector with values 3, 6, 7
c(3, 6, 7)
# Value of data d in row 3 and column 7
3, 7]
d[
# Row 3 of data d
3, ]
d[
# Column 7 of data d
7]
d[,
# Rows 3 and 5 of data d
c(3, 5), ]
d[
# Columns 7 and 9 of data d
c(7, 9)]
d[ ,
# Data d without rows 3 and 5
-c(3, 5), ]
d[
# Data d without columns 7 and 9
-c(7, 9)] d[ ,
33 Datasets
Datasets
R Syntax