You can create a dataframe with years from 2015 to 2023 using the seq()
function to generate a sequence of years and the data.frame()
function to create a dataframe. Here's the code:
main.r156 chars9 lines
Output:
main.r80 chars11 lines
In this code, we first create a sequence of years using seq()
function, which generates a sequence of numbers from the start value 2015
to the end value 2023
. We then use the data.frame()
function to create a dataframe with the years
vector as a column. Finally, we print the dataframe to see its contents.
gistlibby LogSnag