Arguments
ss
a registered Google spreadsheet, i.e. a googlesheet
object ws
positive integer or character string specifying index or title,
respectively, of the worksheet
reverse
logical, optional. Indicates whether to request reverse row
order in the actual API call.
orderby
character, optional. Specifies a column to sort on in the
actual API call.
sq
character, optional. Provides a structured query for row filtering
in the actual API call.
...
Optional arguments to control data download, parsing, and
reshaping; for most purposes, the defaults should be fine. Anything that is
not listed here will be silently ignored.
[object Object],[object Object],[object Object],[object Ob
verbose
logical; do you want informative messages?
Column names
For the list feed, and only for the list feed, the Sheets API wants to
transform the variable or column names like so: 'The column names are the
header values of the worksheet lowercased and with all non-alpha-numeric
characters removed. For example, if the cell A1 contains the value "Time 2
Eat!" the column name would be "time2eat".' In googlesheets
, we do
not let this happen and, instead, use the column names "as is", for
consistent output across all gs_read*
functions. If you direct
gs_read_listfeed
to pass query parameters to the actual API call,
you must refer to variables using the column names under this
API-enforced transformation. For example, to order the data by the column
with "Time 2 Eat!" in the header row, you must specify orderby =
"time2eat"
in the gs_read_listfeed
call.Sorting and filtering via the API
Why on earth would you want to sort and filter via the API instead of in R?
Just because you can? It is conceivable there are situations, such as a
large spreadsheet, in which it is faster to sort or filter via API. Be sure
to refer to variables using the API-transformed column names explained
above! It is a
https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3588{known
bug} that reverse=true
alone will NOT, in fact, reverse the row
order of the result. In our experience, the reverse
query parameter
will only have effect in combination with explicit specification of a
column to sort on via orderby
. The syntax for these queries
http://stackoverflow.com/questions/25732784/official-reference-for-google-spreadsheet-api-structured-query-syntax{is
apparently undocumented}, so keep it simple or bring your spirit of
adventure!