shift.rownames: Shift the first column of a dataframe to rownames() if...

Description Usage Arguments Value Author(s) See Also Examples

Description

Checks whether the first column looks like IDs, and if so will. remove the column, and move these values to rownames.

Usage

1
shift.rownames(dataf, override = FALSE, warn = FALSE)

Arguments

dataf

data.frame to run the conversion on

override

assume col 1 is rownames, regardless of numeric() test

warn

whether to display warnings if assumptions aren't met

Value

returns vectors of strings of char, lengths X

Author(s)

Nicholas Cooper nick.cooper@cimr.cam.ac.uk

See Also

reader

Examples

1
2
3
4
5
6
7
df1 <- data.frame(ID=paste("ID",101:110,sep=""),
                   scores=sample(70,10,TRUE)+30,age=sample(7,10,TRUE)+11)
shift.rownames(df1)
df2 <- data.frame(ID=paste(101:110),
                   scores=sample(70,10,TRUE)+30,age=sample(7,10,TRUE)+11)
shift.rownames(df2) # first col are all numbers, so no convert
shift.rownames(df2,override=TRUE) # override forces conversion


Search within the reader 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.