# 쉽게 배우는 R 데이터 분석 - 10. [[텍스트 마이닝]] - 11. [[지도 시각화]] - 12. [[인터렉티브 그래프]] - 13. [[통계 분석 기법을 이용한 가설 검정]] - 15. [[R 내장 함수, 변수 타입과 데이터 구조]] - 16. [[데이터 분석 기술을 효율적으로 익히는 방법]] ### 데이터 불러오기 파일불러오기 실패시, setwd 로 경로 설정 ```shell # 데이터 불러오기 setwd('C:/Users/Playdata/weekend_R/쉽게 배우는 R 데이터 분석') txt <- readLines('./data/hiphop.txt') ``` ### 글자 수 ```shell > # 두 글자 이상 단어 추출 > df_word <- filter(df_word, nchar(word) >= 2) Error in filter_impl(.data, quo) : Evaluation error: 'nchar()' requires a character vector. ``` 에러 발생시 아래와 같이 수정 ```shell df_word <- filter(df_word, nchar(as.character(df_word$word)) >= 2) ``` ### map_data ```shell states_map <- map_data('state') str(states_map) Error: Package `maps` required for `map_data`. Please install and try again. Traceback: 1. map_data("state") 2. try_require("maps", "map_data") 3. stop("Package `", package, "` required for `", fun, "`.\n", "Please install and try again.", . call. = FALSE) ``` ```shell install.packages('maps') if (require('maps')){ states_map <- map_data('state') str(states_map) } ```