Giter VIP home page Giter VIP logo

getpurpleairapihistory's Introduction

getPurpleairApiHistory

R function to download historical data from PurpleAir sensors in the newer API.

Usage

getPurpleairApiHistory(
    sensorIndex,  
    apiReadKey,
    startTimeStamp,
    endTimeStamp,
    average,
    fields
)

Arguments

Argment Description
sensorIndex The sensor index or list of sensor index. Sensor index is found in the url (?select=sensor_index) of a selected sensor in the purpleair map.
apiReadKey PurpleAir API read key with access to historical data. See PurpleAir Community website for more information.
startTimeStamp The beginning date in the format "YYYY-MM-DD HH:mm:ss".
endTimeStamp The end date in the format "YYYY-MM-DD" HH:mm:ss.
average The desired average in minutes, one of the following: "0" (real-time), "10", "30", "60", "360" (6 hour), "1440" (1 day).
fields The "Fields" parameter specifies which 'sensor data fields' to include in the response.

Value

Dataframe of PurpleAir history data of a single sensor or multiple sensors.

References

PurpleAir API.

Examples

For a single sensor

getPurpleairApiHistory(
    sensorIndex    = "31105",  
    apiReadKey     = "43664AA0-305B-11ED-B5AA-42010A800010",
    startTimeStamp = "2022-12-26 00:00:00",
    endTimeStamp   = "2022-12-26 23:59:59",
    average        = "10"
    fields         = c("pm2.5_atm, pm2.5_atm_a, pm2.5_atm_b")
)

For multiple sensors

getPurpleairApiHistory(
    sensorIndex    = c("31105","31105","57177"),  
    apiReadKey     = "43664AA0-305B-11ED-B5AA-42010A800010",
    startTimeStamp = "2022-12-26 00:00:00",
    endTimeStamp   = "2022-12-26 23:59:59",
    average        = "10"
    fields         = c("pm2.5_atm, pm2.5_atm_a, pm2.5_atm_b")
)

getpurpleairapihistory's People

Contributors

willianflores avatar

Stargazers

Claudiane Duarte  avatar Micaela Chan avatar  avatar Nicholas Judd avatar  avatar Jianzhao Bi avatar

Watchers

 avatar

Forkers

rishabhshah-92

getpurpleairapihistory's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.