This repository has been archived by the owner on Feb 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
README.Rmd
50 lines (34 loc) · 1.7 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
[![Travis-CI Build Status](https://travis-ci.org/adletaw/craigr.svg?branch=master)](https://travis-ci.org/adletaw/craigr)
# craigr: an R package to get data from craigslist
The purpose of this package is to obtain data from any section of
craigslist and load it into a clean `data.frame` within R. Currently this only
works with apartment searches. See the "Package status" below.
## Install
`devtools::install_github("adletaw/craigr")`
Note that the package depends on: `rvest`, `stringr`, `xml2`, `RCurl` and `magrittr`
## Package status
This package is under passive development. Currently, you can download housing
rental data only.
## Usage
### Finding available rentals
*craigr* will do an apartment search using the function `rentals`. You can
supply almost any search parameters that are available on craiglist. See the
help page for `rentals` to get the full parameter list.
First you have to specify the location and area. The location works as the
Craigslist subdomain, e.g. [seattle.craigslist.org](https://seattle.craigslist.org).
The area allows you to filter to a more specific location according to the
pre-programmed three-letter codes in Craigslist. For example, using `see`
limits the search to the Seattle city limits only. The default is `all`.
```{r location, message = FALSE}
results <- craigr::rentals(location = "seattle", area = "see",
max_results = 100)
head(results)
```
The listing title, price, data and url are provided. Check [craigslist](https://craigslist.org)
to find the location subdomain and three-letter area code.