labkey.moveRows: Move rows of data from a LabKey database

View source: R/labkey.moveRows.R

labkey.moveRowsR 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 baseUrlfor LabKey server

folderPath

a string specifying the folderPath for the source container of the rows

targetFolderPath

a string specifying the targetFolderPath where the rows should be moved

schemaName

a string specifying the schemaName for the query

queryName

a string specifying the queryName

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)

Rlabkey documentation built on Oct. 23, 2024, 5:06 p.m.