This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> temp_kbo <- read.csv("2017_7_8_KBO_win.csv", header = TRUE) | |
Error in make.names(col.names, unique = TRUE) : | |
'<bc><f8><c0><a7>'에서 유효하지 않은 멀티바이트 문자열이 있습니다 | |
> library(readr) | |
> read.any <- function(text, sep = "", ...) { | |
+ encoding <- as.character(guess_encoding(text)[1,1]) | |
+ setting <- as.character(tools::file_ext(text)) | |
+ if(sep != "" | !(setting %in% c("csv", "txt")) ) setting <- "custom" | |
+ separate <- list(csv = ",", txt = "\n", custom = sep) | |
+ result <- read.table(text, sep = separate[[setting]], fileEncoding = encoding, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readr) | |
read.any <- function(text, sep = "", ...) { | |
encoding <- as.character(guess_encoding(text)[1,1]) | |
setting <- as.character(tools::file_ext(text)) | |
if(sep != "" | !(setting %in% c("csv", "txt")) ) setting <- "custom" | |
separate <- list(csv = ",", txt = "\n", custom = sep) | |
result <- read.table(text, sep = separate[[setting]], fileEncoding = encoding, ...) | |
return(result) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
순위 | 선수명 | 팀명 | AVG | G | PA | AB | R | H | 2B | 3B | HR | TB | RBI | SAC | SF | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 김선빈 | KIA | 0.38 | 79 | 303 | 271 | 49 | 103 | 23 | 0 | 2 | 132 | 47 | 2 | 4 | |
2 | 최형우 | KIA | 0.37 | 80 | 359 | 289 | 66 | 107 | 23 | 3 | 20 | 196 | 76 | 0 | 4 | |
3 | 나성범 | NC | 0.359 | 61 | 264 | 237 | 53 | 85 | 20 | 1 | 13 | 146 | 51 | 0 | 1 | |
4 | 김태균 | 한화 | 0.353 | 61 | 268 | 232 | 34 | 82 | 13 | 0 | 10 | 125 | 57 | 0 | 4 | |
5 | 서건창 | 넥센 | 0.353 | 78 | 347 | 303 | 52 | 107 | 17 | 2 | 4 | 140 | 49 | 0 | 3 | |
6 | 이대호 | 롯데 | 0.351 | 79 | 333 | 302 | 44 | 106 | 7 | 0 | 16 | 161 | 60 | 0 | 0 | |
7 | 이명기 | KIA | 0.351 | 70 | 318 | 285 | 46 | 100 | 13 | 4 | 4 | 133 | 46 | 10 | 2 | |
8 | 김재환 | 두산 | 0.35 | 78 | 353 | 309 | 56 | 108 | 20 | 2 | 21 | 195 | 57 | 0 | 1 | |
9 | 손아섭 | 롯데 | 0.334 | 81 | 376 | 326 | 62 | 109 | 20 | 3 | 8 | 159 | 40 | 1 | 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fitted(Pregnancy.lm) | |
ifelse (fitted(Pregnancy.lm) > 0.5, 1, 0) == PregnancyData$PREGNANT | |
맞나요 <- ifelse (fitted(Pregnancy.lm) > 0.5, 1, 0) == PregnancyData$PREGNANT | |
sum(맞나요)sum(맞나요)/NROW(맞나요) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<link rel="stylesheet" type="text/css" href="styleguide.css"/> | |
<title>Google's R Style Guide</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> require(rugarch) | |
필요한 패키지를 로딩중입니다: rugarch | |
Error : .onLoad가 loadNamespace()에서 'rgl'때문에 실패했습니다: | |
호출: dyn.load(file, DLLpath = DLLpath, ...) | |
에러: 공유된 객체 '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so'를 로드 할 수 없습니다: | |
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib | |
Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so | |
Reason: image not found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title: "R Notebook" | |
output: | |
pdf_document: | |
latex_engine: xelatex | |
html_notebook: default | |
html_document: default | |
mainfont: NanumGothic | |
--- | |
이것은 [R Markdown](http://rmarkdown.rstudio.com) 노트북입니다. | |
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpg <- seq(10,40) | |
kmL <- (mpg * 1.609344)/3.785411784 ## 단순하게 바꾸기 | |
install.packages("datamart") ## 패키지 설치 | |
library(datamart) ## 패키지 설치 | |
uconv(1, "US gal", "l", uset="Volume") ## 1 캘런을 리터로 | |
uconv(1, "mile", "km", uset="Length") ## 1 마일을 킬로미터로 | |
kmL.uconv <- uconv(mpg, "mile", "km", uset="Length")/uconv(1, "US gal", "l", uset="Volume") ## uconv()을 이용하여 바꾸기 | |
kmL == kmL.uconv ## 두 계산 결과 확인 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> A <- c("apple", "fineApple") | |
> A | |
[1] "apple" "fineApple" | |
> B <- c(100 ,200) | |
> testing <- data.frame(A,B) | |
> testing | |
A B | |
1 apple 100 | |
2 fineApple 200 | |
> library(plyr) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.