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
- assign the results of a function to an object
- display the object
- determine the class of the vector
- change the class of the vector to character
- show the new class
- show the titanic dataframe
- show the class of titanic
- convert the titanic dataframe to a tibble
- show the structure of various objects
- 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)
- show the contents of the mpg dataframe
- create a scatterplot of the mpg dataset
- create an object called ‘url’ with the organ donation file in it
- 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)
- make a scatterplot of the gdpPercap and lifeexp
- 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."