Mercurial > repos > ecology > obisindicators
comparison obisindicators.r @ 1:d7b6ff32d072 draft
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/obisindicators commit d1d3e8640457c30349b842ea05de64b9312890f4
| author | ecology |
|---|---|
| date | Wed, 25 Jan 2023 16:01:52 +0000 |
| parents | 1015a0070bac |
| children |
comparison
equal
deleted
inserted
replaced
| 0:1015a0070bac | 1:d7b6ff32d072 |
|---|---|
| 30 longitude <- as.numeric(args[4]) | 30 longitude <- as.numeric(args[4]) |
| 31 latitude <- as.numeric(args[5]) | 31 latitude <- as.numeric(args[5]) |
| 32 spe <- as.numeric(args[6]) | 32 spe <- as.numeric(args[6]) |
| 33 rec <- as.numeric(args[7]) | 33 rec <- as.numeric(args[7]) |
| 34 crs <- as.numeric(args[8]) | 34 crs <- as.numeric(args[8]) |
| 35 source(args[9]) | 35 reso <- as.numeric(args[9]) |
| 36 source(args[10]) | 36 source(args[10]) |
| 37 source(args[11]) | 37 source(args[11]) |
| 38 source(args[12]) | |
| 38 } | 39 } |
| 39 | 40 |
| 40 if (hr == "false") { | 41 if (hr == "false") { |
| 41 hr <- FALSE | 42 hr <- FALSE |
| 42 }else { | 43 }else { |
| 61 colnames(occ)[rec] <- c("records") | 62 colnames(occ)[rec] <- c("records") |
| 62 | 63 |
| 63 #Create a discrete global grid | 64 #Create a discrete global grid |
| 64 #Create an ISEA discrete global grid of resolution 9 using the dggridR package: | 65 #Create an ISEA discrete global grid of resolution 9 using the dggridR package: |
| 65 | 66 |
| 66 dggs <- dggridR::dgconstruct(projection = "ISEA", topology = "HEXAGON", res = 9) | 67 dggs <- dggridR::dgconstruct(projection = "ISEA", topology = "HEXAGON", res = reso) |
| 67 | 68 |
| 68 #Then assign cell numbers to the occurrence data | 69 #Then assign cell numbers to the occurrence data |
| 69 occ$cell <- dggridR::dgGEO_to_SEQNUM(dggs, occ$decimalLongitude, occ$decimalLatitude)[["seqnum"]] | 70 occ$cell <- dggridR::dgGEO_to_SEQNUM(dggs, occ$decimalLongitude, occ$decimalLatitude)[["seqnum"]] |
| 70 | 71 |
| 71 #Calculate indicators | 72 #Calculate indicators |
