Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tidied code

  • Loading branch information...
commit 54ad058367a38c3672d712a88641dd11b66230a3 1 parent e35bff2
@sckott sckott authored
Showing with 58 additions and 18 deletions.
  1. +10 −3 DESCRIPTION
  2. +3 −0  NAMESPACE
  3. +15 −15 R/flybasesymbol.R
  4. +30 −0 man/flybasesymbol.Rd
View
13 DESCRIPTION
@@ -1,9 +1,16 @@
Package: rflybase
Description: A programmatic interface to the
- Web Service methods provided by the FlyBase.
+ Web Service methods provided by the FlyBase.
Title: Interface to FlyBase API methods
Version: 0.0-1
License: BSD
Author: Scott Chamberlain
-Maintainer: Scott Chamberlain <myrmecocystus@gmail.com>
-Imports: RJSONIO, RCurl (>= 1.6), stringr, ggplot2, data.table
+Maintainer: Scott Chamberlain <myrmecocystus@gmail.com>
+Imports:
+ RJSONIO,
+ RCurl (>= 1.6),
+ stringr,
+ ggplot2,
+ data.table
+Collate:
+ 'flybasesymbol.R'
View
3  NAMESPACE
@@ -0,0 +1,3 @@
+export(flybasesymbol)
+import(RCurl)
+import(XML)
View
30 R/flybasesymbol.R
@@ -1,21 +1,21 @@
-# flybasesymbol.R
-
-flybasesymbol <-
-# Args:
-# symbol: flybase symbol (character)
-# Output: xml
-# Examples:
-# flybasesymbol("dro5-PA")
-
-function(symbol = NA,
- url = 'http://flybase.org/chadoxml/symbol/',
- ...,
- curl = getCurlHandle() )
+#' Returns XML document of Flybase data.
+#'
+#' @import RCurl XML
+#' @param symbol flybase symbol (character)
+#' @param url the Flybase base API url for the function (should be left to default)
+#' @param ... optional additional curl options (debugging tools mostly)
+#' @param curl If using in a loop, call getCurlHandle() first and pass
+#' the returned value in here (avoids unnecessary footprint)
+#' @export
+#' @examples \dontrun{
+#' flybasesymbol("dro5-PA")
+#' }
+flybasesymbol <- function(symbol = NA, url = 'http://flybase.org/chadoxml/symbol/',
+ ..., curl = getCurlHandle() )
{
url2 <- paste(url, symbol, sep='')
- cat(url2)
+ message(url2)
tt <- getURL(url2, curl = curl)
xmlParse(tt)
}
-
# http://flybase.org/chadoxml/symbol/dro5-PA
View
30 man/flybasesymbol.Rd
@@ -0,0 +1,30 @@
+\name{flybasesymbol}
+\alias{flybasesymbol}
+\title{Returns XML document of Flybase data.}
+\usage{
+ flybasesymbol(symbol = NA,
+ url = "http://flybase.org/chadoxml/symbol/", ...,
+ curl = getCurlHandle())
+}
+\arguments{
+ \item{symbol}{flybase symbol (character)}
+
+ \item{url}{the Flybase base API url for the function
+ (should be left to default)}
+
+ \item{...}{optional additional curl options (debugging
+ tools mostly)}
+
+ \item{curl}{If using in a loop, call getCurlHandle()
+ first and pass the returned value in here (avoids
+ unnecessary footprint)}
+}
+\description{
+ Returns XML document of Flybase data.
+}
+\examples{
+\dontrun{
+flybasesymbol("dro5-PA")
+}
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.