Learn R Programming

recommenderlab (version 0.1-9)

getList: List and Data.frame Representation for Recommender Matrix Objects

Description

Create a list or data.frame representation for various objects used in recommenderlab. These functions are used in addition to available coercion to allow for parameters like decode.

Usage

getList(from, ...)
## S3 method for class 'realRatingMatrix':
getList(from, decode = TRUE, ratings = TRUE, ...)
## S3 method for class 'binaryRatingMatrix':
getList(from, decode = TRUE, ...)
## S3 method for class 'topNList':
getList(from, decode = TRUE, ...)

getData.frame(from, ...) ## S3 method for class 'ratingMatrix': getData.frame(from, decode = TRUE, ratings = TRUE, ...)

Arguments

from
object to be represented as a list.
decode
use item names or item IDs (column numbers) for items?
ratings
include ratings in the list or data.frame?
...
further arguments (currently unused).

Value

  • Returns a list or a data.frame.

Details

Lists have one vector with items (and ratings) per user. The data.frame has one row per rating with the user in the first column, the item as the second and the rating as the third.

See Also

binaryRatingMatrix, realRatingMatrix, topNList.

Examples

Run this code
data(Jester5k)

getList(Jester5k[1,])
getData.frame(Jester5k[1,])

Run the code above in your browser using DataLab