I usually use the data.table package and the 'melt' function to get a key-value format.
This format is much better for ggplot2:
# Your test data: (notice that i transformed the rownames into a column)
test <- data.frame("0.99" = c(12, 15, 18), "0.98" = c(14, 15, 18), "0.90" = c(7, 22, 30))
test$rownames <- c("01370", "01332", "01442")
# melt and plot:
dt <- data.table::as.data.table(test)
melted <- data.table::melt(dt, measure = c("X0.99","X0.98","X0.90"))
ggplot2::ggplot(data = melted, mapping = aes(x = variable, y = value, group = rownames)) +
ggplot2::geom_line() +
ggplot2::facet_grid(rows = vars(rownames))
EDIT: based on your edited question:
test <- data.frame("Site_No" = c("01370", "01332", "01442"),"0.99" = c(12, 15, 18), "0.98" = c(14, 15, 18), "0.90" = c(7, 22, 30))
dt <- as.data.table(test)
melted <- data.table::melt(dt, measure = c("X0.99","X0.98","X0.90"))
ggplot2::ggplot(data = melted, mapping = aes(x = variable, y = value, group = Site_No)) +
ggplot2::geom_line() +
ggplot2::facet_grid(rows = vars(Site_No))
EDIT2: Based on your second comment: Create new plots for each group:
test <- data.frame("Site_No" = c("01370", "01332", "01442"),"0.99" = c(12, 15, 18), "0.98" = c(14, 15, 18), "0.90" = c(7, 22, 30))
dt <- as.data.table(test)
melted <- data.table::melt(dt, measure = c("X0.99","X0.98","X0.90"))
for (i in unique(melted$Site_No)){
dev.new()
print(ggplot2::ggplot(data = melted[Site_No == i,], mapping = aes(x = variable, y = value, group = Site_No)) +
ggplot2::geom_line())
}