purrr에서의 그래프

purrr로 배우는 함수형 프로그래밍 기초

Auriel Fournier

Instructor

ggplot() 복습

  • ggplot()은 데이터 프레임 입력 필요
  • 항상 ggplot()으로 시작
  • +를 사용하여 레이어 추가
  • geom_*()으로 그래프 유형 지정
ggplot(data = dataframe, 
       aes(x = columnA,
       y = columnB))+
  geom_point()

새의 체중과 날개 길이의 산점도

purrr로 배우는 함수형 프로그래밍 기초

그래프와 purrr

birddf <- bird_measurements %>% 
 map_df(~ data_frame(
            wing_length = .x[["wing length"]],
            weight = .x[["weight"]])) %>%
    ggplot(aes(x = weight,
            y = wing_length))+
    geom_point()

새의 체중과 날개 길이의 산점도

purrr로 배우는 함수형 프로그래밍 기초

이제 연습해 봅시다!

purrr로 배우는 함수형 프로그래밍 기초

Preparing Video For Download...