na.omit.source_spct: Handle Missing Values in Objects

Description Usage Arguments Details Note See Also Examples

View source: R/na.rm.R

Description

These methods are useful for dealing with NAs in e.g., source_spct, response_spct, filter_spct and reflector_spct.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## S3 method for class 'source_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'response_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'filter_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'reflector_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'cps_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'raw_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'chroma_spct'
na.omit(object, na.action = "omit", ...)

## S3 method for class 'generic_spct'
na.exclude(object, na.action = "exclude", ...)

Arguments

object

an R object

na.action

character One of "omit" or "exclude"

...

further arguments other special methods could require

Details

If na.omit removes cases, the row numbers of the cases form the "na.action" attribute of the result, of class "omit".

na.exclude differs from na.omit only in the class of the "na.action" attribute of the result, which is "exclude".

Note

na.fail and na.pass do not require a specialisation for spectral objects. R's definitions work as expected with no need to override them.

See Also

na.fail and na.action

Examples

1
2
3
4
5
my_sun.spct <- sun.spct
my_sun.spct[3, "s.e.irrad"] <- NA
my_sun.spct[5, "s.q.irrad"] <- NA
na.omit(my_sun.spct)
na.action(na.omit(my_sun.spct))

photobiology documentation built on Sept. 24, 2018, 1:03 a.m.