Table of Contents

R

 

Source Code/ Tip

RStudio와 함께하는 프로젝트 관리

Tools> Global Options...> Packages> __Use secure download method for HTTP (check 박스 해제)

출처: [[http://rfriend.tistory.com/177|http://rfriend.tistory.com/177]] [R, Python 분석과 프로그래밍 (by R Friend)]

eval( parse( text="    " ) )

법인리스트$사업명re<-newvals[match(법인리스트$사업명,oldvals)]

 trim <- function (x) gsub("^s+|\\s+$", "", x)

  err_msg<-tryCatch({

     # Contents

  }, error=function(e){
     err_msg<-paste0( LOOP_IDX ," ERROR :",conditionMessage(e))
     cat( LOOP_IDX ," ERROR :",conditionMessage(e))
     return(err_msg)
  }) # 예외처리 끝
  print(err_msg)

 paths<-paste0(enc2native(   dirname(rstudioapi::getActiveDocumentContext()$path))   , "/teleseller/")

Library

data.frame

fread("C:/Users/heeseoklee.HEESEOKLEE-/Desktop/자료들2017년/04_05 기업DB/KED/LGU.txt", sep="|", header=FALSE, colClasses=list(character=1:54))

RODBC

install.packages("RODBC")
library(RODBC)

#con<-odbcConnect("DB")
con <- odbcConnectAccess2007("c:/ .mdb",pw=" ")

table_name <- sqlTables(con, tableType = "TABLE")$TABLE_NAME

TBL <- sqlFetch(con2, table_name[1])
str(TBL)
head(TBL)

qry <- "SELECT * FROM XXX"
class <- sqlQuery(con2, qry)
str(class)

odbcCloseAll()

reshape2

http://seananderson.ca/2013/10/19/reshape/

 melt( data, id.vals=c("KEYVALUE1","KEYVALUE2") )

키값 빼고 나머지는 다 row로

 dcast( data, KEYVALUE1 + KEYVALUE2 ~ LONG_COLUMN )

igraph

tidyverse

tidyverse style guide

http://style.tidyverse.org/

Dplyr

KED_not_PF %>%
   rowwise() %>%
   mutate(평균매출액=mean(c(as.double(매출액3),as.double(매출액2),as.double(매출액1)), na.rm=TRUE) %>%
   ungroup()

 DATA %>% mutate(!!paste0("주요품목",1:10)[i] := gsub("응용SW_","",!!rlang::sym(paste0("주요품목",1:10)[i])))

ggplot2

Web Apps

HTML CSS Javascript

htmlWidgets

https://www.htmlwidgets.org/showcase_leaflet.html

visNetwork

https://datastorm-open.github.io/visNetwork/

https://cran.r-project.org/web/packages/visNetwork/vignettes/Introduction-to-visNetwork.html

visIgraphLayout(layout = "layout.kamada.kawai")
visPhysics(stabilization = FALSE)
visEdges(smooth = FALSE)

DT

https://rstudio.github.io/DT/

Interactive visNetwork plot with DT not using Shiny or Crosstalk

plotly

https://plotly-book.cpsievert.me/

crosstalk

https://rstudio.github.io/crosstalk/

Linking Views without Shiny DT, Plotly, …

RMarkdown

flexdashboard

https://rmarkdown.rstudio.com/flexdashboard/using.html