Indiv2DataFrame: In case data set is composed of one line per individual, with...

Description Usage Arguments Value Author(s) See Also Examples

Description

Function to convert an individual based set of measurements into a data frame readable by STdiag. The input table must have one line per individual observed and observations (time, structure, ...) in columns.

Usage

1
2
3
Indiv2DataFrame(tab,
                classes=50,
                columns=c(1,2))

Arguments

tab

Data frame containing the indivudual observations.

classes

Integer, number of class to discretize the structuring variable.

columns

Vector of dimension 2 (by default c(1,2)), specifying the number of respectively column x (time) and y (structure).

Value

Returns a 3 columns data frame containing the aggregated data to be plotted with STdiag.

Author(s)

Vincent Le Bourlot

See Also

expand.grid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Define a random example data set 
# with one line per individual observed, 
# and time and length in columns
n=20;r=50;
t=round(runif(n=n,min=0,max=100))
example=data.frame(time=sort(rep(t,r)),length=(rnorm(n=n*r,mean=1000,sd=2)))

# Convert into something that STdiag can read
STexample=Indiv2DataFrame(example)

# Plot example
STdiag(data=STexample)

STdiag documentation built on May 2, 2019, 4:58 p.m.