Title: | Recording Tree-Ring Shapes of Tree Disks with Manual Digitizing and Interpolating Model |
---|---|
Description: | Record all tree-ring Shapefile of tree disk with GIS soft ('Qgis'<https://www.qgis.org/en/site/>) and interpolating model from high resolution tree disk image. |
Authors: | Megumi ISHIDA [aut, cre, cph] |
Maintainer: | Megumi ISHIDA <[email protected]> |
License: | GPL (>= 2) |
Version: | 3.0.5 |
Built: | 2024-11-14 23:22:29 UTC |
Source: | https://github.com/ishidamgm/treeringshape |
Return a area from polygon xy coordinates
area(xy)
area(xy)
xy |
a atrix or data frame of xy coordinates |
a vector of polygon area
xy<-data.frame(x=c(0,1,2,1),y=c(1,2,1,0)) plot(xy,type="b") ; polygon(xy) area(xy)
xy<-data.frame(x=c(0,1,2,1),y=c(1,2,1,0)) plot(xy,type="b") ; polygon(xy) area(xy)
Return circumference length of polygon line
circumference(l.)
circumference(l.)
l. |
data frame of line coordinates (x,y) |
a numeric of circumference length of polygon line
l. <- data.frame(x=c(0,0,1,1),y=c(0,1,1,0)) plot(l.,type="b") ; polygon(l.) circumference(l.)
l. <- data.frame(x=c(0,0,1,1),y=c(0,1,1,0)) plot(l.,type="b") ; polygon(l.) circumference(l.)
class of TreeRingShape
P_filename
character. file name of shape file (P) for tree ring points
P_id.tag
character. column name of id in shape file (P), default is 'id'
P_ring.tag
character. column name of ring no.(ordinaly year,outermost=0) in shape file (P), default is 'ring'
P
data.frame. radial tree ring points (x,y,id,yr,r,deg)
P00
numeric. x,y coordinates c(px00,py00) of tree ring center point, ordinarily a pith in a disk, a point of id==0 in P
n_id
numeric. number of radial measurement points, length(unique(P$id))-1 (omit a original point id=0)
YR_P
numeric. total number of tree rings, unique(P$ring)
L_filename
character. file name of shape file (L) for tree ring lines
L_ring.tag
character. column name of ring no.(ordinaly year,outermost=0) in shape file (L), default is 'ring'
L
list. x,y coordinates of representative tree rings
L_
data.frame. x,y coordinates of representative tree rings
YR_L
numeric. cumulative tree rings number(year) from 0 (cambium layer) of L =dbf$ring, names(L)
ln
numeric. total number of representative tree rings, length(L)
L2_filename
character. file name of shape file (L2) for tree ring lines interpolated
L2
list. x,y coordinates of representative + interpolated tree rings
n_YR
numeric. total number of representative + interpolated tree rings = unique(P$yr), length(L2)
TR. <- new('classTreeRingShape') TR. slotNames(TR.) str(TR.)
TR. <- new('classTreeRingShape') TR. slotNames(TR.) str(TR.)
Constant for conversion from degree to radian ####
degree
degree
An object of class numeric
of length 1.
Return information for tree disk analysed from TreeRingShape class
DiskInfo(TR., dpi = 1200)
DiskInfo(TR., dpi = 1200)
TR. |
class of TreeRingShape |
dpi |
Resolution of tree disk image |
data frame of information for tree disk analysed
Return a vector of distances from original a point (0,0) from a matrix or data frame of xy coordinates
dst(xy)
dst(xy)
xy |
a matrix or data frame of xy coordinates |
a vector of distances from original a point
plot(TR@L[[1]]) plot(dst(TR@L[[1]]))
plot(TR@L[[1]]) plot(dst(TR@L[[1]]))
Return vector for distance between adjacent two points
dstpp(x, y)
dstpp(x, y)
x |
vector of x coordinates |
y |
vector of y coordinates |
vector for distance between adjacent two points
l.<-TR@L[[1]] plot(l.) x<-l.[,1] ;y<-l.[,2] dstpp(x,y)
l.<-TR@L[[1]] plot(l.) x<-l.[,1] ;y<-l.[,2] dstpp(x,y)
Return a vector of center angle 0 to 360(degree) for x y coordinate vector
Ldeg360(x, y)
Ldeg360(x, y)
x |
a vector of x coordinates |
y |
a vector of y coordinates |
a vector of center angle 0 to 360(degree) for x y coordinate vector
xy <-TR@L[[1]] plot(Ldeg360(xy[,1],xy[2]))
xy <-TR@L[[1]] plot(Ldeg360(xy[,1],xy[2]))
Convert from a list of tree rings polygons (L) to data frame to a data frame with no.,year,x,y,r(radius),radian(center angle),degree. The data frame is sorted by degree(0 to 360).
Llist2dataframe(L)
Llist2dataframe(L)
L |
list of tree ring lines |
data frame
L_ <- Llist2dataframe(TR@L) head(L_) ; tail(L_)
L_ <- Llist2dataframe(TR@L) head(L_) ; tail(L_)
Move the tree rings coordinates based on P00 (x,y movement coordinates).
Lmove(L, P00 = P00)
Lmove(L, P00 = P00)
L |
a list of tree rings(x,y coordinates). |
P00 |
x, y coordinates of a center point (usually a pith). |
moved L to center point 0,0
Lplot(TR@L) sapply(Lmove(TR@L,c(3000,-3000)),lines,col="blue")
Lplot(TR@L) sapply(Lmove(TR@L,c(3000,-3000)),lines,col="blue")
Plot a graphics of tree rings
Lplot(L, rn = 1:length(L), col = "red", ...)
Lplot(L, rn = 1:length(L), col = "red", ...)
L |
a list of tree rings polygon coordinates (X,Y) |
rn |
vector of ring number of list (L), default 1:length(L) |
col |
color of plot |
... |
other parameters to be passed through to plotting functions |
No return value, only draw tree ring plot.
Lplot(TR@L,main=TR@L_filename) Lplot(TR@L,rn=1:20,col='blue',main=TR@L_filename)
Lplot(TR@L,main=TR@L_filename) Lplot(TR@L,rn=1:20,col='blue',main=TR@L_filename)
Draw a graphics of tree rings by 1 ring (3*3 in a screen)
Lplot2(L, i.ring = 1:length(L), nrow = 3, ncol = 3, ask = "FALSE", ...)
Lplot2(L, i.ring = 1:length(L), nrow = 3, ncol = 3, ask = "FALSE", ...)
L |
a list of tree rings polygon coordinates (X,Y) |
i.ring |
integer vector, tree ring number for drawing |
nrow |
par(mfrow=c(nrow,ncol)) |
ncol |
par(mfrow=c(nrow,ncol)) |
ask |
logical; if TRUE, the user is asked before each plot |
... |
other parameters to be passed through to plotting functions. |
No return value, only draw tree ring plot.
Lplot2(TR@L,i.ring=1:9, nrow=1,ncol=1,type='b') Lplot2(TR@L,type='b')
Lplot2(TR@L,i.ring=1:9, nrow=1,ncol=1,type='b') Lplot2(TR@L,type='b')
Check center angle of points to input order
Lrad.plot(L, i.ring = 1:4, nrow = 2, ncol = 2)
Lrad.plot(L, i.ring = 1:4, nrow = 2, ncol = 2)
L |
list of tree rings |
i.ring |
integer vector, tree ring number for drawing |
nrow |
par(mfrow=c(nrow,ncol)) |
ncol |
par(mfrow=c(nrow,ncol)) |
No return value, only draw tree ring plot.
slotNames(TR) Lplot(TR@L) str(TR@L) Lrad.plot(TR@L,11:19)
slotNames(TR) Lplot(TR@L) str(TR@L) Lrad.plot(TR@L,11:19)
Return a ring number of tree ring polygons list (L) from year
Lrn(L, yr)
Lrn(L, yr)
L |
tree ring polygons list (L) |
yr |
years (or rings) |
a ring number of tree ring polygons list (L)
Lrn(TR@L,168) # 168 is the formation year (from outermost) of the tree ring
Lrn(TR@L,168) # 168 is the formation year (from outermost) of the tree ring
Sort x,y coordinates of a tree ring line with center angle of each point
Lsort(l.)
Lsort(l.)
l. |
x,y coordinates matrix (ncol=2) or data.frame of an tree ring. |
ordered with center angle of each point
i<-seq(0,2*pi,0.1) l.<-data.frame(x=sin(i),y=cos(i)) l.[10,]<-l.[20,] plot(l.,type="b") plot(Lsort(l.),type="b")
i<-seq(0,2*pi,0.1) l.<-data.frame(x=sin(i),y=cos(i)) l.[10,]<-l.[20,] plot(l.,type="b") plot(Lsort(l.),type="b")
Sort x,y coordinates of tree ring lines with center angle of each point apply Lsort to list of tree ring lines
Lsort_all(L)
Lsort_all(L)
L |
a list of tree ring lines (x,y) |
a list of tree ring lines (x,y) ordered with center angle of each point
str(Lsort_all(TR@L))
str(Lsort_all(TR@L))
Initial setting of a new classTreeRingShape (TR)
new_classTreeRingShape( P_filename, L_filename, L2_filename, P_id.tag = "id", P_ring.tag = "ring", L_ring.tag = "ring" )
new_classTreeRingShape( P_filename, L_filename, L2_filename, P_id.tag = "id", P_ring.tag = "ring", L_ring.tag = "ring" )
P_filename |
file name of shape file (P) for tree ring points |
L_filename |
file name of shape file (L) for tree ring lines |
L2_filename |
file name of shape file (L2) for tree ring lines interpolated |
P_id.tag |
column name of id in shape file (P), default is 'id' |
P_ring.tag |
column name of ring no.(ordinaly year,outermost=0) in shape file (L), default is 'ring' |
L_ring.tag |
column name of ring no.(ordinaly year,outermost=0) in shape file (L), default is 'ring' |
generated new object from classTreeRingShape
TR_<-new_classTreeRingShape( P_filename='Abies_277_h400_TreeRing_Points.shp', L_filename='Abies_277_h400_TreeRing_Representative.shp', L2_filename='Abies_277_h400_TreeRing.shp', P_id.tag='id', P_ring.tag='ring', L_ring.tag='ring') TR_ slotNames(TR_) str(TR_)
TR_<-new_classTreeRingShape( P_filename='Abies_277_h400_TreeRing_Points.shp', L_filename='Abies_277_h400_TreeRing_Representative.shp', L2_filename='Abies_277_h400_TreeRing.shp', P_id.tag='id', P_ring.tag='ring', L_ring.tag='ring') TR_ slotNames(TR_) str(TR_)
Return a vector of row numbers of points that have nearest center angle
nstP(z1, z2)
nstP(z1, z2)
z1 |
a data frame or a matrix of xy coordinates of a tree ring (usualy inner ring) |
z2 |
a data frame or a matrix of xy coordinates of a tree ring (usualy outer ring) |
a vector of row numbers of z2, the length is nrow(z1)
L_out<-TR@L[[1]];L_in<-TR@L[[30]] np<-nstP(L_out,L_in) plot(L_out,col="red"); points(L_in) segments(L_out[,1],L_out[,2],L_in[np,1],L_in[np,2],col="blue")
L_out<-TR@L[[1]];L_in<-TR@L[[30]] np<-nstP(L_out,L_in) plot(L_out,col="red"); points(L_in) segments(L_out[,1],L_out[,2],L_in[np,1],L_in[np,2],col="blue")
Draw a plot of tree rings This function draws Tree rings of a disk from x, y list(x,y) with name of year.
plot_TreeRing(L, year = 0, ...)
plot_TreeRing(L, year = 0, ...)
L |
list(x,y) of Tree ring coordinates with name of year |
year |
name of column of Tree ring year (0(cambium),1,2,....,n(pith)) |
... |
other parameters to be passed through to plotting functions |
No return value, only draw tree ring plot.
names(TR@L) plot_TreeRing(TR@L) plot_TreeRing(TR@L,year=10,type='l',col='blue')
names(TR@L) plot_TreeRing(TR@L) plot_TreeRing(TR@L,year=10,type='l',col='blue')
plot_TreeRing_df Draw a Tree ring of a disk from data frame(x,y,year)
plot_TreeRing_df(df, year = 0, year_label = "yr")
plot_TreeRing_df(df, year = 0, year_label = "yr")
df |
name of a data frame |
year |
integer vector of years to draw tree rings |
year_label |
name of column of Tree ring year (0(cambium),1,2,....,n(pith)) |
No return value, only draw tree ring plot.
TR@L_ <- Llist2dataframe(TR@L) # data frame of tree rings plot_TreeRing_df(TR@L_, year =1)
TR@L_ <- Llist2dataframe(TR@L) # data frame of tree rings plot_TreeRing_df(TR@L_, year =1)
Plot tree rings from data fame This function draws Tree rings of a disk from data frame(x,y,year).
plot_TreeRings_df(df, year_label = "yr")
plot_TreeRings_df(df, year_label = "yr")
df |
name of a data frame |
year_label |
name of column of Tree ring year (0(cambium),1,2,....,n(pith)) |
No return value, only draw tree ring plot.
Llist2dataframe
for the data frame
TR@L_ <- Llist2dataframe(TR@L) # data frame of tree rings names(TR@L_) plot_TreeRings_df(TR@L_)
TR@L_ <- Llist2dataframe(TR@L) # data frame of tree rings names(TR@L_) plot_TreeRings_df(TR@L_)
Plot and return data frame of year_disk area and year_Tree ring area
plot_year_RingArea(L2, yr_end = 2018)
plot_year_RingArea(L2, yr_end = 2018)
L2 |
list of tree rings |
yr_end |
outermost year of tree ring |
list of Year_DiskArea and Year_TreeRingArea
Return relative distance between two representative tree rings
rdst(L, P, yr)
rdst(L, P, yr)
L |
list of x,y coordinates of representative tree rings (TR@L) |
P |
data.frame (x,y,id,yr,r,deg) of radial tree ring points (TR@P) |
yr |
year |
a data frame with relative distance and center angle
rdst.<-rdst(TR@L,TR@P,73) plot(rdst.) spline<-smooth.spline(rdst.$rad,rdst.$rdst, spar =0.0002) lines(predict(spline,seq(-pi,pi,0.01)),col="red")
rdst.<-rdst(TR@L,TR@P,73) plot(rdst.) spline<-smooth.spline(rdst.$rad,rdst.$rdst, spar =0.0002) lines(predict(spline,seq(-pi,pi,0.01)),col="red")
Return relative distance between two representative tree rings
rdst_MerginePlus(L, P, yr)
rdst_MerginePlus(L, P, yr)
L |
is a list of tree rings(x,y coordinates). |
P |
data.frame (x,y,id,yr,r,deg) of radial tree ring points (TR@P) |
yr |
integer of year |
a data frame with relative distance and center angle(degree) with mergine (-90 - 0 - 360 - 90)
year.<-73 rdst.<-rdst_MerginePlus(TR@L,TR@P,year.) plot(rdst.,xlim=c(-200,200),main=year.) spline<-smooth.spline(rdst.$deg,rdst.$rdst, spar =0.0002) lines(predict(spline,seq(-202,220,1)),col="red")
year.<-73 rdst.<-rdst_MerginePlus(TR@L,TR@P,year.) plot(rdst.,xlim=c(-200,200),main=year.) spline<-smooth.spline(rdst.$deg,rdst.$rdst, spar =0.0002) lines(predict(spline,seq(-202,220,1)),col="red")
Return x,y coordinates of a tree ring center point (P00) from shape file of tree ring points
ReadShapefile_P00( filename = "Abies_277_h400_TreeRing_Points.shp", id.tag = "id", ring.tag = "ring" )
ReadShapefile_P00( filename = "Abies_277_h400_TreeRing_Points.shp", id.tag = "id", ring.tag = "ring" )
filename |
a shape file name of Tree ring points |
id.tag |
string, column name of id (attribute table) |
ring.tag |
string, column name of ring years (0 is cambium layer) |
numeric : x,y coordinates of a tree ring center point (P00)
.dir <- system.file("shp",package = "TreeRingShape") .file <- "Abies_277_h400_TreeRing_Points.shp" filename <- paste(.dir,.file,sep="/") ReadShapefile_P00(filename)
.dir <- system.file("shp",package = "TreeRingShape") .file <- "Abies_277_h400_TreeRing_Points.shp" filename <- paste(.dir,.file,sep="/") ReadShapefile_P00(filename)
Read a shape file of Tree Ring Points ( P : radial input and correction points)
ReadShapefile_TreeRingPoints( filename = "Abies_277_h400_TreeRing_Points.shp", id.tag = "id", ring.tag = "ring" )
ReadShapefile_TreeRingPoints( filename = "Abies_277_h400_TreeRing_Points.shp", id.tag = "id", ring.tag = "ring" )
filename |
a file name of Tree ring points (shape file ) |
id.tag |
string, column name of id (attribute table) |
ring.tag |
string, column name of ring years (0 is cambium layer) |
a data frame of TreeRingPoints (radial input and correction points)
.dir <- system.file("shp",package = "TreeRingShape") .file <- "Abies_277_h400_TreeRing_Points.shp" filename <- paste(.dir,.file,sep="/") sf.P<-sf::st_read(filename) plot(sf.P) ReadShapefile_TreeRingPoints(filename,id.tag='id',ring.tag='ring')
.dir <- system.file("shp",package = "TreeRingShape") .file <- "Abies_277_h400_TreeRing_Points.shp" filename <- paste(.dir,.file,sep="/") sf.P<-sf::st_read(filename) plot(sf.P) ReadShapefile_TreeRingPoints(filename,id.tag='id',ring.tag='ring')
Read Shapefile_TreeRings
ReadShapefile_TreeRings( filename = "Abies_277_h400_TreeRing_Representative.shp", ring.tag = "ring" )
ReadShapefile_TreeRings( filename = "Abies_277_h400_TreeRing_Representative.shp", ring.tag = "ring" )
filename |
a file name(path) of shape file written to disk. |
ring.tag |
string, column name of ring years (0 is cambium layer) |
a list of tree ring lines
.dir <- system.file("shp",package = "TreeRingShape") .file <- "Abies_277_h400_TreeRing_Representative.shp" filename <- paste(.dir,.file,sep="/") sf.L<-sf::st_read(filename) plot(sf.L) Lplot(ReadShapefile_TreeRings(filename))
.dir <- system.file("shp",package = "TreeRingShape") .file <- "Abies_277_h400_TreeRing_Representative.shp" filename <- paste(.dir,.file,sep="/") sf.L<-sf::st_read(filename) plot(sf.L) Lplot(ReadShapefile_TreeRings(filename))
Return a vector of sequence of angles between start and end angle 0 to pi -pi to 0
seq_deg(deg1, deg2, deg.by = 1)
seq_deg(deg1, deg2, deg.by = 1)
deg1 |
start angle |
deg2 |
end angle |
deg.by |
step of sequence |
vector of sequence of angles between start and end angle
seq_deg(170,-170,.5)
seq_deg(170,-170,.5)
The data set contains tree ring shape data for Abies_277_h400 sampled from Tateyama, central Japan. Its disk image and shape files can be download from https://www.sanchikanri.com/treering/Abies_277_h400.zip It's intended to demonstrate the structure and use of 'TreeRingShape' class objects within the package.
TR
TR
An object of class classTreeRingShape
of length 1.
# Access basic information about the TreeRingShape object slotNames(TR) str(TR) # Plot the tree ring shape data Lplot(TR@L)
# Access basic information about the TreeRingShape object slotNames(TR) str(TR) # Plot the tree ring shape data Lplot(TR@L)
The full data set contains tree ring shape data for Abies_277_h400 sampled from Tateyama, central Japan. Its disk image and shape files can be download from https://www.sanchikanri.com/treering/Abies_277_h400.zip
TR_
TR_
An object of class classTreeRingShape
of length 1.
# Access basic information about the TreeRingShape object TR_<-new_classTreeRingShape( P_filename='Abies_277_h400_TreeRing_Points.shp', L_filename='Abies_277_h400_TreeRing_Representative.shp', L2_filename='Abies_277_h400_TreeRing.shp', P_id.tag='id', P_ring.tag='ring', L_ring.tag='ring') slotNames(TR_) str(TR_)
# Access basic information about the TreeRingShape object TR_<-new_classTreeRingShape( P_filename='Abies_277_h400_TreeRing_Points.shp', L_filename='Abies_277_h400_TreeRing_Representative.shp', L2_filename='Abies_277_h400_TreeRing.shp', P_id.tag='id', P_ring.tag='ring', L_ring.tag='ring') slotNames(TR_) str(TR_)
Calculate tree ring index from chronosequence data (year,growth)
TreeRingIndex(ya, spar = 0.8)
TreeRingIndex(ya, spar = 0.8)
ya |
data frame of chronosequence data (year,growth) |
spar |
smoothing parameter of spline curve |
list spline ; fitting parameter of Spline curve , idx ; data.frame(year,TreeRingIndex)
Cook, E., & Peters, K. (1981). The smoothing spline, a new approach to standardising forest interior tree-ring.Trre-ring Bulletin, 41, 45–53.
Construct a object (TR) of classTreeRingShape
TreeRingShape( P_filename, L_filename, L2_filename, P_id.tag = "id", P_ring.tag = "ring", L_ring.tag = "ring" )
TreeRingShape( P_filename, L_filename, L2_filename, P_id.tag = "id", P_ring.tag = "ring", L_ring.tag = "ring" )
P_filename |
file name of shape file (P) for tree ring points (without extention) |
L_filename |
file name of shape file (L) for tree ring lines (without extention) |
L2_filename |
file name of shape file (L2) for tree ring lines interpolated (without extention) |
P_id.tag |
column name of id in shape file (P), default is 'id' |
P_ring.tag |
column name of ring no.(ordinaly year,outermost=0) in shape file (L), default is 'ring' |
L_ring.tag |
column name of ring no.(ordinaly year,outermost=0) in shape file (L), default is 'ring' |
generated new object from classTreeRingShape
test_TreeRingShape <- function(){ oldwd <- getwd() on.exit(setwd(oldwd)) setwd(system.file("shp",package = "TreeRingShape")) TR.<-TreeRingShape( P_filename='Abies_277_h400_TreeRing_Points.shp', L_filename='Abies_277_h400_TreeRing_Representative.shp', L2_filename='Abies_277_h400_TreeRing.shp', P_id.tag='id',P_ring.tag='ring', L_ring.tag='ring') slotNames(TR.) str(TR.) Lplot(TR.@L2) return(TR.) } TR. <- test_TreeRingShape() DiskInfo(TR.)
test_TreeRingShape <- function(){ oldwd <- getwd() on.exit(setwd(oldwd)) setwd(system.file("shp",package = "TreeRingShape")) TR.<-TreeRingShape( P_filename='Abies_277_h400_TreeRing_Points.shp', L_filename='Abies_277_h400_TreeRing_Representative.shp', L2_filename='Abies_277_h400_TreeRing.shp', P_id.tag='id',P_ring.tag='ring', L_ring.tag='ring') slotNames(TR.) str(TR.) Lplot(TR.@L2) return(TR.) } TR. <- test_TreeRingShape() DiskInfo(TR.)
Interpolates tree ring between representative (manual input) tree rings with tree ring points
TreeRingsInterpolation(TR)
TreeRingsInterpolation(TR)
TR |
object of classTreeRingShape (without tree ring interpolated) |
TR object of classTreeRingShape (with tree ring interpolated)
# tree ring interpolation (add TR@L2 to classTreeRingShape ) TR@L2 ### empty TR <- TreeRingsInterpolation(TR) TR@L2 ### entered ya <- plot_year_RingArea(TR@L2, 2018)$Year_TreeRingArea # Figure of relationships year and tree ring area plot(ya,type='b') tri. <- TreeRingIndex(ya) lines(tri.$spline,col='red',lw=2) # Figure of relationships year and tree ring index plot(tri.$idx,type='b') abline(h=1,col='red')
# tree ring interpolation (add TR@L2 to classTreeRingShape ) TR@L2 ### empty TR <- TreeRingsInterpolation(TR) TR@L2 ### entered ya <- plot_year_RingArea(TR@L2, 2018)$Year_TreeRingArea # Figure of relationships year and tree ring area plot(ya,type='b') tri. <- TreeRingIndex(ya) lines(tri.$spline,col='red',lw=2) # Figure of relationships year and tree ring index plot(tri.$idx,type='b') abline(h=1,col='red')
Read representative tree ring lines from shape files
TreeRingsLines(TR)
TreeRingsLines(TR)
TR |
a tree ring class (classTreeRingShape ) |
TR (TreeRing class TR@L<-L ; TR@L_<-L_ ; TR@YR_L <-YR_L ; TR@ln <- ln)
# didectory of tree ring shapefiles .dir <- system.file("shp",package = "TreeRingShape") # path of P_filename .file <- "Abies_277_h400_TreeRing_Points.shp" TR_@P_filename <- paste(.dir,.file,sep="/") TreeRingsPoints(TR_)@P # path of L_file name .file <- "Abies_277_h400_TreeRing_Representative.shp" L_filename <- paste(.dir,.file,sep="/") TreeRingsPoints(TR_)@L Lplot(TR@L)
# didectory of tree ring shapefiles .dir <- system.file("shp",package = "TreeRingShape") # path of P_filename .file <- "Abies_277_h400_TreeRing_Points.shp" TR_@P_filename <- paste(.dir,.file,sep="/") TreeRingsPoints(TR_)@P # path of L_file name .file <- "Abies_277_h400_TreeRing_Representative.shp" L_filename <- paste(.dir,.file,sep="/") TreeRingsPoints(TR_)@L Lplot(TR@L)
Read TreeRingsPoints shape file, check and save parameters
TreeRingsPoints(TR)
TreeRingsPoints(TR)
TR |
a tree ring class (classTreeRingShape ) |
a list of (P,P00,YR_P,n_id,YR_P,n_YR)
# didectory of tree ring shapefiles .dir <- system.file("shp",package = "TreeRingShape") # path of P_filename .file <- "Abies_277_h400_TreeRing_Points.shp" TR_@P_filename <- paste(.dir,.file,sep="/") TreeRingsPoints(TR_)@P
# didectory of tree ring shapefiles .dir <- system.file("shp",package = "TreeRingShape") # path of P_filename .file <- "Abies_277_h400_TreeRing_Points.shp" TR_@P_filename <- paste(.dir,.file,sep="/") TreeRingsPoints(TR_)@P
Write a shapefile of interpolated tree rings
WriteShapefile_TreeRings(L2, filename = "test.shp")
WriteShapefile_TreeRings(L2, filename = "test.shp")
L2 |
is as list of Tree ring polygons (X, Y) |
filename |
is a shape file(path) name written to disk. |
No return value, called for side effects.
#' WriteShapefile_TreeRings (TR@L, tempfile("TreeRingShape_test",fileext = ".shp")) dir(tempdir())
#' WriteShapefile_TreeRings (TR@L, tempfile("TreeRingShape_test",fileext = ".shp")) dir(tempdir())