Learn R Programming

adlift (version 0.8-2)

pts: pts

Description

This function constructs the gridpoints (X values) from a vector of lengths, with optional starting point.

Usage

pts(input)

Arguments

input
a vector containing the X starting point in the first entry, and the distances between observed values. input[1] can be NA.

Value

  • lengthsa vector of length (length(input)-1) with the distances between the constructed gridpoints(this is input[2:length(input)]).
  • Xthe constructed gridpoint vector.

Details

The function constructs the grid values using the first entry in input as the first gridpoint, consecutively adding the given lengths in the rest of input to find the other gridpoints. If input[1] is NA, then the starting point of the gridpoint vector X is taken to be sum(lengths)/(length(lengths)+1).

See Also

fwtnp, fwtnpmp

Examples

Run this code
y<-runif(20)
y
#
y1<-c(0,y)
y2<-c(NA,y)
#
#
pts(y1)$X
#the gridpoints, with specified startpoint of zero.
#
#
pts(y2)$X
#the grid vector with unspecified startpoint.
#

Run the code above in your browser using DataLab