100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada
logo-home
Introduction to Data Science Data Analysis and Prediction Algorithms with R 1st Edition By Rafael Irizarry (Solution Manual) 15,13 €   Añadir al carrito

Examen

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

 56 vistas  1 veces vendidas
  • Grado
  • Introduction to Data Science Data Analysis and Pre
  • Institución
  • 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)

Vista previa 4 fuera de 246  páginas

  • 13 de julio de 2023
  • 246
  • 2022/2023
  • Examen
  • Preguntas y respuestas
  • 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:

Los beneficios de comprar resúmenes en Stuvia estan en línea:

Garantiza la calidad de los comentarios

Garantiza la calidad de los comentarios

Compradores de Stuvia evaluaron más de 700.000 resúmenes. Así estas seguro que compras los mejores documentos!

Compra fácil y rápido

Compra fácil y rápido

Puedes pagar rápidamente y en una vez con iDeal, tarjeta de crédito o con tu crédito de Stuvia. Sin tener que hacerte miembro.

Enfócate en lo más importante

Enfócate en lo más importante

Tus compañeros escriben los resúmenes. Por eso tienes la seguridad que tienes un resumen actual y confiable. Así llegas a la conclusión rapidamente!

Preguntas frecuentes

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

100% de satisfacción garantizada: ¿Cómo funciona?

Nuestra garantía de satisfacción le asegura que siempre encontrará un documento de estudio a tu medida. Tu rellenas un formulario y nuestro equipo de atención al cliente se encarga del resto.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller tutorsection. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for 15,13 €. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

45,681 summaries were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Empieza a vender
15,13 €  1x  vendido
  • (0)
  Añadir