Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sckott/ftp

ftp for R
https://github.com/sckott/ftp

ftp ftp-client r r-package rstats

Last synced: about 20 hours ago
JSON representation

ftp for R

Awesome Lists containing this project

README

        

ftp
===

```{r echo=FALSE}
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
```

[![Build Status](https://travis-ci.org/sckott/ftp.svg?branch=master)](https://travis-ci.org/sckott/ftp)

An FTP client for R

**not quite ready to use yet**

The File Transfer Protocol (FTP) is a standard network protocol used for the transfer of computer files from a server to a client using the Client–server model on a computer network.

See the ftp info vignette for detailed FTP information.

## Installation

```{r eval=FALSE}
remotes::install_github("sckott/ftp")
```

```{r}
library('ftp')
```

## list files

```{r eval=FALSE}
ftp_list("ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/")
ftp_list("ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/by_year/")
ftp_list("ftp://ftp.ncdc.noaa.gov/pub/data/noaa/2014/")
# just list files
ftp_list("ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/", just_list = TRUE)
```

## fetch files

```{r eval=FALSE}
url <- "ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/by_year/1882.csv.gz"
file <- tempfile(fileext = ".csv.gz")
ftp_fetch(url, disk = file)
utils::read.delim(file, sep = ",", nrows = 10, header = FALSE)
unlink(file) # cleanup
```

## ftp client

Wraps an R6 method `FTPClient`

```{r}
(x <- ftp_client("ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/"))
```

adjust settings

```{r eval=FALSE}
x$ftp_port()
x$set_pasv()
```

pwd, working directory

```{r}
x$pwd()
```

list files

```{r}
x$list()
```

> note that parsing isn't working totally yet :)

## Meta

* Please [report any issues or bugs](https://github.com/sckott/ftp/issues).
* License: MIT
* Get citation information for `ftp` in R doing `citation(package = 'ftp')`
* Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.