NotePad++ã¨NppToRã¨Rç¨èªåè£å®API
Rç¨ã¨ãã£ã¿ã¨ãã¦ã¯ESS on Emacsãæå¼·ãªã®ã¯ééããªãã§ããï¼åå¿è ã«ã¯ã¨ã£ã¤ãã¥ããã§ãã社ä¼å¦çéã§ã¯å¤§åã®äººãï¼ã¨ãã£ã¿ã£ã¦ä½ï¼ããããã®ï¼ã£ã¦ã¬ãã«ãªã®ã§ï¼ã¨ã¦ããããªãã§ããããããã§ãã¾ããã
ãã¨ãã£ã¦Windowsã®Rã¯GUIãããã¼ããããã¨ãããå®ç¨ã¬ãã«ãããªããããã³ããã§shift+ç¢å°ã§é¸æã§ããªãã¨ãã©ããããã¨ï¼ä¸åã«æ¹åãããªãã®ã¯éçºè ãã¿ããªESS使ã£ã¦ããããªãã§ããããã
ããã§å¤é¨ã¨ãã£ã¿ã¨é£æºããããã¨ããã®ã次åã®çã«ãªãããã§ããï¼ãããããããã®ãNotePad++ã¨NppToRã®çµã¿åããã§ããNotePad++ã¯ããã°ã©ãç¨ã¨ãã£ã¿ã§ï¼ãããã人æ°ãããã§ããè²ä»ãããèªåè£å®ãããããã便å©ãªæ©è½ãä»ãã¦ãã¾ããããã¦NppToRã¯ï¼NotePad++ã¨Rãé£æºããã¦ããããããããã½ããã¦ã§ã¢ã§ããRã®ããã©ã«ãã®ã¨ãã£ã¿ã®ä»£ããã«NotePad++ã使ãã¦ãã¾ãããã§ãã
èå³ãæãããæ¹ã¯ï¼ä¸¡æ¹ã¤ã³ã¹ãã¼ã«ãã¦Rã¨ãã£ããã«ç«ã¡ä¸ãã¦ï¼é©å½ã«ã³ã¼ãæ¸ãã¦èµ°ããã¦ã¿ã¦ãã ãããããã©ã«ãã§ã¯F8ã§Rã«ã³ã¼ããéãããããã«ãªã£ã¦ã¾ãããã¨ï¼Ræ¬ä½ã®è¨å®ãSDIã«å¤ãã¦ãããã¨ããããããã¾ãã
ãã¦ï¼ããã ãã§ãååããããããã§ããï¼æ®å¿µãªãã¨ã«èªåè£å®ãå¹ãã¾ãããæã¯ã§ããã®ã§ããï¼NotePad++ã®ä»æ§å¤æ´ããã£ã¦NppToRã¯è¿½å¾ã§ãã¦ããªãããã§ãããã®ãã¡ã§ããããã«ãªããããããªãã§ããã©ï¼ãã¤ã«ãªããã¯ãããã¾ããããããªã®å¾ ã£ã¦ãããªããã¨ãããã¨ã§ä½ãã¾ããã
NotePad++ã®èªåè£å®ã¯ããªãç°¡åã«æ¡å¼µã§ãã¾ããããããã®è¨èªç¨ã®XMLãã¡ã¤ã«ãä½ã£ã¦ãã©ã«ãã«æ¾ãè¾¼ãã ãã§ããåã¯XMLã§ãããªãè£å®ãã¦æ¬²ããåèªãç¾ åãããã¿ããã¹ãã ã£ãã®ã§ããï¼XMLã«ä»æ§ãå¤ãã£ã¦ï¼é¢æ°ã¨ã»ããã§å±æ§ã®ãããã¢ãããã§ããããã«ãªãã¾ããããã£ãããªã®ã§ããã¾ã§å¯¾å¿ããããã§ããã
ã§ï¼è¨å¤§ãªæ°ã®é¢æ°ãææã¡ãªãã¦ãã¦ãããªãã®ã§ï¼èªåã§åºåãããããã«æ¸ããã¹ã¯ãªãããâã§ããpure Rã§ãã
.packages(TRUE) plist <- c("foreign", "Hmisc", "lattice", "lme4", "memisc", "sem") for(package in plist) library(package, character.only=TRUE) flist <- sort(unlist(sapply(paste("^", letters, sep=""), apropos, mode="function"))) sink(file="./R.xml") cat("<?xml version='1.0' encoding='Windows-1252' ?>", "<NotepadPlus>", "\t<AutoComplete language='R'>", "\t\t<Environment ignoreCase='yes' startFunc='(' stopFunc=')' paramSeparator=',' terminal='' />", sep="\n") for(i in seq_along(flist)){ arg <- formals(flist[i]) name <- names(arg) if(is.null(arg)){ cat("\t\t<KeyWord name='", flist[i], "' />\n", sep="") }else{ cat("\t\t<KeyWord name='", flist[i], "' func='yes'>\n", "\t\t\t<Overload retVal=''>\n", paste("\t\t\t\t<Param name='", name, "' />\n", sep=""), "\t\t\t</Overload>\n", "\t\t</KeyWord>\n", "",sep="") } } cat("\t</AutoComplete>", "</NotepadPlus>", sep="\n") sink()
æåã®3è¡ã¯ã¤ã³ã¹ãã¼ã«ããã¦ãããã±ã¼ã¸ã®ä¸è¦§è¦ã¦è£å®ã«å ãããããã±ã¼ã¸ãé¸ãã§èªã¿è¾¼ãã§ãã ãã§ãããã¨ã¯ã¢ã«ãã¡ãããé ã«å°éã«é¢æ°ãããéãã¦XMLã«æ´å½¢ãã¦æ¸ãåºãã¦ãã ãã§ããèµ°ãããã¨ï¼ä½æ¥ãã©ã«ãã«R.xmlãã§ãã¦ãã¨æãã¾ãããããC:\Program Files\Notepad++\plugins\APIsã«å ¥ãããçµããã§ãã
è£å®ã¯ãããªæãã§åºã¾ãã
å±æ§ã®ãããã¢ããã¯ãããªæãã
NotePad++ã¯ãããã軽ãã®ã§ï¼ESS使ãã®æ¹ãï¼ãã¥ã¼ã¯ã¼ã¨ãã¦å ¥ãã¦ããã¦ãããããããªããã¨æãã¾ãã
ã§ããã°å±æ§ã¨åæå¤ãã»ããã§åºãããã£ããã§ããï¼ãã¾ãåããªãã¦åå ãä¸æã ã£ãã®ã§å±æ§ã®ã¿ã«ãã¾ãããã¾ãããã¾ãããããåºã¦ããã£ã¨ããããâ¦ããã¨ï¼ããããå ¥ã£ã¦ãé¢æ°ã¯ï¼å±æ§ã®ãããã¢ãããå¹ãã¾ãããread.csvã¨ãï¼chisq.testã¨ããNotePad++ãããããåèªã®åãç®ã¨èªèãã¦ãã¾ãããã§ãã
追è¨
NotePad++ã®è¨å®ã§ï¼è£å®ãæå¹ã«ãã¦ããå¿ è¦ãããã¾ããã¡ãã¥ã¼ãã¼ããè¨å®ï¼ç°å¢è¨å®ï¼èªåä¿åï¼å ¥åè£å®ã§ãã