Chapter 11 Build your own dataframe

Build a dataframe from the data below and practice making plots

Number of lynx

lynx.ca <- c(13445, 8625, 6853, 6953, 6574,
  8265, 9977, 7579, 11542, 7180,
  4713, 4907, 2819, 5171, 6873, 
  6148, 8573, 9361, 11226)

Year of study

year <- c(1984, 1985, 1986, 1987,
          1988, 1989, 1990, 1991, 1992, 
          1993, 1994, 1995, 1996, 1997,
          1998, 1999, 2000, 2001, 2002)

Make the dataframe.

lynx.new <- data.frame(lynx.ca,
                    year)

Build a basic plot

plot(lynx.ca ~ year, data = lynx.new)

As in the lynx dataset that comes with R, we see wild swings in abundance over short periods of time.

11.1 Your turn

Make this plot nice. Change the x axis label, y axis label, give it a main title, etc.

11.2 References

Poole, Kim G. 2003. A review of the Canada Lynx, Lynx canadensis ,in Canada. Canadian [Field-Naturalist 117: 360-376.[(https://www.canadianfieldnaturalist.ca/index.php/cfn/article/view/738)] DOI: https://doi.org/10.22621/cfn.v117i3.738