Documente Academic
Documente Profesional
Documente Cultură
Problem 1: Use R as a calculator to compute the following values. After you do so, cut and paste
your input and output from R to Word. Add numbering in Word to identify each part of each
problem. (Do this for every problem from now on.)
(a) 27(38-17)
(b) ln(147)
436
(c)
12
Problem 3: Use R to create the following two matrices and do the indicated matrix multiplication.
1 7 12 19
7 12
20
9
2 2
13
8 13
4
3 9 14 21
What is the resulting matrix?
Problem 4
a) Read in the data in R using read.csv function Available on dataset link ( MyfirstData)
(https://sites.google.com/a/umt.edu.pk/dmdw/datasets)
You first need to specify your working directory using the setwd() command.
Determine whether each of the two attributes (columns) is treated as qualitative (categorical) or
quantitative (numeric) using R.
Explain how you can tell using R. Write down commands and their answer as well
b) Use the command plot() in R to make a plot for each column by entering plot(data[,1]) and
plot(data[,2]).
Explain exactly what is being plotted in each of the two cases. Include these two plots in your
assignment their screen shots
c) Use the R functions mean(), max(), var() and quantile(,.25) to compute the mean, maximum,
variance and 1st quartile respectively of the data in the first column and second column.