Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.pseries

Check if an object is a pseries


Description

This function checks if an object qualifies as a pseries

Usage

is.pseries(object)

Arguments

object

object to be checked for pseries features

Details

A "pseries" is a wrapper around a "basic class" (numeric, factor, logical, character, or complex).

To qualify as a pseries, an object needs to have the following features:

  • class contains "pseries" and there are at least two classes ("pseries" and the basic class),

  • have an appropriate index attribute (defines the panel structure),

  • any of is.numeric, is.factor, is.logical, is.character, is.complex is TRUE.

Value

A logical indicating whether the object is a pseries (TRUE) or not (FALSE).

See Also

pseries() for some computations on pseries and some further links.

Examples

# Create a pdata.frame and extract a series, which becomes a pseries
data("EmplUK", package = "plm")
Em <- pdata.frame(EmplUK)
z <- Em$output

class(z) # pseries as indicated by class
is.pseries(z) # and confirmed by check

# destroy index of pseries and re-check
attr(z, "index") <- NA
is.pseries(z) # now FALSE

plm

Linear Models for Panel Data

v2.4-1
GPL (>= 2)
Authors
Yves Croissant [aut, cre], Giovanni Millo [aut], Kevin Tappe [aut], Ott Toomet [ctb], Christian Kleiber [ctb], Achim Zeileis [ctb], Arne Henningsen [ctb], Liviu Andronic [ctb], Nina Schoenfelder [ctb]
Initial release
2021-03-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.