I have running running a linear regression model because i have not created a data.frame .
this is what i have done, for the white wine quality dataset.
#create a dataframe of WineQ
data.frame(df, stringsAsFactors = TRUE)
#create variables from dataset
alcohol = c(8.8, 9.5, 20.2, 9.9, 9.9, 10.1)
fixed.acidity =c(7.0, 6.3, 8.1, 7.2, 7.2, 8.1)
free.sulfur.dioxide = c(45, 14, 30, 47, 47, 30)
total.sulfur.dioxide = c(170, 132, 97, 186, 186, 97)
residual.sugar = c(20.4, 1.6, 6.9, 8.5, 8.5, 6.9)
pH = c(3.00, 3.30, 3.26, 3.19, 3.19, 3.26)
quality =c(6, 6, 6, 6, 6, 6)
#join variable to create a dataframe
df = data.frame(alcohol,fixed.acidity,free.sulfur.dioxide,total.sulfur.dioxide,residual.sugar,pH,quality)
df
str(df)
normalize so that the range is good bad medium
normalize = function(x) (x - min(x))/(max(x) - min(x))
df_norm = data.frame(apply(df [, 1:6], 2, function(x) (x - min(x))/(max(x) - min(x) )))
df_norm$quality = df$quality
str(df_norm)
please if anyone can help me