i have a task that i need to complete in R studio using R language. i'm new to this. i have a "CSV" file with a table that consists of 80 columns and 568 rows after i sampled 80% of the original data file. now i need to add a column to the table and calculate the (max - min) of each row and that column will show the results of each row in this new data file.
data <- read.csv(file.choose(), header=T)
data
data$maxSubMin <- for(i in 1:568){
max(data[i,1:78]) - min(data[i,1:78])
}
there are no errors shown in the log, but there is no new column... somebody knows whats the reason?