Machine Learning With R: Step by Step Guide For Newbies by Dominic Lordy

Machine Learning With R: Step by Step Guide For Newbies by Dominic Lordy

Author:Dominic Lordy [Lordy, Dominic]
Language: eng
Format: epub
Publisher: AI Sciences
Published: 2018-05-25T18:30:00+00:00


layout(matrix(1:3, 3, 1)) # partition the graphics

species <- c("swallow", "wren", "dunnock")

file <- c("Swal.dat" , "Wren.dat", "Dunn.dat")

for(i in 1:length(species)) {

data <- read.table(file[i]) # read the data

plot(data$V1, data$V2, type="l")

title(species[i]) # add a title

}

Now our program is more efficient, we can add more species since the vector containing the species list and file name is at the beginning of the code.

The above program will execute perfectly if data files .dat are located in R directory, if code does not work user might change the directory or specify the path of the data files. If the program is written to the file Mybirds.R, it will be called by typing: > source("Mybirds.R")



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.