Skip to content
Prev 19373 / 29559 Next

nndist {spatstat} distance unit output

Just to clarify - 
    
   To set the **name** of the unit of length 
    in an object in the spatstat package,
    use  'unitname<-'
    For example
                  unitname(X) <- "km"
                  unitname(X) <- c("foot", "feet")
                  unitname(X) <- list("yard", "yards", 22)
    (The last example means that one unit is equal to 22 yards).

   To **convert the coordinates** from one unit to another, use 'rescale'
   For example if the coordinates in X are recorded in metres, then
                 X <- rescale(X, 1000)
    will convert the coordinates to kilometres (i.e. it will divide the coordinate values by 1000)
    and will also adjust the name of the unit of length accordingly. 
 
Adrian    

Prof Adrian Baddeley FAA
University of Western Australia  /and/ CSIRO Mathematics, Informatics & Statistics
Mail: <cet.uwa.edu.au>             Skype: adrian.baddeley