Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Explain what each line od the following R code does? run in R studio and post results (i) sample(2, 10, replace = TRUE) (what happens

Explain what each line od the following R code does? run in R studio and post results
image text in transcribed
(i) sample(2, 10, replace = TRUE) (what 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.2.3,2,3,4,8,1243.-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, nc=4, byrow = T) ("rowl","row2", "row3"), colnames(x) + (o) x + matrix(c(4.3.4.6.7.6).3.2), rownames(x) + c("coll", "co12") (q) x+rbind(c(1:4).c(5.8)), y -- chind(c(1:4),c(5.8)) HOMEWORK 2 DUE DATE: THURSDAY, FEBRUARY 20 AT 11:59 PM (p) y + 1:9, w - 2:10, 2 3:5, and rbind(y,w.z). matrix(1:36.9.4). Check (r) Let m m[2,3 m[2.] cbind(m[3]) m[-(3:8) 2:4 (s) Let x + cbind(xl = 3, x2 = c(4:1, 2:5)). Check dimnamesx) | 11 letters 1:8) apply(x, 2. mean, trim = 2) col.sums apply(x, 2 sum) row.sums apply(x, 1, sum apply(x, 2. sort)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

Question How are IRAs treated for state tax law purposes?

Answered: 1 week ago