GoogleWorksheetRef-class | R Documentation |
This class describes a remote Google worksheet object which is a single sheet within a Google spreadsheet. The object has information about the location of the contents of the worksheet and also its dimensions at the time at which the information was computed by R. (It is possible that the worksheet has changed after this time.) We can use this object to get the contents of the worksheet and its dimension, etc.
We can also modify the contents of a worksheet using
the common subset assignments in R, e.g.
x[1, 1] <- 10
, x[1:3, 4:9] <- 10
, x[1:3,] <- 10
,
x[1:3,] <- 10
, and x[,] <- 10
.
The dim
and getExtent
functions can be applied to a worksheet.
dim
returns the number of rows and columns for the entire worksheet,
be they empty or not.
getExtent
returns a 2 x 2 matrix with indicating the
effective number of rows and columns. The two columns
give the minimum and maximum indices for the rows and columns
respectively.
Objects are created via calls to
getWorksheets
and addWorksheet
and are very rarely
the name/title of the worksheet
the number of rows and columns
the URL of the document
content feed URL for working with rows.
content feed URL for working with the individual cells
the connection given as con
in the call which is used to be able to return
to the list/cells feed to get the contents without the need for a
connection.
the content feed URL for editing the document.
signature(x = "GoogleWorksheetRef", i = "numeric", j = "numeric")
:
syntactic sugar for retrieving subrows and columns of this matrix
signature(x = "GoogleWorksheetRef")
: get the dimensions (number of rows and columns)
of this worksheet.
Duncan Temple Lang
getWorksheets
addWorksheet
showClass("GoogleWorksheetRef")
## Not run:
docs = getDocs(con)
book = addSpreadsheet(con, c(21, 12), "dummy")
sh = addWorksheet(docs$mine4, con, title = "testing")
sh[,10, extent = 5] = letters[1:3]
sh[,4, extent = c(2, 5)] = letters[1:3]
sh[,8, extent = TRUE] = letters[1:3]
sh[,9, extent = FALSE] = letters[1:3]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.