labkey.moveRows {Rlabkey} | R Documentation |
Move rows of data from a LabKey database
Description
Specify rows of data to be moved from the LabKey Server
Usage
labkey.moveRows(baseUrl, folderPath, targetFolderPath,
schemaName, queryName, toMove, options=NULL)
Arguments
baseUrl |
a string specifying the |
folderPath |
a string specifying the |
targetFolderPath |
a string specifying the |
schemaName |
a string specifying the |
queryName |
a string specifying the |
toMove |
a data frame containing a single column of data containing the data identifiers of the rows to be moved |
options |
(optional) a list containing options specific to the move action of the query |
Details
Move a set of rows from the source container to a target container for a table. Note that this is not implemented for all tables.
The list of valid options for each query will vary, but some common examples include:
-
auditBehavior (string)
: Can be used to override the audit behavior for the table the query is acting on. The set of types include: NONE, SUMMARY, and DETAILED. -
auditUserComment (string)
: Can be used to provide a comment from the user that will be attached to certain detailed audit log records.
Value
A list is returned with named categories of command, rowsAffected, schemaName, queryName, containerPath and updateCounts. The containerPath will be the target container path where the rows were moved. The rowsAffected property indicates the number of rows affected by the API action. This will typically be the same number as passed in the request. The updateCounts property is a list of the number of items moved for various related items.
Author(s)
Cory Nathe
See Also
labkey.deleteRows
,
labkey.importRows
,
labkey.importRows
,
labkey.updateRows
,
Examples
## Not run:
## Note that users must have the necessary permissions in the LabKey Server
## to be able to modify data through the use of these functions
# library(Rlabkey)
newrow <- data.frame(
DisplayFld="Inserted from R"
, IntFld= 98
, DateTimeFld = "03/01/2010"
, stringsAsFactors=FALSE)
insertedRow <- labkey.insertRows("http://localhost:8080/labkey",
folderPath="/apisamples", schemaName="samples",
queryName="Blood", toInsert=newrow)
newRowId <- insertedRow$rows[[1]]$RowId
result <- labkey.moveRows(baseUrl="http://localhost:8080/labkey",
folderPath="/apisamples", folderPath="/apisamples/subA", schemaName="samples",
queryName="Blood", toMove=data.frame(RowId=c(newRowId)),
options = list(auditUserComment="testing comment from API call", auditBehavior="DETAILED"))
result
## End(Not run)