Description Usage Arguments Value Examples
This function invokes query calls based on the parameters you provide.
1 2 3 4 5 6 7 8 |
admin_codes |
a vector of administrative codes for each city that you
want to query. See |
category |
one or more of the following values: "inflow", "outflow", and "internal_flow". Each of these values corresponds to one type of data on Baidu's website. |
url |
the master url of the website to be scraped. Default to Baidu Huiyan. |
nap_control |
controls the time interval between two query calls. You need this parameter to avoid being caught by any anti-bot mechanism. |
verbose |
whether or not to show additional information for a query
call. Default to |
storage |
to append the data received to an existing dataframe provided.
if you provide this argument, then it becomes the default value that the
function returns. Thus, even if a query call fails, your existing data will
not be overwritten by a |
A nested tibble with two columns data
and meta
. Each
row stores the data received from one query call.
1 2 3 4 5 6 7 8 9 10 | # Query the inflow and outflow data for both Beijing ("110000") and Tianjin ("120000").
# The returned dataframe (of a tibble type) has a total of four rows.
df1 <- get_data(c("110000", "120000"), c("inflow", "outflow"))
## Not run:
# Use an existing object/tibble to store your returned data.
storage_space <- df1
storage_space <- get_data("110000", "internal_flow", storage = storage_space)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.