outgearth: Generate a KML File with Marked Set of Points

Description Usage Arguments Details Author(s) References See Also Examples

Description

Produces Google Earth placemarks arranged into folders. Each folder consists of punctual records from a given group of species (i.e. a group detected by the NAM method).

Usage

1
outgearth(partition, showlabel = FALSE)

Arguments

partition

Object of class 'nampartition'.

showlabel

Logical. TRUE means that labels will be added to the placemarks.

Details

Visual properties for the entire set of records in each folder can be edited through Google Earth options. For that, do no forget to click on the share style button.

Author(s)

Daniel A. Dos Santos <dadossantos@csnat.unt.edu.ar>

References

The Homepage of Google Earth is available at: http://earth.google.com/

See Also

Function cleavogram assists us for creating objects of class nampartition.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  #This example is driven by a new idea of a sympatry network partitioning.
  #We will implement an algorithm based on the cliques found on the network and 
  #we will export the final classification into a KML file. 
  #######
  #Step 1: Infer the network of co-extensive sympatry in the Sciobius example:  
  data(sciobius2x2)
  aux <- gridinfer(dntable = sciobius2x2)
  #######
  #Step 2: Obtain the cliques
  cliques <- netproperties(aux$sm)$Cliques
  #######
  #Step 3: Perform the new alogrithm on the data frame of cliques (1/0 table of species
  #by cliques). Here, the maximum clique is selected and its members removed from the 
  #data frame. This task is repeated until no residual group can be extracted. 
  inc <- apply(cliques, 1, sum) #Number of cliques where a given species occurs
  flag <- sum(cliques)  
  i <- 1 #counter
  classes <- rep(NA, nrow(aux$sm))
  while(flag > 0){
    size <- apply(cliques, 2, sum) #Size of each clique
    clsel <- which.max(size) #Identify a single largest clique 
    members <- which(cliques[,clsel]==1)
    flag <- flag - sum(inc[members])
    inc[members] <- 0
    cliques[members,] <- 0 #Indirect way for removing species already classified
    classes[members] <- paste("Group ", i) 
    i <- i + 1
  }
  split(aux$Label, classes) #Print on R console the resulting partition
  #######
  #Step 3: Create an object of class nampartition by hand and . 
  rslt <- c()
  rslt$kind <- "grids"
  rslt$status <- cbind(Taxa = aux$Label, Status = classes)
  rslt$occupancy <- aux$occupancy
  #Next, set coordinates in function of the geographical centre for each cell used in the 
  #Sciobius' example
  rslt$coords <-  matrix(c(14, -20),  nrow = nrow(aux$coords), ncol = 2, byrow = TRUE) + 
                  matrix(c(2, -2), nrow = nrow(aux$coords), ncol = 2, byrow = TRUE)*aux$coords  
  class(rslt) <- "nampartition"
  #######
  #Step 4: Create the KML file
  ## Not run: 
  outgearth(rslt) 
  #Save and then open the file with Google Earth. 
  
## End(Not run)  
  #I think that this simple algorithm is worthy of refinement.

SyNet documentation built on May 2, 2019, 1:10 p.m.