IDSC 4110
You return to your government job of the previous lab. As is often the case, however, the publisher of the data has switched formats!
View the step-by-step solution to:

Question

You return to your government job of the previous lab. As is often the case, however, the publisher of

the

data has switched formats! Your manager comes to you with a set of requests related to those of exercise 1

from the previous lab, however this time you will need to conduct your analysis on the usstates.json le

(instead of the .csv le). Predictably, the JSON le does not load as nicely into a data.frame as the .csv le

did.

Complete the following tasks:

b. Given the variable state containing a 2-letter abbreviation, store the full name of the state in

a variable named full_name.

c. (Given the variable state (same as part b), store the population density of that state in a variable

named pop_density.


Here is my code that isn't working:

#2.b

state <- "TX"

full_name <- as.character(m$state[["name"]])


#2.c

population <- as.numeric(m$state[["pop"]])

area <- as.numeric(m$state[["area"]])

pop_density <- population / area

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes