Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please finish p to s Please finish p to s Problem 1. Explain what each line of the following R code do? You can run
Please finish p to s
Please finish p to s
Problem 1. Explain what each line of the following R code do? You can run them in Rand check the results a) *+-1.23,2,3,4,8, 12, 43, -4,-1) (b) max) dyx, NA) (0) n , H NH T) (0) x2 +0-100, -13,0.3.1.-3) and min(x,-2) () sample(4:10) (g) sample((2.5.3), sie3 replace:FALSE) (b) sample(e(2.5.3), size=3, replace TRUE) (u) sample(2, 10, replace TRUE) (what happens when you write replace = FALSE) (1) sample(1:2, sine=10, probe(1,3), replace=TRUE) (k) round(3.14159, digits = 2) (1) range(106:400) (m) matrix1.23.2.3.4.8. 12. 13.-4.-1.9. 14), ne, ne (n) matrix(c[1,23,2,3,4,8,12,43.-4.-1.9.14), 3, new, byrow - T) (0) * + matrico(1,3,4,5,7.6),3,2), rownames(x) + rowl","row?row3), coles) - coll" col") (0) -- rbind(c(1:4),(5,8)) y + cbind(c(:4) (5,8)) (a) y - 1:9,*+-210, +- 35, and bindtywa). HOMEWORK DUE DATE FRIDAY, SEPTEMBER MAT PM (1) Let m matrix(1-36.9.4). Check m2.31 ma m2 chied 31) m[.-31 m-3:8):24 6) Le-chi, 241, 2:5)). Check di letten sppbyx, 2. men, tri-2 coppbyx. 2.) Problem 1. Explain what each line of the following R code do? You can run them in Rand check the results (a) x + (1,2,3,2,3,4,8,12, 434,-1) (b) maxx) (c) y -cx, NA (d) maxly, nn.rm = T) x2--100,-43.0.3.1, -3) and min[xx2) sample(4:10) () sample(c(253), size=3, teplace=FALSE) (h) sample(c(2,5,3), size 3, replace TRUE) (1) sample(2, 10, replace = TRUE) (wust happens when you write "replace = FALSE?) 6) sample(1-2, size=10, prob=c(1,3), replace=TRUE) (k) round(3.14159, digits 2) (1) range(100:400) (m) matrix(c(1.23, 2, 3, 4.8. 12. 43.-4.-1.9.14), nr=3, nc-4) (n) matrix(c(1.2.3.2.3.4.8. 12. 43.-4.-1.9.14), nr=3. Dc-4. byrow = T) (0) + matrix(c(4,3,4,6,7.6) 3.2). Townames(x) + "rowl". "Tow?. Tow3"), colnames(x) + c{"coll", -col2") (p) * -- rbind(e[1:4),(5,8)), y +- chinad(c(1-4),(5,8)) (@y+-1:9, +2:10, 2+3:5, and rbindyw.a). 2 HOMEWORK I DUE DATE FRIDAY, SEPTEMBER 24 AT 11:59 PM (r) Let m e-matrix(1:36,9,4). Check m[2,3 m(3) m(2.) cbind(t1,3) m.-31 ml-(3:8).2.4. () Let x + cbind x1 = 3, x2 = 4:1, 2:5). Check cimnames(x)001 - letters [1:8] apply(x, 2, mean, trim = -2) col.sums apply(x, 2. wum) tow.sums - applyix, 1. sum) apply(x, 2, sort) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started