Skip to main content
Beta
This lesson is in the beta phase, which means that it is ready for teaching by instructors outside of the original author team.
APIs with R
- Getting data from an API is equivalent to requesting a webpage
- GET requests specify what data we want to retrieve in the URL
- POST requests specify what data we want to retrieve in the body of
the request.
- Both requests have headers that we can manipulate to get what we
want.
- 200 is the internet code for everything is OK
- GET requests can be adjusted to specify desired result
- Dad jokes are not really that good.
- “POST requests to servers put specific demands on how we request
data”
- “Using an API requires us to understand (some of) the ways the API
works”
- “Different searches typically requires different endpoints”
- Larger services often provide packages to make it easier to use
their API
- Working with time and dates can be complicated. Lubridate makes it
easier
- Special date-time formats can be handled using the library zoo
-
ggplot2
is a flexible and useful tool for creating
plots in R.
- The data set and coordinate system can be defined using the
ggplot
function.
- Additional layers, including geoms, are added using the
+
operator.
- Boxplots are useful for visualizing the distribution of a continuous
variable.
- Barplots are useful for visualizing categorical data.
- Faceting allows you to generate multiple plots based on a
categorical variable.
- “Practice makes perfect”
- “KUB Datalab offers lots of courses and consultations”
- “The web is overflowing with tutorials and courses”