Attribute GPS coordinates to trees
Arguments
- xy
The relative coordinates of the trees within each plot
- plot
The label of the plot (same length as the number of rows of
xy
or length of 1)- dim
The dimension of the plot (either one value if the plot is a square or a vector if a rectangle)
- coordAbs
The result of the function
cutPlot()
ornumberCorner()
Value
A data frame with two columns:
- Xproj
: The X
coordinates in the absolute coordinate system
- Yproj
: The Y
coordinates in the absolute coordinate system
Examples
# Trees relative coordinates
xy <- data.frame(x = runif(200, min = 0, max = 200), y = runif(200, min = 0, max = 200))
# cut the plot in multiple part
coord <- data.frame(X = rep(c(0, 200, 0, 200), 2), Y = rep(c(0, 0, 200, 200), 2))
coord[1:4, ] <- coord[1:4, ] + 5000
coord[5:8, ] <- coord[5:8, ] + 6000
corner <- rep(c(1, 2, 4, 3), 2)
Forestplot <- rep(c("plot1", "plot2"), each = 4)
Outcut <- cutPlot(coord, Forestplot, corner, gridsize = 100, dimX = 200, dimY = 200)
#> Warning: 'cutPlot()' has been replaced by `divide_plot()` and will be removed in the next version.
#> Please see the vignette `Spatialized trees and forest stand metrics with BIOMASS`
# Assign a plot to 200 trees
Forestplot <- rep(c("plot1", "plot2"), 100)
# attribute trees to subplots
attributeTreeCoord(xy, Forestplot, dim =100,coordAbs = Outcut)
#> Warning: 'attributeTreeCoord()' is deprecated and will be removed in the next version. The projected tree coordinates are now retrieved by the `check_plot_coord()` function
#> Please see the vignette `Spatialized trees and forest stand metrics with BIOMASS`
#> Xproj Yproj
#> 1 5004.024 5040.612
#> 2 6106.645 6060.872
#> 3 5082.551 5138.873
#> 4 6155.580 6016.514
#> 5 5015.527 5121.356
#> 6 6039.405 6177.680
#> 7 5114.933 5065.944
#> 8 6020.264 6096.299
#> 9 5158.465 5099.467
#> 10 6138.018 6108.825
#> 11 5126.354 5197.868
#> 12 6029.010 6152.983
#> 13 5137.937 5052.985
#> 14 6065.170 6158.257
#> 15 5194.667 5081.021
#> 16 6145.179 6048.164
#> 17 5120.565 5080.836
#> 18 6093.450 6109.903
#> 19 5164.520 5069.814
#> 20 6173.970 6062.262
#> 21 5018.340 5196.269
#> 22 6030.853 6039.083
#> 23 5019.657 5135.411
#> 24 6087.411 6074.602
#> 25 5084.760 5197.328
#> 26 6179.810 6190.161
#> 27 5139.655 5040.345
#> 28 6003.350 6163.093
#> 29 5181.712 5170.556
#> 30 6179.749 6105.113
#> 31 5023.763 5045.406
#> 32 6173.854 6122.827
#> 33 5103.498 5172.003
#> 34 6129.366 6118.202
#> 35 5131.481 5191.043
#> 36 6077.915 6088.752
#> 37 5155.728 5037.956
#> 38 6066.749 6023.780
#> 39 5028.881 5091.182
#> 40 6042.316 6075.868
#> 41 5128.182 5049.533
#> 42 6017.867 6124.426
#> 43 5111.313 5107.801
#> 44 6058.520 6063.612
#> 45 5154.185 5141.434
#> 46 6160.596 6032.823
#> 47 5056.706 5047.031
#> 48 6104.743 6184.084
#> 49 5085.677 5025.855
#> 50 6117.283 6059.874
#> 51 5060.168 5089.519
#> 52 6181.480 6173.845
#> 53 5184.794 5064.150
#> 54 6183.827 6024.706
#> 55 5090.813 5182.722
#> 56 6074.180 6073.301
#> 57 5085.399 5152.728
#> 58 6189.424 6003.514
#> 59 5016.562 5100.408
#> 60 6178.319 6141.866
#> 61 5041.663 5074.091
#> 62 6052.846 6104.616
#> 63 5121.294 5079.900
#> 64 6024.693 6052.376
#> 65 5113.074 5168.817
#> 66 6180.495 6027.526
#> 67 5151.581 5074.794
#> 68 6004.009 6169.118
#> 69 5121.936 5156.979
#> 70 6179.544 6167.932
#> 71 5022.809 5172.258
#> 72 6087.794 6199.489
#> 73 5026.206 5173.432
#> 74 6044.608 6012.028
#> 75 5158.864 5181.596
#> 76 6134.653 6026.168
#> 77 5070.014 5107.231
#> 78 6014.761 6100.685
#> 79 5183.751 5084.792
#> 80 6174.424 6000.674
#> 81 5113.197 5188.214
#> 82 6107.187 6142.129
#> 83 5071.601 5196.785
#> 84 6039.890 6172.282
#> 85 5147.740 5122.117
#> 86 6122.901 6096.172
#> 87 5070.654 5008.817
#> 88 6086.189 6132.855
#> 89 5174.091 5195.699
#> 90 6185.937 6040.027
#> 91 5118.276 5112.675
#> 92 6180.947 6187.691
#> 93 5197.692 5141.985
#> 94 6016.709 6060.359
#> 95 5080.534 5017.592
#> 96 6150.580 6082.330
#> 97 5019.982 5022.049
#> 98 6022.498 6004.338
#> 99 5124.318 5159.125
#> 100 6020.023 6106.865
#> 101 5065.401 5137.763
#> 102 6196.907 6109.905
#> 103 5108.154 5194.123
#> 104 6199.260 6037.800
#> 105 5128.538 5124.671
#> 106 6153.411 6004.794
#> 107 5113.339 5150.426
#> 108 6133.258 6092.237
#> 109 5030.443 5007.412
#> 110 6092.011 6027.382
#> 111 5027.313 5156.649
#> 112 6017.239 6157.920
#> 113 5020.803 5129.899
#> 114 6140.670 6096.036
#> 115 5084.532 5042.776
#> 116 6157.695 6186.153
#> 117 5073.971 5071.387
#> 118 6176.024 6091.612
#> 119 5159.437 5187.249
#> 120 6078.725 6056.643
#> 121 5121.963 5087.991
#> 122 6057.897 6164.026
#> 123 5105.919 5173.174
#> 124 6168.303 6144.012
#> 125 5153.163 5054.710
#> 126 6037.706 6138.035
#> 127 5167.521 5102.153
#> 128 6127.009 6171.452
#> 129 5131.913 5192.977
#> 130 6172.370 6186.470
#> 131 5169.645 5100.354
#> 132 6013.171 6033.997
#> 133 5019.181 5070.975
#> 134 6185.000 6066.213
#> 135 5075.416 5084.909
#> 136 6012.820 6032.873
#> 137 5018.950 5053.169
#> 138 6168.044 6090.653
#> 139 5190.995 5072.946
#> 140 6192.304 6133.736
#> 141 5124.997 5029.613
#> 142 6007.143 6109.656
#> 143 5131.724 5036.488
#> 144 6002.990 6001.507
#> 145 5094.275 5014.560
#> 146 6146.762 6138.600
#> 147 5071.194 5195.109
#> 148 6026.884 6037.334
#> 149 5090.179 5120.338
#> 150 6008.675 6044.365
#> 151 5082.159 5133.183
#> 152 6106.716 6035.862
#> 153 5167.925 5140.411
#> 154 6057.013 6002.164
#> 155 5060.940 5111.402
#> 156 6139.592 6186.633
#> 157 5176.981 5072.097
#> 158 6166.932 6187.152
#> 159 5151.638 5165.374
#> 160 6079.662 6045.754
#> 161 5051.275 5177.501
#> 162 6170.958 6116.920
#> 163 5126.755 5143.727
#> 164 6085.147 6034.320
#> 165 5188.294 5163.040
#> 166 6002.547 6133.206
#> 167 5160.786 5154.684
#> 168 6138.333 6127.756
#> 169 5083.115 5191.990
#> 170 6164.356 6111.548
#> 171 5080.623 5019.661
#> 172 6070.548 6116.773
#> 173 5125.007 5001.894
#> 174 6063.554 6168.687
#> 175 5160.114 5131.921
#> 176 6096.885 6106.561
#> 177 5054.341 5040.364
#> 178 6128.836 6188.745
#> 179 5152.038 5080.583
#> 180 6042.467 6011.623
#> 181 5110.991 5042.171
#> 182 6136.168 6177.581
#> 183 5112.976 5022.478
#> 184 6049.388 6129.331
#> 185 5082.340 5187.601
#> 186 6087.498 6061.079
#> 187 5004.952 5008.835
#> 188 6135.719 6179.018
#> 189 5037.872 5151.306
#> 190 6095.403 6095.633
#> 191 5096.361 5096.927
#> 192 6132.549 6084.518
#> 193 5183.739 5196.865
#> 194 6142.663 6198.113
#> 195 5140.577 5166.549
#> 196 6086.291 6023.114
#> 197 5136.350 5060.084
#> 198 6014.519 6116.742
#> 199 5088.946 5131.931
#> 200 6135.197 6185.601