Site icon Tutor Bin

Silicon Valley University Visual Analytics R Studio Task

Silicon Valley University Visual Analytics R Studio Task

Description

Create a new project

Follow the instructions in the book to create a new project. Give it a name and an author. Execute the 3 code snippets from the preface to bring all the packages into this new project then create a new R Markdown document as instructed by the book. Load the tidyverse and socviz libaries. 

In order to execute code in an R Markdown object, the code must be enclosed by: “`{r}…..“`

Use R studio to complete the following:

create a vector of the names of the members of your immediate family

display it

create a vector of numbers

find the mean of the numbers in the vector you created

  1. assign the results of a function to an object
  2. display the object
  3. determine the class of the vector
  4. change the class of the vector to character
  5. show the new class
  6. show the titanic dataframe
  7. show the class of titanic
  8. convert the titanic dataframe to a tibble
  9. show the structure of various objects
  10. show the structure of the mpg dataframe (mpg is an example dataset showing mileage for cars of various models and with different numbers of cylinders)
  11. show the contents of the mpg dataframe
  12. create a scatterplot of the mpg dataset
  13. create an object called ‘url’ with the organ donation file in it
  14. create an object with the organ donation data, find the structure of that object, load the gapminder dataset (watch this video to learn more about gapminder)
  15. make a scatterplot of the gdpPercap and lifeexp
  16. Hi, they didn’t provided any book related to this.. but I found a sample that other guys posted, could you take this as reference —title: “Week 2″author: “Rajeev Pudi”date: ‘2022-03-29’output:  html_document: default  word_document: default  pdf_document: defaulteditor_options:   chunk_output_type: console—“`{r install, eval = FALSE}library(gapminder)library(here)library(socviz)library(tidyverse)knitr::opts_chunk$set(echo = FALSE) knitr::opts_chunk$set(fig.width=8, fig.height=5)  “`## create a vector of the names of the members of your immediate family“`{r immediate family}my_family <- c(“Brittany”, “John”, “Allie”, “Luna”)“`## Display it“`{r my_family display}my_family“`## create a vector of numbers“`{r vector}my_vector <- c(32, 35, 12, 1)“`## find the mean of the numbers in the vector you created“`{r vector mean}mean(my_vector)“`## assign the results of a function to an object“`{r mean object}my_vector_mean <- mean(my_vector)“`## display the object“`{r deplay my_vector_mean}my_vector_mean“`## determine the class of the vector“`{r class my_vector_mean}class(my_vector)“`## change the class of the vector to character“`{r change vector class}my_new_vector <- c(32, 35, 12, 1, “Ages”)class(my_new_vector)“`## show the structure of the mpg dataframe“`{r mpg}str(mpg)“`## show the contents of the mpg dataframe“`{r mpg contents}mpg“`## create a scatterplot of the mpg dataset“`{r mpg scatterplot}ggplot(data = mpg, aes (x = displ, y = hwy)) + geom_point()“`## create an object called ‘url’ with the organ donation file in it.##I switched from my PC to my Mac at this point because I was having trouble getting my rmarkdown to knit.“`{r}url <- “https://cdn.rawgit.com/kjhealy/viz-organdata/master/organdonation.csv”“`## create an object with the organ donation data, find the structure of that object, load the gapminder dataset“`{r}organs <- read_csv(file = url)str(organs)library(gapminder)“`## make a scatterplot of the gdpPercap and lifeexp“`{r}p <- ggplot(data = gapminder, mapping = aes(gdpPercap, y = lifeExp))p + geom_point()“`

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version