diff options
-rw-r--r-- | finance/R-cran-RFinanceYJ/Makefile | 3 | ||||
-rw-r--r-- | finance/R-cran-RFinanceYJ/distinfo | 4 | ||||
-rw-r--r-- | finance/R-cran-RFinanceYJ/files/patch-R-quoteStockTsData.R | 46 |
3 files changed, 38 insertions, 15 deletions
diff --git a/finance/R-cran-RFinanceYJ/Makefile b/finance/R-cran-RFinanceYJ/Makefile index 0d9cd581bc85..b7379476fbcf 100644 --- a/finance/R-cran-RFinanceYJ/Makefile +++ b/finance/R-cran-RFinanceYJ/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= RFinanceYJ -PORTVERSION= 0.1.6 -PORTREVISION= 10 +PORTVERSION= 0.2.0 CATEGORIES= finance DISTNAME= ${PORTNAME}_${PORTVERSION} diff --git a/finance/R-cran-RFinanceYJ/distinfo b/finance/R-cran-RFinanceYJ/distinfo index baf4b04e7860..96514a643447 100644 --- a/finance/R-cran-RFinanceYJ/distinfo +++ b/finance/R-cran-RFinanceYJ/distinfo @@ -1,2 +1,2 @@ -SHA256 (RFinanceYJ_0.1.6.tar.gz) = 6d2629d1ac4ab5b4f5b55307ce679ffeb58cb68595c1d1758ae8eb8d4d523c41 -SIZE (RFinanceYJ_0.1.6.tar.gz) = 3140 +SHA256 (RFinanceYJ_0.2.0.tar.gz) = f76227c3dcbae911d888214bd2a445908433187164f543c1ec2221d4f9051d28 +SIZE (RFinanceYJ_0.2.0.tar.gz) = 3625 diff --git a/finance/R-cran-RFinanceYJ/files/patch-R-quoteStockTsData.R b/finance/R-cran-RFinanceYJ/files/patch-R-quoteStockTsData.R index b965cf15dc44..617b54a98382 100644 --- a/finance/R-cran-RFinanceYJ/files/patch-R-quoteStockTsData.R +++ b/finance/R-cran-RFinanceYJ/files/patch-R-quoteStockTsData.R @@ -1,11 +1,35 @@ ---- R/quoteStockTsData.R.orig 2011-03-24 23:34:43.000000000 +0900 -+++ R/quoteStockTsData.R 2013-06-02 04:03:12.000000000 +0900 -@@ -56,7 +56,7 @@ - try( r <- xmlRoot(htmlTreeParse(quote.url,error=xmlErrorCumulator(immediate=F))), TRUE) - if( is.null(r) ) stop(paste("Can not access :", quote.url)) - -- try( quote.table <- r[[2]][[1]][[1]][[16]][[1]][[1]][[1]][[4]][[1]][[1]][[1]], TRUE ) -+ try( quote.table <- r[[2]][[1]][[1]][[13]][[1]][[1]][[1]][[4]][[1]][[1]][[1]], TRUE ) - # - if( is.null(quote.table) ){ - if( is.null(financial.data) ){ +--- R/quoteStockTsData.R.orig 2013-06-08 14:23:35.000000000 +0900 ++++ R/quoteStockTsData.R 2013-06-27 20:47:46.000000000 +0900 +@@ -38,7 +38,7 @@ + h <- as.number(xmlValue(quote.table.item[[3]])) + l <- as.number(xmlValue(quote.table.item[[4]])) + c <- as.number(xmlValue(quote.table.item[[5]])) +- return(data.frame(date=d,open=o,height=h,low=l,close=c)) ++ return(data.frame(date=d,open=o,high=h,low=l,close=c)) + } + return(quoteTsData(x,function.fx,since,start.num,date.end,time.interval,type="fx")) + } +@@ -66,6 +66,7 @@ + } + + while( result.num >= 51 ){ ++ start.num <- start.num + 1 + quote.table <- NULL + quote.url <- paste('http://info.finance.yahoo.co.jp/history/?code=',x,start,end,'&p=',start.num,'&tm=',substr(time.interval,1,1),sep="") + +@@ -90,7 +91,6 @@ + } + + result.num <- xmlSize(quote.table) +- start.num <- start.num + 1 + Sys.sleep(1) + } + financial.data <- financial.data[order(financial.data$date),] +@@ -99,7 +99,6 @@ + #convert string formart date to POSIXct object + convertToDate <- function(date.string,time.interval) + { +- date.string <- iconv(date.string,"EUC-JP","UTF-8","") + #data format is different between monthly and dialy or weekly + if(any(time.interval==c('d','w'))){ + result <- gsub("^([0-9]{4})([^0-9]+)([0-9]{1,2})([^0-9]+)([0-9]{1,2})([^0-9]+)","\\1-\\3-\\5",date.string) |