I have the dataframe below:
product<-c("ab","ab","ab","ac","ac","ac")
shop<-c("sad","sad","sad","sadas","fghj","xzzv")
week<-c(31,31,32)
category<-c("a","a","a","b","b","b")
tempr<-c(35,35,14,24,14,5)
value<-c(0,0,-6,8,4,0)
store<-data.frame(product,shop,category,tempr,value)
which looks like this:
product shop category tempr value
ab sad a 35 0
ab sad a 35 0
ab sad a 14 -6
ac sadas b 24 8
ac fghj b 14 4
ac xzzv b 5 0
I have a question that is probably wrong but I want to subset this dataframe by selecting the second column by name, then droping certain columns(1,3,4) by index number and then select the rest of the columns by index numbers without knowing the limit. Something like:
store2<-store2[,input$lux2,-c(1,3),4:]
Lets say that I drop out columns 1 and 3 keep column by giving the "shop" from my selectInput and then I want all the columns left. This would be the result:
shop tempr value
sad 35 0
sad 35 0
sad 14 -6
adas 24 8
fghj 14 4
xzzv 5 0