CRTsp {CRTspat}  R Documentation 
"CRTsp"
objectCRTsp
coerces data frames containing coordinates and location attributes
into objects of class "CRTsp"
or creates a new "CRTsp"
object by simulating a set of Cartesian coordinates for use as the locations in a simulated trial site
CRTsp(
x = NULL,
design = NULL,
geoscale = NULL,
locations = NULL,
kappa = NULL,
mu = NULL
)
x 
an object of class 
design 
list: an optional list containing the requirements for the power of the trial 
geoscale 
standard deviation of random displacement from each settlement cluster center (for new objects) 
locations 
number of locations in population (for new objects) 
kappa 
intensity of Poisson process of settlement cluster centers (for new objects) 
mu 
mean number of points per settlement cluster (for new objects) 
If a data frame or "CRTsp"
object is input then the output "CRTsp"
object is validated,
a description of the geography is computed and power calculations are carried out.
If geoscale, locations, kappa
and mu
are specified then a new trial dataframe is constructed
corresponding to a novel simulated human settlement pattern. This is generated using the
Thomas algorithm (rThomas
) in spatstat.random
allowing the user to defined the density of locations and degree of spatial clustering.
The resulting trial data frame comprises a set of Cartesian coordinates centred at the origin.
A list of class "CRTsp"
containing the following components:
design  list:  parameters required for power calculations 
geom_full  list:  summary statistics describing the site 
geom_core  list:  summary statistics describing the core area (when a buffer is specified) 
trial  data frame:  rows correspond to geolocated points, as follows: 
x  numeric vector: xcoordinates of locations  
y  numeric vector: ycoordinates of locations  
cluster  factor: assignments to cluster of each location  
arm  factor: assignments to "control" or "intervention" for each location 

nearestDiscord  numeric vector: Euclidean distance to nearest discordant location (km)  
buffer  logical: indicator of whether the point is within the buffer  
...  other objects included in the input "CRTsp" object or data frame 

{# Generate a simulated area with 10,000 locations
example_area = CRTsp(geoscale = 1, locations=10000, kappa=3, mu=40)
summary(example_area)
}