nextElem: nextElem

nextElemR Documentation

nextElem

Description

Gets the next value from an iterator.

Usage

nextElem(iterator)

Arguments

iterator

The iterator whose next value is to be retrieved.

Details

Certain functions return iterators rather than returning a list of all values. This is because the list may be large and/or expensive to generate in its entirety, while generating just the next value is not expensive. The nextElem function returns just the next value or raises an exception if there are no more values to return. The related function as.list will retrieve all the values from the iterator and return them as a list.

Value

The next value from the iterator or an exception if there are no more values.

See Also

synGetChildren synChunkedQuery synGetEvaluationByContentSource synGetTeamMembers synGetSubmissions synGetSubmissionBundles synGetColumns synGetTableColumns as.list

Examples

## Not run: 
iterator<-synGetTeamMembers(3324324)
more<-TRUE
while (more) {
  tryCatch(
    {
  		member<-nextElem(iterator)
    		print(member)
    },
    	error=function(e) {
    		print("No more members.")
    		more<<-FALSE
    }
  )
}

## End(Not run)

Sage-Bionetworks/synapser documentation built on Feb. 7, 2024, 12:26 p.m.