adf2: Convert to data.frame, without factors

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Shortcut for: tmp_rownames = 1:nrow(x); as.data.frame(x, row.names=tmp_rownames, stringsAsFactors=FALSE)

Usage

1
  adf2(x)

Arguments

x

matrix or other object transformable to data.frame

Details

This function, and adf2, are useful for dealing with errors due to automatic conversion of some columns to factors. Another solution may be to prepend options(stringsAsFactors = FALSE) at the start of one's script, to turn off all default stringsAsFactors silliness.

In adf2, rownames are forced to be numbers; this can prevent errors due to e.g. repeated rownames after an rbind operation.

Value

data.frame

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

See Also

adf

Examples

1
2
x = matrix(c(1,2,3,4,5,6), nrow=3, ncol=2)
adf2(x)


Search within the modiscloud package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.