2.Programming with R & Python - Segment 2 [Week 3 & 4 -Data Visualisation and Transformation] Flashcards
What is tidyverse ?
tidyverse Is a Metal Library in R Language. It is a collection of multiple packages intended for data science applications.
How many packages are in tidyverse library ?
ggplot2
tibble
forcats
purrr
dplyr
tidyr
stringr
readr
lubridate
How to create a new notebook in RStudio ?
Goto File-NewFile-R-Notebook
How to create a new notebook in RStudio ?
Goto File-NewFile-R-Notebook
How to create a new chunk in Rstudio ?
ctrl +r
How to run a chunk in Rstudio ?
shift + enter or ctr + shift + enter
What is the inbuilt demo data set in Rstudio ?
cars is an inbuilt data set ?
How to get the structure of data set ?
We have to use str() function
How to modify keyboard shortcut in RStudio ?
Goto Tool/modify keyboard shortcuts/
Now search for command for which you have to set shortcut like ‘ insert chunk’
How to invoke library in Rstudio
We have to use require(library) method
Which package is used for data Wrangling
dplyr Library
How to load package in RStudio ?
To load package in RStudio we have to use library() function
How to load specific package ?
To load specific package we have to use library(ggplot2) method .
How do invoke inbuilt data sets in RStudio ?
data() method is used .
In which package inbuilt data sets are available ?
datasets package
How to know the description and details of inbuild data set ?
Quistion mark sighn followed by dataset name.
?cars
How to load inbuild data sets ?
Inbuild data sets are already loaded you have to just use them
What is the full form of csv ?
coma separated values
How to list environment variables in work space ?
ls()
How to clear workspace environment & console
by running code ?
rm(list = ls()) clear variables
cat(‘\014’) clear console
How to remove single variable from environment ?
rm(variableName)
How to remove environment variables using GUI ?
You have to click on brush at right hand side on top of Enviroment Pane.
How to add comments in R markdown file ?
To write comments we have to use # symbol followed by text
# This is some text
How to add new colum to an existing data frame on condition ?
We have to use mutate function
carData = mtcars %>% mutate(cylType = ifelse(cyl > 5 ,’High’ , ‘Low’))
What is called the process of adding new column to an data frame ?
This process is called mutation or muting a data frame .
How to save dataset in a variable ?
carData= mtcars
mtcars is an inbuilt Data Set in R
What is pipe operator ?
%>%
Pipe operator is used to pipe data frame to a function or any object.
How to add a new column to an existing data set ?
We have two ways to do it ,
Mutate & Direct Method
carData %>% mutate(carColor = ‘NotDefined’)
carData$LaunchYear = “NotDefined”