as.best: Convert to Best of Numeric or Character

Description Usage Arguments Details Value Methods (by class)

Description

Convert to best of numeric or character.

Convert data.frame columns to best of numeric or character.

Convert vector to best of numeric or character.

Usage

1
2
3
4
5
6
7
8
as.best(x, ...)

## S3 method for class 'data.frame'
as.best(x, prefix = "#", ...)

## Default S3 method:
as.best(x, prefix = "", na.strings = c(".", "NA", ""),
  ...)

Arguments

x

vector or data.frame

...

passed to other methods

prefix

character to prepend to values in mixed numeric/character columns

na.strings

strings to treat as NA

Details

Converts to numeric if doing so creates no new NA; otherwise to character.

Converts columns to numeric if doing so creates no new NA; otherwise to character. Number-like columns that are nevertheless character are prefixed by default to make this explicit when viewing only a few rows.

Converts vector to numeric if doing so creates no new NA; otherwise to character. Number-like vectors that are nevertheless character are prefixed by default to make this explicit when viewing only a few rows.

Value

data.frame

Methods (by class)


bergsmat/partab documentation built on May 12, 2019, 3:09 p.m.