EVOLUTION-MANAGER
Edit File: list.parse.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Convert an object to list with identical structure</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for list.parse {rlist}"><tr><td>list.parse {rlist}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Convert an object to list with identical structure</h2> <h3>Description</h3> <p>This function converts an object representing data to list that represents the same data. For example, a <code>data.frame</code> stored tabular data column-wisely, that is, each column represents a vector of a certain type. <code>list.parse</code> converts a <code>data.frame</code> to a list which represents the data row-wisely so that it can be more convinient to perform other non-tabular data manipulation methods. </p> <h3>Usage</h3> <pre> list.parse(x, ...) ## Default S3 method: list.parse(x, ...) ## S3 method for class 'matrix' list.parse(x, ...) ## S3 method for class 'data.frame' list.parse(x, ...) ## S3 method for class 'character' list.parse(x, type, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p><code>An object</code></p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional parameters passed to converter function</p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>The type of data to parse. Currently json and yaml are supported.</p> </td></tr> </table> <h3>Value</h3> <p><code>list</code> object representing the data in <code>x</code> </p> <h3>Examples</h3> <pre> x <- data.frame(a=1:3,type=c('A','C','B')) list.parse(x) x <- matrix(rnorm(1000),ncol=5) rownames(x) <- paste0('item',1:nrow(x)) colnames(x) <- c('a','b','c','d','e') list.parse(x) z <- ' a: type: x class: A registered: yes ' list.parse(z, type='yaml') </pre> <hr /><div style="text-align: center;">[Package <em>rlist</em> version 0.4.6.2 <a href="00Index.html">Index</a>]</div> </body></html>