Plotting half a dataset

I have dataset with recording period between 1966 to 2019. I want to plot a graph for between 1966 and 1990. What command would I use?

You have to make a subset of the data that contains the years you want to plot. There are many ways to do this. Let's say your data are in a data.frame named DF and you have a column named Year. You can select for the years up to 1990 with

EarlyYears <- DF[DF$Year <= 1990, ]

Or you can use the filter() function from the dplyr package.

EarlyYears <- filter(DF, Year <= 1990)

You can then make your plot using the EarlyYears data frame.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.