100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Introduction to Data Science Data Analysis and Prediction Algorithms with R 1st Edition By Rafael Irizarry (Solution Manual) €14,69   In winkelwagen

Tentamen (uitwerkingen)

Introduction to Data Science Data Analysis and Prediction Algorithms with R 1st Edition By Rafael Irizarry (Solution Manual)

 47 keer bekeken  1 keer verkocht
  • Vak
  • Introduction to Data Science Data Analysis and Pre
  • Instelling
  • Introduction To Data Science Data Analysis And Pre

Introduction to Data Science Data Analysis and Prediction Algorithms with R, 1e Rafael Irizarry (Solution Manual) Introduction to Data Science Data Analysis and Prediction Algorithms with R, 1e Rafael Irizarry (Solution Manual)

Voorbeeld 4 van de 246  pagina's

  • 13 juli 2023
  • 246
  • 2022/2023
  • Tentamen (uitwerkingen)
  • Vragen en antwoorden
  • Introduction to Data Science Data Analysis and Pre
  • Introduction to Data Science Data Analysis and Pre
avatar-seller
Amy L. Gil l and Rafael A. Irizarry
Solution Manual for
Introduction to Data Science Part I
R 1
Chapter 2: R basics
1.1 Section 2.3 Exercises
1. What is the sum of the first 100 positive integers? The formula for the sum of integers 1
through nisn(n+ 1)/2. Define n= 100 and then use R to compute the sum of 1through
100 using the formula. What is the sum?
Answer:
n <-100 # define n
n*(n+1)/2 # note use of multiplication symbol and parentheses
#> [1] 5050
2. Now use the same formula to compute the sum of the integers from 1 through 1,000.
Answer:
n <-1000 # change definition of n
n*(n+1)/2 # same formula as Q1
#> [1] 5e+05
3. Look at the result of typing the following code into R:
n <-1000
x <-seq(1, n)
sum(x)
Based on the result, what do you think the functions seq andsum do? Y ou can use help .
A.sum creates a list of numbers and seq adds them up.
B.seq creates a list of numbers and sum adds them up.
C.seq creates a random list and sum computes the sum of 1 through 1,000.
D.sum always returns the same number.
Answer:
B. Y ou can check the documentation using ?seq and?sum .
4. In math and programming, we say that we evaluate a function when we replace the
argument with a given number. So if we type sqrt(4) , we evaluate the sqrt function. In
R, you can evaluate a function inside another function. The evaluations happen from the
inside out. Use one line of code to compute the log, in base 10, of the square root of 100.
13 14 1 Chapter 2: R basics
Answer:
log10(sqrt(100) ) ##equivalent to: log(sqrt(100), base = 10)
#> [1] 1
5. Which of the following will always return the numeric value stored in x? Y ou can try out
examples and use the help system if you want.
A.log(10^x)
B.log10(x^10)
C.log(exp(x))
D.exp(log(x, base = 2))
Answer:
C. In R,log has a default base of e. Therefore, log andexp are inverse functions.
1.2 Section 2.5 Exercises
1. Load the US murders dataset.
library(dslabs)
data("murders" )
Use the function str to examine the structure of the murders object. W e can see that this
object is a data frame with 51 rows and five columns. Which of the following best describes
the variables represented in this data frame:
A. The 51 states
B. The murder rates for all 50 states and DC
C. The state name, the abbreviation of the state name, the state’s region, and the state’s
population and total number of murders for 2010
D.str shows no relevant information
Answer:
C. Check the output of the code str(murders) .
2. What are the column names used by the data frame for these five variables?
Answer:
names(murders) # find column names
#> [1] "state" "abb" "region" "population" "total"
3. Use the accessor $to extract the state abbreviations and assign them to the object a.
What is the class of this object?
Answer:

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

√  	Verzekerd van kwaliteit door reviews

√ Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, Bancontact of creditcard voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper tutorsection. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €14,69. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 81849 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€14,69  1x  verkocht
  • (0)
  Kopen