Learn R Programming

berryFunctions (version 1.22.5)

na9: Prepend spaces before na.strings

Description

Returns a number of useful character strings with varying amount of spaces prepended. It can be used as na.strings=na9() in read.table.

Usage

na9(
  nspace = 5,
  base = c(-9999, -999, -9.99, -9.999),
  sep = c(",", "."),
  digits = 0:4,
  more = NULL,
  ...
)

Value

Character strings

Arguments

nspace

number of spaces prepended. DEFAULT: 5

base

Numeric: basic na.string numbers

sep

Separator string (comma or decimal point or both). DEFAULT: c(",",".")

digits

Number(s) of zeros to be appended. DEFAULT: 0:4

more

More structures added to base, like "NA", "--". digits and sep is not added to this! DEFAULT: NULL

...

Arguments passed to nothing currently

Author

Berry Boessenkool, berry-b@gmx.de, Jan 2016

See Also

Examples

Run this code

na9()
na9(nspace=0, sep=".")
na9(nspace=0, sep=".", more=c(NA,"-"))

Run the code above in your browser using DataLab