Programming/Google Data Analytics Certificate

[GA] 구글 애널리틱스 프로그램 - R 기초

그렉그의 2023. 4. 4. 13:57

To check the bias of the data, we need dataframes.

> colnames(diamonds)  [1] "carat"   "cut"     "color"   "clarity" "depth"   "table"   "price"   "x"       "y"       [10] "z"       > library(tidyr) > library(tidyverse)

> mutate(diamonds, carat_2 = carat* 100)

 

head(diamonds) str(diamonds) glimpse(diamonds) colnames(diamonds) rename(diamonds, carat_New = carat) ggplot(data = diamonds, aes(x = carat, y = price, color = cut)) +   geom_point() +   facet_wrap(~cut) id <- c(1:10)

 

name <- c("John Mendes", "Rob Stewart", "Rachel Abrahamson", "Christy Hickman", "Johnson Harper", "Candace Miller", "Carlson Landy", "Pansy Jordan", "Darius Berry", "Claudia Garcia")

 

job_title <- c("Professional", "Programmer", "Management", "Clerical", "Developer", "Programmer", "Management", "Clerical", "Developer", "Programmer") employee <- data.frame(id, name, job_title) print(employee)

 

separate(employee, name, into = c('first_name','last_name'), sep=" ") library('dplyr')

 

penguins %>%    mutate(body_mass_kg= body)

 

Standard deviation

quartet %>%    group_by(set) %>%    summarize(mean(x),sd(x),mean(y),sd(y),cor(x,y))

 

 

SQL 

CTE: Common Table Expression(manipulate subqueries) 

Create table #temp_Employee(
EmployeeID int,
JobTitle varchar(100),
Salary int
)

SELECT *
FROM #temp_employee
insert into #temp_employees Values(
'1001', 'HR','45000'
)
INSERT INTO #temp_employee
SELECT *
FROM SQLTutorial

SELECT JobTitle, Count(JobTitle), Avg(Age), Avg(salary)
FROM SQL Tutorial,