May 2018
Beginner to intermediate
364 pages
7h 43m
English
The R code is shown here:
> path<-"http://archive.ics.uci.edu/ml/machine-learning-databases/"
> dataSet<-"iris/bezdekIris.data"
> a<-paste(path,dataSet,sep='')
> x<-read.csv(a,header=F)
> colnames(x)<-c("sepalLength","sepalWidth","petalLength","petalWidth","Class")
The dim(), head(), and tail() functions can be used to look at the size and the first and last several observations of the dataset, shown here:
> dim(x)
[1] 150 5
> head(x,2)
sepalLength sepalWidth petalLength petalWidth Class
1 5.1 3.5 1.4 0.2 Iris-setosa
2 4.9 3.0 1.4 0.2 Iris-setosa
> tail(x,2)
sepalLength sepalWidth petalLength petalWidth Class
149 6.2 3.4 5.4 2.3 Iris-virginica
150 5.9 3.0 5.1 1.8 Iris-virginica
Alternatively, we can use other R ...
Read now
Unlock full access