29.01.2015 Views

Analysing spatial point patterns in R - CSIRO

Analysing spatial point patterns in R - CSIRO

Analysing spatial point patterns in R - CSIRO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

19.6 Manipulat<strong>in</strong>g and plott<strong>in</strong>g summary functions 129<br />

values of the distance argument r, while the other columns conta<strong>in</strong> different estimates of the<br />

value of the function, or the theoretical value of the function under CSR.<br />

The follow<strong>in</strong>g operations are def<strong>in</strong>ed on this class:<br />

pr<strong>in</strong>t.fv pr<strong>in</strong>t a summary description<br />

plot.fv plot the function estimates<br />

as.data.frame strip extra <strong>in</strong>formation (returns a data frame)<br />

$ extract one column (returns a numeric vector)<br />

[.fv extract subset (returns an "fv" object)<br />

with.fv perform calculations with specific columns of data frame<br />

eval.fv perform calculation on all columns of data frame<br />

cb<strong>in</strong>d.fv comb<strong>in</strong>e several "fv" objects<br />

collapse.fv comb<strong>in</strong>e several redundant "fv" objects<br />

b<strong>in</strong>d.fv comb<strong>in</strong>e an "fv" object and a data frame<br />

smooth.fv apply smooth<strong>in</strong>g to function values<br />

stieltjes compute Stieltjes <strong>in</strong>tegral with respect to function<br />

To make life easier, there are several options for manipulat<strong>in</strong>g the function values.<br />

To manipulate or comb<strong>in</strong>e one or more columns of the data frame, it is typically easiest to<br />

use the command with.fv, which is a method for the generic command with. For example:<br />

> data(redwood)<br />

> K y x L with(Kest(redwood), max(abs(iso - theo)))<br />

[1] 0.04945199<br />

To plot a transformed function, you can also use the plot method. Its second argument is<br />

a formula <strong>in</strong> the R language. The left side of the formula represents what curve or curves will<br />

be plotted on the y axis, and the right side determ<strong>in</strong>es the x variable for the plot. Thus:<br />

> plot(K, sqrt(./pi) ~ r)<br />

Copyright<strong>CSIRO</strong> 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!