Skip to contents

[Deprecated] attributeTreeCoord() is deprecated. 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

Usage

attributeTreeCoord(xy, plot, dim, coordAbs)

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() or numberCorner()

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