I have written several functions and want to only apply them to the last two columns of an input CSV file. The question is how to convert the last two columns to vectors and apply my functions to them?
myAvg <- function(anyVector){ average <- sum(anyVector) / length(anyVector) return(average) } mySD <- function(anyVector){ std_Dev <- sqrt(sum((anyVector - mean(anyVector)) ^ 2 / (length(anyVector) - 1))) return(std_Dev) } myRange <- function(anyVector){ myRange <- max(anyVector) - min(anyVector) return(myRange) } data <- read.csv("CardioGoodnessFit.csv") print(data) 
myRange<-max(anyVector)-min(anyVector)