#generating key to mimic your data variable "Freq1_Hit1"
hit<-rep(1:5,20)
freq<-rep(1:20,each=5)
freq_name=paste("freq",freq,sep="")
hit_name=paste("hit",hit,sep="")
key=paste(freq_name,"_",hit_name,sep="") #this is equal to your "variable"
###########################################################################
y<-unlist(strsplit(key,"_")) #split "variable into two string, convert into vector
ind1<-seq(1,length(y),by=2) #create odd index that would be use to extract "freq"
ind2<-seq(2,length(y),by=2) #creaet even index to extract "hit"
freq2<-y[ind1] #using indexing to create freq2 variable
hit2<-y[ind2] #useing indexing to create hit2 variable
your.newdata<-data.frame(your.data, freq2, hit2) #combine data
###########################################################################
ggplot(your.newdata, aes(x=...,y=...) +
geom_boxplot() + facet.grid(. ~ freq2)
您可以添加數據樣本嗎? – cmaher
請勿發佈數據圖片。請參閱[如何創建可重現的示例](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)。 「真正混亂」是什麼意思?你想要的產出是什麼? – MrFlick