Learn R Programming

OpasnetUtils (version 1.1.0)

opasnet: Importing files from Opasnet

Description

Functions for downloading files from Opasnet Media Wiki environments.

Usage

opasnet.data(filename, wiki = "", unzip = "")
opasnet.csv(filename, wiki = "", unzip = "", ...)
opasnet.page(pagename, wiki = "")

Arguments

filename
Path to file in Opasnet after the "images/" part.
pagename
Name of a page in Opasnet.
wiki
Name of the Opasnet wiki: "opasnet_en" for en.opasnet.org, "opasnet_fi" for fi.opasnet.org or "heande" for heande.opasnet.org (accessible only within Heande wiki).
unzip
Name of the file in the package (if compressed using zip).
...
Excess arguments will be passed to read.table function when downloading csv-file.

Value

  • opasnet.dataReturns the file data as is.
  • opasnet.csvReturns data.frame parsed from csv file.
  • opasent.pageReturns the web page as a single string.

Details

These functions make it easy to download Opasnet files for being used in R. Required path (filename) for file must be resolved using the corresponding Media Wiki. Big data files should always be compressed before uploading to Opasnet. Using the unzip-argument makes it easy to download and directly use any zip-compressed files. opasnet.page downloads wiki pages using getURL from RCurl. See also: http://en.opasnet.org/

See Also

read.table

Examples

Run this code
opasnet.csv("4/49/Test.zip", wiki = "opasnet_fi", unzip = 'ejpop.csv', sep=';')
opasnet.data("c/cc/Test_bugs_model.txt", wiki = "opasnet_en")

Run the code above in your browser using DataLab