[Blotter-commits] r1088 - in pkg/FinancialInstrument: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 28 18:15:59 CEST 2012
Author: gsee
Date: 2012-06-28 18:15:59 +0200 (Thu, 28 Jun 2012)
New Revision: 1088
Modified:
pkg/FinancialInstrument/R/load.instruments.R
pkg/FinancialInstrument/R/saveSymbols.R
pkg/FinancialInstrument/man/getSymbols.FI.Rd
pkg/FinancialInstrument/man/saveSymbols.days.Rd
Log:
Update docs; add example to getSymbols.FI
Modified: pkg/FinancialInstrument/R/load.instruments.R
===================================================================
--- pkg/FinancialInstrument/R/load.instruments.R 2012-06-28 15:12:01 UTC (rev 1087)
+++ pkg/FinancialInstrument/R/load.instruments.R 2012-06-28 16:15:59 UTC (rev 1088)
@@ -271,6 +271,15 @@
#' \code{\link{setSymbolLookup.FI}}
#' \code{\link{loadInstruments}}
#' \code{\link[quantmod]{getSymbols}}
+#' @examples
+#' \dontrun{
+#' getSymbols("SPY", src='yahoo')
+#' dir.create("tmpdata")
+#' saveSymbols.common("SPY", base_dir="tmpdata")
+#' rm("SPY")
+#' getSymbols("SPY", src='FI', dir="tmpdata", split_method='common')
+#' unlink("tmpdata/SPY", recursive=TRUE)
+#' }
#' @export
getSymbols.FI <- function(Symbols,
from='2010-01-01',
Modified: pkg/FinancialInstrument/R/saveSymbols.R
===================================================================
--- pkg/FinancialInstrument/R/saveSymbols.R 2012-06-28 15:12:01 UTC (rev 1087)
+++ pkg/FinancialInstrument/R/saveSymbols.R 2012-06-28 16:15:59 UTC (rev 1088)
@@ -12,18 +12,18 @@
#
###############################################################################
-#' save data to disk
+#' Save data to disk
#'
-#' save data to disk the way that \code{getSymbols.FI}
+#' Save data to disk the way that \code{getSymbols.FI}
#' expects it to be saved.
#'
-#' If they do not already exist, subdirectories will be created for each of the \code{Symbols}.
-#' \code{saveSymbols.common} will save a single \sQuote{rda} file for each of the \code{Symbols}
-#' in that symbol's subdirectory.
-#' \code{saveSymbols.days} will split the data up into days and save a separate \sQuote{rda} file
-#' for each day in that symbol's subdirectory.
+#' If they do not already exist, subdirectories will be created for each of the
+#' \code{Symbols}. \code{saveSymbols.common} will save a single \sQuote{rda}
+#' file for each of the \code{Symbols} in that symbol's subdirectory.
+#' \code{saveSymbols.days} will split the data up into days and save a separate
+#' \sQuote{rda} file for each day in that symbol's subdirectory.
#'
-#' @param Symbols vector of character names of objects to be saved
+#' @param Symbols character vector of names of objects to be saved
#' @param base_dir character. directory in which to store data.
#' @param extension file extension (\dQuote{rda})
#' @param env environment that holds the data to be saved (.GlobalEnv by default)
@@ -32,10 +32,11 @@
#' @examples
#' \dontrun{
#' getSymbols("SPY", src='yahoo')
-#' saveSymbols.common("SPY", base_dir="~/")
+#' dir.create("tmpdata")
+#' saveSymbols.common("SPY", base_dir="tmpdata")
#' rm("SPY")
-#' getSymbols("SPY", src='FI', dir="~/", split_method='common')
-#' unlink("~/SPY", recursive=TRUE)
+#' getSymbols("SPY", src='FI', dir="tmpdata", split_method='common')
+#' unlink("tmpdata/SPY", recursive=TRUE)
#' }
#' @export
#' @rdname saveSymbols.days
Modified: pkg/FinancialInstrument/man/getSymbols.FI.Rd
===================================================================
--- pkg/FinancialInstrument/man/getSymbols.FI.Rd 2012-06-28 15:12:01 UTC (rev 1087)
+++ pkg/FinancialInstrument/man/getSymbols.FI.Rd 2012-06-28 16:15:59 UTC (rev 1088)
@@ -90,6 +90,16 @@
\code{setDefaults} will be used. Finally, if none of the
above are true, the formal defaults will be used.
}
+\examples{
+\dontrun{
+getSymbols("SPY", src='yahoo')
+dir.create("tmpdata")
+saveSymbols.common("SPY", base_dir="tmpdata")
+rm("SPY")
+getSymbols("SPY", src='FI', dir="tmpdata", split_method='common')
+unlink("tmpdata/SPY", recursive=TRUE)
+}
+}
\seealso{
\code{\link{saveSymbols.days}} \code{\link{instrument}}
\code{\link{setSymbolLookup.FI}}
Modified: pkg/FinancialInstrument/man/saveSymbols.days.Rd
===================================================================
--- pkg/FinancialInstrument/man/saveSymbols.days.Rd 2012-06-28 15:12:01 UTC (rev 1087)
+++ pkg/FinancialInstrument/man/saveSymbols.days.Rd 2012-06-28 16:15:59 UTC (rev 1088)
@@ -1,7 +1,7 @@
\name{saveSymbols.days}
\alias{saveSymbols.common}
\alias{saveSymbols.days}
-\title{save data to disk}
+\title{Save data to disk}
\usage{
saveSymbols.days(Symbols, base_dir = "",
extension = "rda", env = .GlobalEnv)
@@ -10,7 +10,7 @@
extension = "rda", env = .GlobalEnv)
}
\arguments{
- \item{Symbols}{vector of character names of objects to be
+ \item{Symbols}{character vector of names of objects to be
saved}
\item{base_dir}{character. directory in which to store
@@ -25,7 +25,7 @@
called for side-effect.
}
\description{
- save data to disk the way that \code{getSymbols.FI}
+ Save data to disk the way that \code{getSymbols.FI}
expects it to be saved.
}
\details{
@@ -40,10 +40,11 @@
\examples{
\dontrun{
getSymbols("SPY", src='yahoo')
-saveSymbols.common("SPY", base_dir="~/")
+dir.create("tmpdata")
+saveSymbols.common("SPY", base_dir="tmpdata")
rm("SPY")
-getSymbols("SPY", src='FI', dir="~/", split_method='common')
-unlink("~/SPY", recursive=TRUE)
+getSymbols("SPY", src='FI', dir="tmpdata", split_method='common')
+unlink("tmpdata/SPY", recursive=TRUE)
}
}
\seealso{
More information about the Blotter-commits
mailing list