Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am not sure exactly what you mean by </p> <blockquote> <p>select years between 1950-2001 against months of Nov-february</p> </blockquote> <p>But the following should get you started on a reproducible example...</p> <pre><code>#create a vector of months from 1900 through 2010 months &lt;- seq(as.Date("1900/1/1"), as.Date("2010/12/31"), "months") #assign a random vector of equal length output &lt;- rnorm(length(months)) #assign both values to a data_frame data &lt;- data.frame(months = months, output = output) </code></pre> <p>Based on your description, your data should look something like the dataframe, called <code>data</code>. </p> <p>From here, you can make use of the <code>subset</code> function to help you on your way. The first example subsets to data from 1950 through 2001. The next further restricts that subset to the months of November through February. </p> <pre><code>#subset to just 1950 through 2001 data_sub &lt;- subset(data, months &gt;= as.Date("1950-01-01") &amp; months &lt;= as.Date("2001-12-31")) #subset the 1950 to 2001 data to just Nov-feb months (i.e. c(11,12,1,2)) data_sub_nf &lt;- subset(data_sub, as.numeric(format(data_sub$months, "%m")) %in% c(11,12,1,2)) </code></pre> <p>You should also read <a href="https://stackoverflow.com/questions/9860090/in-r-why-is-better-than-subset">Why is `[` better than `subset`?</a> to move beyond <code>subset</code>. </p> <p>As stated, after the data has been subset, you can use <code>plot</code> or any other plotting function to graph your data. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload