I have a data frame called data and the column names are:
c("Server", "Date", "Host_CPU", "Used_Mem_Perc", "JVM1", "JVM2",
"JVM3", "JVM4", "JVM5", "JVM6")
I need to be able to create a lm model between Host_CPU and column names that start with JVM. In this cased it would be something like this:
lm(data=data, Host_CPU~JVM1+JVM2+JVM3+JVM4+JVM5+JVM6)
but sometimes, I don't know how many column that start with JVM would be. I need to be able to read in the column names and built the lm model. Any ideas how I could do this in R?