2014년 7월 15일 화요일

mongoDB usable scripts

# get an average of collection with some conditions. db.POINT_TOTAL_OBS_STATION_DATA.group(    { cond: { obs_item_id : "OBSCD00074" }    , initial: {count: 0, total:0}    , reduce: function(doc, out) { out.count++ ; out.total += doc.v1 }    , finalize: function(out) { out.avg = out.total / out.count } }...

2014년 7월 7일 월요일

R sample code for

# R enviroments -- to change java heap size -- R_HOME/etc/Rprofile.site options(java.parameters = c("-Xmx16g","-Dfile.encoding=UTF-8")) -- to read UTF-8 type. f <- file("d:/parser.txt", blocking=F,encoding="UTF-8") txtLines <- readLines(f) # 1. how to collect a stock info. install.packages("fImport") library(fImport) s_e <- yahooSeries("005935.KS") plot(s_e) #...