1

This might be an easy question to answer which has been frustrating me a lot recently. My ultimate goal is to overlay observational length data onto my length graph from the model. I have a model that functions by time - written as follows:

times <-seq(1, nrow(Mussel_Water_Data),1)

I could use 730 instead of nrow(Mussel_Water_Data) because that's how many observations I have in the data set to run the model (daily water temp, etc.). However, my length data has only 455 observations. Hence, the discrepancy.

I pulled my length data from the data set: Mussel_Daily_LengthAS=data.frame(Mussel_Daily_Length$AS_length)

finished the model: sol <- ode(state, times, Deb, param)

And then I tried to plot it: plot(sol, which = "L", obs= Mussel_Daily_Length$AS_length) and I get the following error message: Error in obs[, 1] : incorrect number of dimensions

My question is: how would I be able to plot the two even tho I have different numbers of observations?

Thanks!

d.b
  • 32,245
  • 6
  • 36
  • 77
J. Lewis
  • 11
  • 2
  • 3
    I don't quite follow your question, but you can always add stuff after plotting e.g. by using `points` ([tutorial](http://www.dummies.com/programming/r/how-to-add-points-to-a-plot-in-r/)). That is, `plot()` first and then add whatever using `points` or `lines`. – patrick Jul 13 '17 at 15:28
  • 2
    Hello and welcome to SO. Please pop over to this post on how to make a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – emilliman5 Jul 13 '17 at 15:32
  • What I would like to do is overlay the data and negate the fact that there is missing data. Thank you for your response! – J. Lewis Jul 13 '17 at 15:32
  • Hi and welcome to Stack Overflow, please take a time to go through the [welcome tour](https://stackoverflow.com/tour) to know your way around here (and also to earn your first badge), read how to create a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and also check [How to Ask Good Questions](https://stackoverflow.com/help/how-to-ask) so you increase your chances to get feedback and useful answers. – DarkCygnus Jul 13 '17 at 17:12

0 Answers0