Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to plot, where each row in a matrix is a line inte plot in R

Tags:

plot

r

matrix

row

line

I have a data frame that I would like to plot. I want each row to be plotted as a line, but when I do it says that my margins are too large. I have tried to do a for loop, but I'm new to R so it doesn't work. Can somebody please help me?

My frame is much larger, it's 67x135, but it looks something like this:

V1 V2 V3 V4 V5   
85 16 13 82 72  
30 71 14 51 43  
13 63 42 37 99
like image 786
Mandy Avatar asked Mar 23 '15 14:03

Mandy


1 Answers

DF <- read.table(text="V1 V2 V3 V4 V5
85 16 13 82 72
30 71 14 51 43
13 63 42 37 99", header = TRUE)

matplot(t(DF), type = "l")
like image 178
Roland Avatar answered Oct 19 '22 03:10

Roland