Skip to content
Prev 246723 / 398503 Next

How to export/save an "mrpp" object?

Nikos:
David W:
Right, "clearing" did the trick.
Multiresponse Permuation Procedures (MRPP) is implemented in the "vegan" 
package. The function mrpp() returns (an object of class "mrpp") something 
like:

--%<---
# check class
class ( samples_bitemporal_modis.0001.mrpp )
[1] "mrpp"

# check structure
str ( samples_bitemporal_modis.0001.mrpp )
List of 12
 $ call        : language mrpp(dat = samples_bitemporal_modis.0001[, 1:5], 
grouping = samples_bitemporal_modis.0001[["Class"]])
 $ delta       : num 0.126
 $ E.delta     : num 0.202
 $ CS          : logi NA
 $ n           : Named int [1:5] 335 307 183 188 27
  ..- attr(*, "names")= chr [1:5] "Urban" "Vegetation" "Bare ground" "Burned" 
...
 $ classdelta  : Named num [1:5] 0.1255 0.1045 0.1837 0.0981 0.1743
  ..- attr(*, "names")= chr [1:5] "Urban" "Vegetation" "Bare ground" "Burned" 
...
 $ Pvalue      : num 0.001
 $ A           : num 0.378
 $ distance    : chr "euclidean"
 $ weight.type : num 1
 $ boot.deltas : num [1:999] 0.202 0.202 0.202 0.203 0.202 ...
 $ permutations: num 999
 - attr(*, "class")= chr "mrpp"
-->%---

Now I've tried the following:

--%<---
# 1. save(d) it
save ( samples_bitemporal_modis.0001.mrpp , file="exported.mrpp.R" )

# 2. loade(d) it in a new object...
loadedmrpp <- load ( "exported.mrpp.R")

# 3. (tried) to check it...
str ( "exported.mrpp.R")

 chr "samples_bitemporal_modis.0001.mrpp"

# it did not cross my mind immediately to...
get(loadedmrpp)

Call:
mrpp(dat = samples_bitemporal_modis.0001[, 1:5], grouping = 
samples_bitemporal_modis.0001[["Class"]]) 

Dissimilarity index: euclidean 
Weights for groups:  n 

Class means and counts:

      Urban  Vegetation Bare ground Burned Water 
delta 0.1255 0.1045     0.1837      0.0981 0.1743
n     335    307        183         188    27    

Chance corrected within-group agreement A: 0.3778 
Based on observed delta 0.1258 and expected delta 0.2022 

Significance of delta: 0.001 
Based on  999  permutations

# ...or to work on a clean workspace!
-->%---

Thank you David. Cheers, Nikos