Description Usage Arguments Value Author(s) See Also Examples
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.
1 2 3 | Indiv2DataFrame(tab,
classes=50,
columns=c(1,2))
|
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). |
Returns a 3 columns data frame containing the aggregated data to be plotted with STdiag.
Vincent Le Bourlot
expand.grid
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.