Please download the answer file and edit it on RStudio. Write your student number in the correct place at the beginning of the answer file. When you finish, send the answers.R
file to the answers’ mailbox. All questions are independent and can be answered in any order.
The database PubMed contains a catalog of all papers published by our university in international journals of biological sciences. The following code will create a data frame with the number of publications for each year. If you knit the document, it will be automatically included. Do not delete it, do not duplicate it.
pubmed <- data.frame(year = c(2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011,
2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1998,
1997, 1996, 1995, 1994, 1993, 1992, 1991, 1990, 1989, 1988, 1987, 1986, 1975,
1974, 1965, 1940), number = c(1001, 1194, 1328, 1154, 942, 681, 618, 534, 506,
510, 468, 524, 495, 493, 477, 400, 265, 168, 141, 127, 93, 74, 68, 61, 34, 43,
23, 14, 13, 10, 8, 2, 3, 2, 1, 1, 2))
# write your answer here
# write your answer here
year
is greater than 1980 and year
is less than 2016.# write your answer here
model
and show it# write your answer here
##
## Call:
## lm(formula = log(number) ~ year, data = pubmed, subset = year >
## 1980 & year < 2016)
##
## Coefficients:
## (Intercept) year
## -386.2718 0.1955
model
. Notice that we do not plot logarithms, but we use a logarithmic scale# write your answer here
# write your answer here
## year
## 21.58631
t
with numbers from 0
to 2*pi
in steps of 0.1
. Then draw this graphic with cos(t)
on the horizontal axis, and sin(t)
in the vertical axis1-cos(t)
t
. Please draw this graphic with t*cos(2*t)
on the horizontal and t*sin(2*t)
in the vertical axisFor this question you must use the data frame defined by the following code.
planets <- data.frame(Name = c("Mercury", "Venus", "Earth", "Mars", "Jupiter",
"Saturn", "Uranus", "Neptune"), Diameter = c(4879, 12104, 12742, 6779, 139822,
116464, 50724, 49244), Distance = c(57909227, 108209475, 149598262, 227943824,
778340821, 1426666422, 2870658186, 4498396441), Period = c(88, 225, 365.24,
687, 4346.356, 10774.58, 30680.16, 60191.552))
# write your answer here
# write your answer here
## (Intercept) log(Distance)
## -22.331471 1.499873
# write your answer here