0

I'm relative new in R language and I'm trying to plot the average of a set of curves, for example in the picture below I have 3 curves and I need to plot the average of the 3 curves. What aproximations can I take to solve this?

Graph

My data is structured this way:

All sensors are in a different data frame

The structure of the data frame

Any help is welcome and also if someone has feedback about my question is welcome too, as I'm new in stackoverflow.

Thanks

Wolkuz
  • 83
  • 9

1 Answers1

0

With your data in dataframe df, with time down rows and Leyenda across columns:

df$mean <- rowMeans(df[,1:3])

But please do provide an example of your data in future.

David Foster
  • 447
  • 4
  • 16
  • Thanks, for this I need to have all the data in one data frame? – Wolkuz Feb 22 '18 at 17:51
  • Yes for this method, look at `?cbind()` or `?merge()` to pull them into one dataframe. I think `merge()` could work best, as you have different lengths of dataframe. – David Foster Feb 22 '18 at 18:51