“Daniel Felipe Malagon Vega - 1193096924”

set.seed(1193096924)
sec_lat <- seq(from=-73.30, to=-73.25, by=0.001)
sec_long <- seq(from=5.54, to=5.58, by=0.001)
Latitud <- sample(sec_lat, size = 100, replace= TRUE)
longitud <- sample(sec_long, size = 100, replace= TRUE)
posicion <- data.frame(x= longitud, y= Latitud)
plot(posicion$x,posicion$y)

Ind_humedad_suelo = sort.int(runif(100, 0.7, 0.95), partial = 10)
Ind_vegetacion_diferencia_normalizado = sort.int(rnorm(100, 0.45, 0.06), partial = 10)
Temp_superfi_suelo = sort.int(26*rbeta(100, shape1 = 0.87,shape2 = 0.91), partial = 10)
presencia_ausencia_cultivos = factor(ifelse(rgamma(n=100, rate = 0.8, shape = 0.5)<0.5,0,1))
tabla_1 =data.frame(posicion,Ind_humedad_suelo,Ind_vegetacion_diferencia_normalizado,Temp_superfi_suelo,presencia_ausencia_cultivos)
tabla_1
##         x       y Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado
## 1   5.575 -73.268         0.7026732                             0.2991360
## 2   5.543 -73.286         0.7087010                             0.3340606
## 3   5.576 -73.298         0.7017520                             0.3393141
## 4   5.543 -73.251         0.7059049                             0.3171926
## 5   5.554 -73.251         0.7054854                             0.3358501
## 6   5.543 -73.297         0.7110817                             0.3477945
## 7   5.550 -73.254         0.7012688                             0.3411699
## 8   5.553 -73.273         0.7137616                             0.3492701
## 9   5.573 -73.275         0.7105483                             0.3567919
## 10  5.570 -73.273         0.7202223                             0.3568015
## 11  5.573 -73.250         0.7362153                             0.3597202
## 12  5.574 -73.296         0.7339790                             0.3628262
## 13  5.566 -73.291         0.7514377                             0.3682714
## 14  5.572 -73.272         0.7421811                             0.3708850
## 15  5.555 -73.281         0.7331554                             0.3798633
## 16  5.574 -73.253         0.7533281                             0.3912434
## 17  5.567 -73.286         0.7247215                             0.3827131
## 18  5.559 -73.261         0.7534498                             0.3803317
## 19  5.572 -73.256         0.7391675                             0.3810648
## 20  5.558 -73.277         0.7543980                             0.3843086
## 21  5.547 -73.279         0.7384275                             0.3969765
## 22  5.564 -73.283         0.7441869                             0.3798142
## 23  5.550 -73.258         0.7450494                             0.3984910
## 24  5.541 -73.299         0.7289576                             0.3815276
## 25  5.561 -73.272         0.8490427                             0.3947378
## 26  5.559 -73.278         0.7920595                             0.3892577
## 27  5.547 -73.261         0.8112685                             0.4383685
## 28  5.578 -73.265         0.9007474                             0.4340920
## 29  5.556 -73.264         0.8018667                             0.4123739
## 30  5.556 -73.273         0.7688961                             0.4330543
## 31  5.546 -73.254         0.8283577                             0.4101861
## 32  5.580 -73.283         0.8841883                             0.4334208
## 33  5.547 -73.263         0.7878809                             0.4000654
## 34  5.540 -73.270         0.8434585                             0.4359619
## 35  5.577 -73.275         0.8067768                             0.4461145
## 36  5.554 -73.269         0.8149295                             0.4334073
## 37  5.563 -73.266         0.8509928                             0.4098335
## 38  5.541 -73.270         0.8659456                             0.4243419
## 39  5.564 -73.273         0.7641143                             0.4043342
## 40  5.565 -73.261         0.8645853                             0.4491995
## 41  5.540 -73.263         0.7952560                             0.3998971
## 42  5.560 -73.253         0.7632455                             0.4302931
## 43  5.552 -73.300         0.8488116                             0.4472068
## 44  5.553 -73.254         0.7643642                             0.4267996
## 45  5.552 -73.272         0.7853386                             0.4306879
## 46  5.544 -73.253         0.8893194                             0.4438585
## 47  5.574 -73.297         0.7879383                             0.4515931
## 48  5.541 -73.288         0.7777631                             0.4295091
## 49  5.572 -73.262         0.7788205                             0.4156109
## 50  5.568 -73.271         0.7664077                             0.4343663
## 51  5.540 -73.299         0.7724759                             0.4395660
## 52  5.562 -73.300         0.8091705                             0.4244798
## 53  5.547 -73.284         0.9099795                             0.4376342
## 54  5.544 -73.273         0.7694987                             0.3986369
## 55  5.576 -73.266         0.8670346                             0.4312013
## 56  5.576 -73.254         0.7985044                             0.4420126
## 57  5.564 -73.300         0.9086912                             0.4478757
## 58  5.559 -73.264         0.7963039                             0.4312391
## 59  5.566 -73.297         0.7898150                             0.4336521
## 60  5.574 -73.281         0.8469558                             0.4648882
## 61  5.543 -73.255         0.8500429                             0.4539320
## 62  5.540 -73.299         0.7604993                             0.4701093
## 63  5.544 -73.251         0.8631985                             0.4692793
## 64  5.579 -73.298         0.8494692                             0.4604512
## 65  5.542 -73.287         0.7554524                             0.4617572
## 66  5.578 -73.275         0.7878699                             0.4549603
## 67  5.547 -73.255         0.7833852                             0.4646405
## 68  5.553 -73.264         0.8258192                             0.4623018
## 69  5.546 -73.285         0.8345510                             0.4681131
## 70  5.578 -73.271         0.7957878                             0.4703274
## 71  5.579 -73.252         0.7781054                             0.4518307
## 72  5.540 -73.250         0.7719382                             0.4602901
## 73  5.544 -73.268         0.8377899                             0.4532498
## 74  5.557 -73.297         0.7873545                             0.4911202
## 75  5.553 -73.297         0.8652038                             0.4718040
## 76  5.564 -73.264         0.7767990                             0.4799779
## 77  5.562 -73.263         0.8730995                             0.4866341
## 78  5.576 -73.290         0.8187260                             0.4876494
## 79  5.563 -73.290         0.7910377                             0.4780392
## 80  5.576 -73.283         0.7900116                             0.4958211
## 81  5.556 -73.298         0.8965371                             0.4933919
## 82  5.547 -73.272         0.8196465                             0.4948647
## 83  5.571 -73.276         0.7653513                             0.4766855
## 84  5.573 -73.268         0.8840478                             0.4799968
## 85  5.572 -73.260         0.8573880                             0.4712669
## 86  5.546 -73.280         0.8380801                             0.4814654
## 87  5.569 -73.272         0.8778693                             0.4719824
## 88  5.559 -73.257         0.8995971                             0.4720583
## 89  5.556 -73.283         0.8584176                             0.5345085
## 90  5.548 -73.286         0.8435062                             0.5050466
## 91  5.557 -73.270         0.7752904                             0.5432064
## 92  5.578 -73.265         0.9260580                             0.5398717
## 93  5.580 -73.278         0.9246158                             0.5247375
## 94  5.560 -73.263         0.9193302                             0.5331479
## 95  5.558 -73.254         0.9314929                             0.5802553
## 96  5.561 -73.273         0.9362472                             0.5228870
## 97  5.553 -73.253         0.9364005                             0.5173503
## 98  5.555 -73.266         0.9243760                             0.5377988
## 99  5.576 -73.263         0.9188795                             0.5019796
## 100 5.549 -73.264         0.9406476                             0.5304693
##     Temp_superfi_suelo presencia_ausencia_cultivos
## 1          0.826539827                           1
## 2          0.017394917                           1
## 3          0.351011699                           1
## 4          0.336168445                           0
## 5          0.193621764                           0
## 6          0.215849049                           0
## 7          0.584549947                           0
## 8          1.483054908                           1
## 9          0.006872773                           0
## 10         1.753836488                           0
## 11         2.843300949                           1
## 12         2.582178248                           1
## 13         2.852630476                           1
## 14         3.500861115                           0
## 15         2.814266943                           0
## 16         3.686865468                           0
## 17         3.618736131                           0
## 18         6.239539182                           0
## 19        25.520887833                           0
## 20        12.817117273                           1
## 21        18.230129061                           0
## 22        14.646657127                           1
## 23        11.681789665                           1
## 24        16.442318327                           0
## 25         4.757313609                           1
## 26        24.769329095                           1
## 27        11.302171311                           1
## 28        23.196069515                           0
## 29         5.470260922                           1
## 30        15.210452393                           1
## 31         9.281275270                           0
## 32        25.000765169                           0
## 33        16.993937823                           0
## 34         5.103845254                           0
## 35        15.090956978                           1
## 36        14.640395270                           0
## 37        10.127788157                           0
## 38         8.422640488                           0
## 39        11.886389973                           0
## 40        25.816393158                           1
## 41         8.710845223                           0
## 42        19.093821499                           0
## 43        20.871494635                           1
## 44         7.044146645                           0
## 45        15.033394136                           0
## 46        11.508236091                           1
## 47        22.598347709                           0
## 48         7.023766152                           0
## 49         7.915431207                           1
## 50        24.771317373                           0
## 51        15.766005895                           0
## 52         3.756143586                           0
## 53         4.889933105                           1
## 54        16.918064667                           0
## 55         8.333239533                           0
## 56        21.396693401                           0
## 57        10.205550911                           1
## 58        20.389451853                           1
## 59        18.368361255                           0
## 60        17.663204696                           1
## 61         9.416196640                           1
## 62        13.560064282                           1
## 63        21.746179395                           0
## 64         8.552850345                           0
## 65         3.849805406                           0
## 66        13.635003214                           0
## 67         8.335741235                           1
## 68         7.195944292                           0
## 69        10.624148205                           1
## 70        24.112370528                           0
## 71        25.053117412                           0
## 72        13.816253932                           1
## 73        12.877793376                           1
## 74        24.589545862                           1
## 75        22.807899692                           0
## 76        24.889900947                           1
## 77        22.425090742                           0
## 78        25.807794689                           0
## 79        15.640323852                           0
## 80         5.974928398                           0
## 81        19.246478485                           1
## 82        10.038566094                           1
## 83        20.299743510                           0
## 84         6.598101036                           0
## 85        13.864498408                           1
## 86        17.126823814                           0
## 87        24.069060162                           0
## 88        19.653361010                           0
## 89         8.625337943                           1
## 90        12.271206713                           0
## 91        13.201976116                           0
## 92        11.330843968                           0
## 93        11.824962656                           0
## 94        10.541765847                           0
## 95         8.252502616                           0
## 96        12.119605010                           0
## 97         4.921196095                           0
## 98        17.817380758                           0
## 99        24.119785104                           1
## 100       12.039486496                           1
library(spatstat)
## Warning: package 'spatstat' was built under R version 4.1.2
## Loading required package: spatstat.data
## Warning: package 'spatstat.data' was built under R version 4.1.2
## Loading required package: spatstat.geom
## Warning: package 'spatstat.geom' was built under R version 4.1.2
## spatstat.geom 2.3-0
## Loading required package: spatstat.core
## Warning: package 'spatstat.core' was built under R version 4.1.2
## Loading required package: nlme
## Loading required package: rpart
## spatstat.core 2.3-1
## Loading required package: spatstat.linnet
## Warning: package 'spatstat.linnet' was built under R version 4.1.2
## spatstat.linnet 2.3-0
## 
## spatstat 2.2-0       (nickname: 'That's not important right now') 
## For an introduction to spatstat, type 'beginner'
datos_posicion = ppp(posicion$x, posicion$y, xrange=c(min(posicion$x), max(posicion$x)), yrange=c(min(posicion$y), max(posicion$y)))
## Warning: data contain duplicated points
any(duplicated(datos_posicion))
## [1] TRUE
y <- unique(datos_posicion)
plot(y)

datos_posicion_2 = ppp(posicion$x, posicion$y, xrange=c(min(posicion$x), max(posicion$x)), yrange=c(min(posicion$y), max(posicion$y)), marks = tabla_1[,6])
## Warning: data contain duplicated points
any(duplicated(datos_posicion_2))
## [1] TRUE
Y_1 <- unique(datos_posicion_2)
plot(Y_1)

datos_posicion_3 = ppp(posicion$x, posicion$y, xrange=c(min(posicion$x), max(posicion$x)), yrange=c(min(posicion$y), max(posicion$y)), marks = tabla_1[,4])
any(duplicated(datos_posicion_3))
## [1] FALSE
Y_2 <- unique(datos_posicion_3)
plot(Y_2, size =0.002)

datos_posicion_4 = ppp(posicion$x, posicion$y, xrange=c(min(posicion$x), max(posicion$x)), yrange=c(min(posicion$y), max(posicion$y)), marks = tabla_1[,c(3:6)] )
y_3 <- unique(datos_posicion_4)
marks(y_3)
##     Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado Temp_superfi_suelo
## 1           0.7026732                             0.2991360        0.826539827
## 2           0.7087010                             0.3340606        0.017394917
## 3           0.7017520                             0.3393141        0.351011699
## 4           0.7059049                             0.3171926        0.336168445
## 5           0.7054854                             0.3358501        0.193621764
## 6           0.7110817                             0.3477945        0.215849049
## 7           0.7012688                             0.3411699        0.584549947
## 8           0.7137616                             0.3492701        1.483054908
## 9           0.7105483                             0.3567919        0.006872773
## 10          0.7202223                             0.3568015        1.753836488
## 11          0.7362153                             0.3597202        2.843300949
## 12          0.7339790                             0.3628262        2.582178248
## 13          0.7514377                             0.3682714        2.852630476
## 14          0.7421811                             0.3708850        3.500861115
## 15          0.7331554                             0.3798633        2.814266943
## 16          0.7533281                             0.3912434        3.686865468
## 17          0.7247215                             0.3827131        3.618736131
## 18          0.7534498                             0.3803317        6.239539182
## 19          0.7391675                             0.3810648       25.520887833
## 20          0.7543980                             0.3843086       12.817117273
## 21          0.7384275                             0.3969765       18.230129061
## 22          0.7441869                             0.3798142       14.646657127
## 23          0.7450494                             0.3984910       11.681789665
## 24          0.7289576                             0.3815276       16.442318327
## 25          0.8490427                             0.3947378        4.757313609
## 26          0.7920595                             0.3892577       24.769329095
## 27          0.8112685                             0.4383685       11.302171311
## 28          0.9007474                             0.4340920       23.196069515
## 29          0.8018667                             0.4123739        5.470260922
## 30          0.7688961                             0.4330543       15.210452393
## 31          0.8283577                             0.4101861        9.281275270
## 32          0.8841883                             0.4334208       25.000765169
## 33          0.7878809                             0.4000654       16.993937823
## 34          0.8434585                             0.4359619        5.103845254
## 35          0.8067768                             0.4461145       15.090956978
## 36          0.8149295                             0.4334073       14.640395270
## 37          0.8509928                             0.4098335       10.127788157
## 38          0.8659456                             0.4243419        8.422640488
## 39          0.7641143                             0.4043342       11.886389973
## 40          0.8645853                             0.4491995       25.816393158
## 41          0.7952560                             0.3998971        8.710845223
## 42          0.7632455                             0.4302931       19.093821499
## 43          0.8488116                             0.4472068       20.871494635
## 44          0.7643642                             0.4267996        7.044146645
## 45          0.7853386                             0.4306879       15.033394136
## 46          0.8893194                             0.4438585       11.508236091
## 47          0.7879383                             0.4515931       22.598347709
## 48          0.7777631                             0.4295091        7.023766152
## 49          0.7788205                             0.4156109        7.915431207
## 50          0.7664077                             0.4343663       24.771317373
## 51          0.7724759                             0.4395660       15.766005895
## 52          0.8091705                             0.4244798        3.756143586
## 53          0.9099795                             0.4376342        4.889933105
## 54          0.7694987                             0.3986369       16.918064667
## 55          0.8670346                             0.4312013        8.333239533
## 56          0.7985044                             0.4420126       21.396693401
## 57          0.9086912                             0.4478757       10.205550911
## 58          0.7963039                             0.4312391       20.389451853
## 59          0.7898150                             0.4336521       18.368361255
## 60          0.8469558                             0.4648882       17.663204696
## 61          0.8500429                             0.4539320        9.416196640
## 62          0.7604993                             0.4701093       13.560064282
## 63          0.8631985                             0.4692793       21.746179395
## 64          0.8494692                             0.4604512        8.552850345
## 65          0.7554524                             0.4617572        3.849805406
## 66          0.7878699                             0.4549603       13.635003214
## 67          0.7833852                             0.4646405        8.335741235
## 68          0.8258192                             0.4623018        7.195944292
## 69          0.8345510                             0.4681131       10.624148205
## 70          0.7957878                             0.4703274       24.112370528
## 71          0.7781054                             0.4518307       25.053117412
## 72          0.7719382                             0.4602901       13.816253932
## 73          0.8377899                             0.4532498       12.877793376
## 74          0.7873545                             0.4911202       24.589545862
## 75          0.8652038                             0.4718040       22.807899692
## 76          0.7767990                             0.4799779       24.889900947
## 77          0.8730995                             0.4866341       22.425090742
## 78          0.8187260                             0.4876494       25.807794689
## 79          0.7910377                             0.4780392       15.640323852
## 80          0.7900116                             0.4958211        5.974928398
## 81          0.8965371                             0.4933919       19.246478485
## 82          0.8196465                             0.4948647       10.038566094
## 83          0.7653513                             0.4766855       20.299743510
## 84          0.8840478                             0.4799968        6.598101036
## 85          0.8573880                             0.4712669       13.864498408
## 86          0.8380801                             0.4814654       17.126823814
## 87          0.8778693                             0.4719824       24.069060162
## 88          0.8995971                             0.4720583       19.653361010
## 89          0.8584176                             0.5345085        8.625337943
## 90          0.8435062                             0.5050466       12.271206713
## 91          0.7752904                             0.5432064       13.201976116
## 92          0.9260580                             0.5398717       11.330843968
## 93          0.9246158                             0.5247375       11.824962656
## 94          0.9193302                             0.5331479       10.541765847
## 95          0.9314929                             0.5802553        8.252502616
## 96          0.9362472                             0.5228870       12.119605010
## 97          0.9364005                             0.5173503        4.921196095
## 98          0.9243760                             0.5377988       17.817380758
## 99          0.9188795                             0.5019796       24.119785104
## 100         0.9406476                             0.5304693       12.039486496
##     presencia_ausencia_cultivos
## 1                             1
## 2                             1
## 3                             1
## 4                             0
## 5                             0
## 6                             0
## 7                             0
## 8                             1
## 9                             0
## 10                            0
## 11                            1
## 12                            1
## 13                            1
## 14                            0
## 15                            0
## 16                            0
## 17                            0
## 18                            0
## 19                            0
## 20                            1
## 21                            0
## 22                            1
## 23                            1
## 24                            0
## 25                            1
## 26                            1
## 27                            1
## 28                            0
## 29                            1
## 30                            1
## 31                            0
## 32                            0
## 33                            0
## 34                            0
## 35                            1
## 36                            0
## 37                            0
## 38                            0
## 39                            0
## 40                            1
## 41                            0
## 42                            0
## 43                            1
## 44                            0
## 45                            0
## 46                            1
## 47                            0
## 48                            0
## 49                            1
## 50                            0
## 51                            0
## 52                            0
## 53                            1
## 54                            0
## 55                            0
## 56                            0
## 57                            1
## 58                            1
## 59                            0
## 60                            1
## 61                            1
## 62                            1
## 63                            0
## 64                            0
## 65                            0
## 66                            0
## 67                            1
## 68                            0
## 69                            1
## 70                            0
## 71                            0
## 72                            1
## 73                            1
## 74                            1
## 75                            0
## 76                            1
## 77                            0
## 78                            0
## 79                            0
## 80                            0
## 81                            1
## 82                            1
## 83                            0
## 84                            0
## 85                            1
## 86                            0
## 87                            0
## 88                            0
## 89                            1
## 90                            0
## 91                            0
## 92                            0
## 93                            0
## 94                            0
## 95                            0
## 96                            0
## 97                            0
## 98                            0
## 99                            1
## 100                           1
plot(y_3, which.marks ="presencia_ausencia_cultivos", size= 0.5)

plot(y_3, which.marks = "Ind_vegetacion_diferencia_normalizado", size= 0.0009)

marks(y_3)
##     Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado Temp_superfi_suelo
## 1           0.7026732                             0.2991360        0.826539827
## 2           0.7087010                             0.3340606        0.017394917
## 3           0.7017520                             0.3393141        0.351011699
## 4           0.7059049                             0.3171926        0.336168445
## 5           0.7054854                             0.3358501        0.193621764
## 6           0.7110817                             0.3477945        0.215849049
## 7           0.7012688                             0.3411699        0.584549947
## 8           0.7137616                             0.3492701        1.483054908
## 9           0.7105483                             0.3567919        0.006872773
## 10          0.7202223                             0.3568015        1.753836488
## 11          0.7362153                             0.3597202        2.843300949
## 12          0.7339790                             0.3628262        2.582178248
## 13          0.7514377                             0.3682714        2.852630476
## 14          0.7421811                             0.3708850        3.500861115
## 15          0.7331554                             0.3798633        2.814266943
## 16          0.7533281                             0.3912434        3.686865468
## 17          0.7247215                             0.3827131        3.618736131
## 18          0.7534498                             0.3803317        6.239539182
## 19          0.7391675                             0.3810648       25.520887833
## 20          0.7543980                             0.3843086       12.817117273
## 21          0.7384275                             0.3969765       18.230129061
## 22          0.7441869                             0.3798142       14.646657127
## 23          0.7450494                             0.3984910       11.681789665
## 24          0.7289576                             0.3815276       16.442318327
## 25          0.8490427                             0.3947378        4.757313609
## 26          0.7920595                             0.3892577       24.769329095
## 27          0.8112685                             0.4383685       11.302171311
## 28          0.9007474                             0.4340920       23.196069515
## 29          0.8018667                             0.4123739        5.470260922
## 30          0.7688961                             0.4330543       15.210452393
## 31          0.8283577                             0.4101861        9.281275270
## 32          0.8841883                             0.4334208       25.000765169
## 33          0.7878809                             0.4000654       16.993937823
## 34          0.8434585                             0.4359619        5.103845254
## 35          0.8067768                             0.4461145       15.090956978
## 36          0.8149295                             0.4334073       14.640395270
## 37          0.8509928                             0.4098335       10.127788157
## 38          0.8659456                             0.4243419        8.422640488
## 39          0.7641143                             0.4043342       11.886389973
## 40          0.8645853                             0.4491995       25.816393158
## 41          0.7952560                             0.3998971        8.710845223
## 42          0.7632455                             0.4302931       19.093821499
## 43          0.8488116                             0.4472068       20.871494635
## 44          0.7643642                             0.4267996        7.044146645
## 45          0.7853386                             0.4306879       15.033394136
## 46          0.8893194                             0.4438585       11.508236091
## 47          0.7879383                             0.4515931       22.598347709
## 48          0.7777631                             0.4295091        7.023766152
## 49          0.7788205                             0.4156109        7.915431207
## 50          0.7664077                             0.4343663       24.771317373
## 51          0.7724759                             0.4395660       15.766005895
## 52          0.8091705                             0.4244798        3.756143586
## 53          0.9099795                             0.4376342        4.889933105
## 54          0.7694987                             0.3986369       16.918064667
## 55          0.8670346                             0.4312013        8.333239533
## 56          0.7985044                             0.4420126       21.396693401
## 57          0.9086912                             0.4478757       10.205550911
## 58          0.7963039                             0.4312391       20.389451853
## 59          0.7898150                             0.4336521       18.368361255
## 60          0.8469558                             0.4648882       17.663204696
## 61          0.8500429                             0.4539320        9.416196640
## 62          0.7604993                             0.4701093       13.560064282
## 63          0.8631985                             0.4692793       21.746179395
## 64          0.8494692                             0.4604512        8.552850345
## 65          0.7554524                             0.4617572        3.849805406
## 66          0.7878699                             0.4549603       13.635003214
## 67          0.7833852                             0.4646405        8.335741235
## 68          0.8258192                             0.4623018        7.195944292
## 69          0.8345510                             0.4681131       10.624148205
## 70          0.7957878                             0.4703274       24.112370528
## 71          0.7781054                             0.4518307       25.053117412
## 72          0.7719382                             0.4602901       13.816253932
## 73          0.8377899                             0.4532498       12.877793376
## 74          0.7873545                             0.4911202       24.589545862
## 75          0.8652038                             0.4718040       22.807899692
## 76          0.7767990                             0.4799779       24.889900947
## 77          0.8730995                             0.4866341       22.425090742
## 78          0.8187260                             0.4876494       25.807794689
## 79          0.7910377                             0.4780392       15.640323852
## 80          0.7900116                             0.4958211        5.974928398
## 81          0.8965371                             0.4933919       19.246478485
## 82          0.8196465                             0.4948647       10.038566094
## 83          0.7653513                             0.4766855       20.299743510
## 84          0.8840478                             0.4799968        6.598101036
## 85          0.8573880                             0.4712669       13.864498408
## 86          0.8380801                             0.4814654       17.126823814
## 87          0.8778693                             0.4719824       24.069060162
## 88          0.8995971                             0.4720583       19.653361010
## 89          0.8584176                             0.5345085        8.625337943
## 90          0.8435062                             0.5050466       12.271206713
## 91          0.7752904                             0.5432064       13.201976116
## 92          0.9260580                             0.5398717       11.330843968
## 93          0.9246158                             0.5247375       11.824962656
## 94          0.9193302                             0.5331479       10.541765847
## 95          0.9314929                             0.5802553        8.252502616
## 96          0.9362472                             0.5228870       12.119605010
## 97          0.9364005                             0.5173503        4.921196095
## 98          0.9243760                             0.5377988       17.817380758
## 99          0.9188795                             0.5019796       24.119785104
## 100         0.9406476                             0.5304693       12.039486496
##     presencia_ausencia_cultivos
## 1                             1
## 2                             1
## 3                             1
## 4                             0
## 5                             0
## 6                             0
## 7                             0
## 8                             1
## 9                             0
## 10                            0
## 11                            1
## 12                            1
## 13                            1
## 14                            0
## 15                            0
## 16                            0
## 17                            0
## 18                            0
## 19                            0
## 20                            1
## 21                            0
## 22                            1
## 23                            1
## 24                            0
## 25                            1
## 26                            1
## 27                            1
## 28                            0
## 29                            1
## 30                            1
## 31                            0
## 32                            0
## 33                            0
## 34                            0
## 35                            1
## 36                            0
## 37                            0
## 38                            0
## 39                            0
## 40                            1
## 41                            0
## 42                            0
## 43                            1
## 44                            0
## 45                            0
## 46                            1
## 47                            0
## 48                            0
## 49                            1
## 50                            0
## 51                            0
## 52                            0
## 53                            1
## 54                            0
## 55                            0
## 56                            0
## 57                            1
## 58                            1
## 59                            0
## 60                            1
## 61                            1
## 62                            1
## 63                            0
## 64                            0
## 65                            0
## 66                            0
## 67                            1
## 68                            0
## 69                            1
## 70                            0
## 71                            0
## 72                            1
## 73                            1
## 74                            1
## 75                            0
## 76                            1
## 77                            0
## 78                            0
## 79                            0
## 80                            0
## 81                            1
## 82                            1
## 83                            0
## 84                            0
## 85                            1
## 86                            0
## 87                            0
## 88                            0
## 89                            1
## 90                            0
## 91                            0
## 92                            0
## 93                            0
## 94                            0
## 95                            0
## 96                            0
## 97                            0
## 98                            0
## 99                            1
## 100                           1
datos_posicion_5 = ppp(posicion$x, posicion$y, xrange=c(min(posicion$x), max(posicion$x)), yrange=c(min(posicion$y), max(posicion$y)), marks= tabla_1[, c(3:6)])
Y_5 <- unique (datos_posicion_5)
marks(Y_5)
##     Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado Temp_superfi_suelo
## 1           0.7026732                             0.2991360        0.826539827
## 2           0.7087010                             0.3340606        0.017394917
## 3           0.7017520                             0.3393141        0.351011699
## 4           0.7059049                             0.3171926        0.336168445
## 5           0.7054854                             0.3358501        0.193621764
## 6           0.7110817                             0.3477945        0.215849049
## 7           0.7012688                             0.3411699        0.584549947
## 8           0.7137616                             0.3492701        1.483054908
## 9           0.7105483                             0.3567919        0.006872773
## 10          0.7202223                             0.3568015        1.753836488
## 11          0.7362153                             0.3597202        2.843300949
## 12          0.7339790                             0.3628262        2.582178248
## 13          0.7514377                             0.3682714        2.852630476
## 14          0.7421811                             0.3708850        3.500861115
## 15          0.7331554                             0.3798633        2.814266943
## 16          0.7533281                             0.3912434        3.686865468
## 17          0.7247215                             0.3827131        3.618736131
## 18          0.7534498                             0.3803317        6.239539182
## 19          0.7391675                             0.3810648       25.520887833
## 20          0.7543980                             0.3843086       12.817117273
## 21          0.7384275                             0.3969765       18.230129061
## 22          0.7441869                             0.3798142       14.646657127
## 23          0.7450494                             0.3984910       11.681789665
## 24          0.7289576                             0.3815276       16.442318327
## 25          0.8490427                             0.3947378        4.757313609
## 26          0.7920595                             0.3892577       24.769329095
## 27          0.8112685                             0.4383685       11.302171311
## 28          0.9007474                             0.4340920       23.196069515
## 29          0.8018667                             0.4123739        5.470260922
## 30          0.7688961                             0.4330543       15.210452393
## 31          0.8283577                             0.4101861        9.281275270
## 32          0.8841883                             0.4334208       25.000765169
## 33          0.7878809                             0.4000654       16.993937823
## 34          0.8434585                             0.4359619        5.103845254
## 35          0.8067768                             0.4461145       15.090956978
## 36          0.8149295                             0.4334073       14.640395270
## 37          0.8509928                             0.4098335       10.127788157
## 38          0.8659456                             0.4243419        8.422640488
## 39          0.7641143                             0.4043342       11.886389973
## 40          0.8645853                             0.4491995       25.816393158
## 41          0.7952560                             0.3998971        8.710845223
## 42          0.7632455                             0.4302931       19.093821499
## 43          0.8488116                             0.4472068       20.871494635
## 44          0.7643642                             0.4267996        7.044146645
## 45          0.7853386                             0.4306879       15.033394136
## 46          0.8893194                             0.4438585       11.508236091
## 47          0.7879383                             0.4515931       22.598347709
## 48          0.7777631                             0.4295091        7.023766152
## 49          0.7788205                             0.4156109        7.915431207
## 50          0.7664077                             0.4343663       24.771317373
## 51          0.7724759                             0.4395660       15.766005895
## 52          0.8091705                             0.4244798        3.756143586
## 53          0.9099795                             0.4376342        4.889933105
## 54          0.7694987                             0.3986369       16.918064667
## 55          0.8670346                             0.4312013        8.333239533
## 56          0.7985044                             0.4420126       21.396693401
## 57          0.9086912                             0.4478757       10.205550911
## 58          0.7963039                             0.4312391       20.389451853
## 59          0.7898150                             0.4336521       18.368361255
## 60          0.8469558                             0.4648882       17.663204696
## 61          0.8500429                             0.4539320        9.416196640
## 62          0.7604993                             0.4701093       13.560064282
## 63          0.8631985                             0.4692793       21.746179395
## 64          0.8494692                             0.4604512        8.552850345
## 65          0.7554524                             0.4617572        3.849805406
## 66          0.7878699                             0.4549603       13.635003214
## 67          0.7833852                             0.4646405        8.335741235
## 68          0.8258192                             0.4623018        7.195944292
## 69          0.8345510                             0.4681131       10.624148205
## 70          0.7957878                             0.4703274       24.112370528
## 71          0.7781054                             0.4518307       25.053117412
## 72          0.7719382                             0.4602901       13.816253932
## 73          0.8377899                             0.4532498       12.877793376
## 74          0.7873545                             0.4911202       24.589545862
## 75          0.8652038                             0.4718040       22.807899692
## 76          0.7767990                             0.4799779       24.889900947
## 77          0.8730995                             0.4866341       22.425090742
## 78          0.8187260                             0.4876494       25.807794689
## 79          0.7910377                             0.4780392       15.640323852
## 80          0.7900116                             0.4958211        5.974928398
## 81          0.8965371                             0.4933919       19.246478485
## 82          0.8196465                             0.4948647       10.038566094
## 83          0.7653513                             0.4766855       20.299743510
## 84          0.8840478                             0.4799968        6.598101036
## 85          0.8573880                             0.4712669       13.864498408
## 86          0.8380801                             0.4814654       17.126823814
## 87          0.8778693                             0.4719824       24.069060162
## 88          0.8995971                             0.4720583       19.653361010
## 89          0.8584176                             0.5345085        8.625337943
## 90          0.8435062                             0.5050466       12.271206713
## 91          0.7752904                             0.5432064       13.201976116
## 92          0.9260580                             0.5398717       11.330843968
## 93          0.9246158                             0.5247375       11.824962656
## 94          0.9193302                             0.5331479       10.541765847
## 95          0.9314929                             0.5802553        8.252502616
## 96          0.9362472                             0.5228870       12.119605010
## 97          0.9364005                             0.5173503        4.921196095
## 98          0.9243760                             0.5377988       17.817380758
## 99          0.9188795                             0.5019796       24.119785104
## 100         0.9406476                             0.5304693       12.039486496
##     presencia_ausencia_cultivos
## 1                             1
## 2                             1
## 3                             1
## 4                             0
## 5                             0
## 6                             0
## 7                             0
## 8                             1
## 9                             0
## 10                            0
## 11                            1
## 12                            1
## 13                            1
## 14                            0
## 15                            0
## 16                            0
## 17                            0
## 18                            0
## 19                            0
## 20                            1
## 21                            0
## 22                            1
## 23                            1
## 24                            0
## 25                            1
## 26                            1
## 27                            1
## 28                            0
## 29                            1
## 30                            1
## 31                            0
## 32                            0
## 33                            0
## 34                            0
## 35                            1
## 36                            0
## 37                            0
## 38                            0
## 39                            0
## 40                            1
## 41                            0
## 42                            0
## 43                            1
## 44                            0
## 45                            0
## 46                            1
## 47                            0
## 48                            0
## 49                            1
## 50                            0
## 51                            0
## 52                            0
## 53                            1
## 54                            0
## 55                            0
## 56                            0
## 57                            1
## 58                            1
## 59                            0
## 60                            1
## 61                            1
## 62                            1
## 63                            0
## 64                            0
## 65                            0
## 66                            0
## 67                            1
## 68                            0
## 69                            1
## 70                            0
## 71                            0
## 72                            1
## 73                            1
## 74                            1
## 75                            0
## 76                            1
## 77                            0
## 78                            0
## 79                            0
## 80                            0
## 81                            1
## 82                            1
## 83                            0
## 84                            0
## 85                            1
## 86                            0
## 87                            0
## 88                            0
## 89                            1
## 90                            0
## 91                            0
## 92                            0
## 93                            0
## 94                            0
## 95                            0
## 96                            0
## 97                            0
## 98                            0
## 99                            1
## 100                           1
plot(Y_5)

npoints(Y_5)
## [1] 100
marks(Y_5)
##     Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado Temp_superfi_suelo
## 1           0.7026732                             0.2991360        0.826539827
## 2           0.7087010                             0.3340606        0.017394917
## 3           0.7017520                             0.3393141        0.351011699
## 4           0.7059049                             0.3171926        0.336168445
## 5           0.7054854                             0.3358501        0.193621764
## 6           0.7110817                             0.3477945        0.215849049
## 7           0.7012688                             0.3411699        0.584549947
## 8           0.7137616                             0.3492701        1.483054908
## 9           0.7105483                             0.3567919        0.006872773
## 10          0.7202223                             0.3568015        1.753836488
## 11          0.7362153                             0.3597202        2.843300949
## 12          0.7339790                             0.3628262        2.582178248
## 13          0.7514377                             0.3682714        2.852630476
## 14          0.7421811                             0.3708850        3.500861115
## 15          0.7331554                             0.3798633        2.814266943
## 16          0.7533281                             0.3912434        3.686865468
## 17          0.7247215                             0.3827131        3.618736131
## 18          0.7534498                             0.3803317        6.239539182
## 19          0.7391675                             0.3810648       25.520887833
## 20          0.7543980                             0.3843086       12.817117273
## 21          0.7384275                             0.3969765       18.230129061
## 22          0.7441869                             0.3798142       14.646657127
## 23          0.7450494                             0.3984910       11.681789665
## 24          0.7289576                             0.3815276       16.442318327
## 25          0.8490427                             0.3947378        4.757313609
## 26          0.7920595                             0.3892577       24.769329095
## 27          0.8112685                             0.4383685       11.302171311
## 28          0.9007474                             0.4340920       23.196069515
## 29          0.8018667                             0.4123739        5.470260922
## 30          0.7688961                             0.4330543       15.210452393
## 31          0.8283577                             0.4101861        9.281275270
## 32          0.8841883                             0.4334208       25.000765169
## 33          0.7878809                             0.4000654       16.993937823
## 34          0.8434585                             0.4359619        5.103845254
## 35          0.8067768                             0.4461145       15.090956978
## 36          0.8149295                             0.4334073       14.640395270
## 37          0.8509928                             0.4098335       10.127788157
## 38          0.8659456                             0.4243419        8.422640488
## 39          0.7641143                             0.4043342       11.886389973
## 40          0.8645853                             0.4491995       25.816393158
## 41          0.7952560                             0.3998971        8.710845223
## 42          0.7632455                             0.4302931       19.093821499
## 43          0.8488116                             0.4472068       20.871494635
## 44          0.7643642                             0.4267996        7.044146645
## 45          0.7853386                             0.4306879       15.033394136
## 46          0.8893194                             0.4438585       11.508236091
## 47          0.7879383                             0.4515931       22.598347709
## 48          0.7777631                             0.4295091        7.023766152
## 49          0.7788205                             0.4156109        7.915431207
## 50          0.7664077                             0.4343663       24.771317373
## 51          0.7724759                             0.4395660       15.766005895
## 52          0.8091705                             0.4244798        3.756143586
## 53          0.9099795                             0.4376342        4.889933105
## 54          0.7694987                             0.3986369       16.918064667
## 55          0.8670346                             0.4312013        8.333239533
## 56          0.7985044                             0.4420126       21.396693401
## 57          0.9086912                             0.4478757       10.205550911
## 58          0.7963039                             0.4312391       20.389451853
## 59          0.7898150                             0.4336521       18.368361255
## 60          0.8469558                             0.4648882       17.663204696
## 61          0.8500429                             0.4539320        9.416196640
## 62          0.7604993                             0.4701093       13.560064282
## 63          0.8631985                             0.4692793       21.746179395
## 64          0.8494692                             0.4604512        8.552850345
## 65          0.7554524                             0.4617572        3.849805406
## 66          0.7878699                             0.4549603       13.635003214
## 67          0.7833852                             0.4646405        8.335741235
## 68          0.8258192                             0.4623018        7.195944292
## 69          0.8345510                             0.4681131       10.624148205
## 70          0.7957878                             0.4703274       24.112370528
## 71          0.7781054                             0.4518307       25.053117412
## 72          0.7719382                             0.4602901       13.816253932
## 73          0.8377899                             0.4532498       12.877793376
## 74          0.7873545                             0.4911202       24.589545862
## 75          0.8652038                             0.4718040       22.807899692
## 76          0.7767990                             0.4799779       24.889900947
## 77          0.8730995                             0.4866341       22.425090742
## 78          0.8187260                             0.4876494       25.807794689
## 79          0.7910377                             0.4780392       15.640323852
## 80          0.7900116                             0.4958211        5.974928398
## 81          0.8965371                             0.4933919       19.246478485
## 82          0.8196465                             0.4948647       10.038566094
## 83          0.7653513                             0.4766855       20.299743510
## 84          0.8840478                             0.4799968        6.598101036
## 85          0.8573880                             0.4712669       13.864498408
## 86          0.8380801                             0.4814654       17.126823814
## 87          0.8778693                             0.4719824       24.069060162
## 88          0.8995971                             0.4720583       19.653361010
## 89          0.8584176                             0.5345085        8.625337943
## 90          0.8435062                             0.5050466       12.271206713
## 91          0.7752904                             0.5432064       13.201976116
## 92          0.9260580                             0.5398717       11.330843968
## 93          0.9246158                             0.5247375       11.824962656
## 94          0.9193302                             0.5331479       10.541765847
## 95          0.9314929                             0.5802553        8.252502616
## 96          0.9362472                             0.5228870       12.119605010
## 97          0.9364005                             0.5173503        4.921196095
## 98          0.9243760                             0.5377988       17.817380758
## 99          0.9188795                             0.5019796       24.119785104
## 100         0.9406476                             0.5304693       12.039486496
##     presencia_ausencia_cultivos
## 1                             1
## 2                             1
## 3                             1
## 4                             0
## 5                             0
## 6                             0
## 7                             0
## 8                             1
## 9                             0
## 10                            0
## 11                            1
## 12                            1
## 13                            1
## 14                            0
## 15                            0
## 16                            0
## 17                            0
## 18                            0
## 19                            0
## 20                            1
## 21                            0
## 22                            1
## 23                            1
## 24                            0
## 25                            1
## 26                            1
## 27                            1
## 28                            0
## 29                            1
## 30                            1
## 31                            0
## 32                            0
## 33                            0
## 34                            0
## 35                            1
## 36                            0
## 37                            0
## 38                            0
## 39                            0
## 40                            1
## 41                            0
## 42                            0
## 43                            1
## 44                            0
## 45                            0
## 46                            1
## 47                            0
## 48                            0
## 49                            1
## 50                            0
## 51                            0
## 52                            0
## 53                            1
## 54                            0
## 55                            0
## 56                            0
## 57                            1
## 58                            1
## 59                            0
## 60                            1
## 61                            1
## 62                            1
## 63                            0
## 64                            0
## 65                            0
## 66                            0
## 67                            1
## 68                            0
## 69                            1
## 70                            0
## 71                            0
## 72                            1
## 73                            1
## 74                            1
## 75                            0
## 76                            1
## 77                            0
## 78                            0
## 79                            0
## 80                            0
## 81                            1
## 82                            1
## 83                            0
## 84                            0
## 85                            1
## 86                            0
## 87                            0
## 88                            0
## 89                            1
## 90                            0
## 91                            0
## 92                            0
## 93                            0
## 94                            0
## 95                            0
## 96                            0
## 97                            0
## 98                            0
## 99                            1
## 100                           1
coords(Y_5)
##         x       y
## 1   5.575 -73.268
## 2   5.543 -73.286
## 3   5.576 -73.298
## 4   5.543 -73.251
## 5   5.554 -73.251
## 6   5.543 -73.297
## 7   5.550 -73.254
## 8   5.553 -73.273
## 9   5.573 -73.275
## 10  5.570 -73.273
## 11  5.573 -73.250
## 12  5.574 -73.296
## 13  5.566 -73.291
## 14  5.572 -73.272
## 15  5.555 -73.281
## 16  5.574 -73.253
## 17  5.567 -73.286
## 18  5.559 -73.261
## 19  5.572 -73.256
## 20  5.558 -73.277
## 21  5.547 -73.279
## 22  5.564 -73.283
## 23  5.550 -73.258
## 24  5.541 -73.299
## 25  5.561 -73.272
## 26  5.559 -73.278
## 27  5.547 -73.261
## 28  5.578 -73.265
## 29  5.556 -73.264
## 30  5.556 -73.273
## 31  5.546 -73.254
## 32  5.580 -73.283
## 33  5.547 -73.263
## 34  5.540 -73.270
## 35  5.577 -73.275
## 36  5.554 -73.269
## 37  5.563 -73.266
## 38  5.541 -73.270
## 39  5.564 -73.273
## 40  5.565 -73.261
## 41  5.540 -73.263
## 42  5.560 -73.253
## 43  5.552 -73.300
## 44  5.553 -73.254
## 45  5.552 -73.272
## 46  5.544 -73.253
## 47  5.574 -73.297
## 48  5.541 -73.288
## 49  5.572 -73.262
## 50  5.568 -73.271
## 51  5.540 -73.299
## 52  5.562 -73.300
## 53  5.547 -73.284
## 54  5.544 -73.273
## 55  5.576 -73.266
## 56  5.576 -73.254
## 57  5.564 -73.300
## 58  5.559 -73.264
## 59  5.566 -73.297
## 60  5.574 -73.281
## 61  5.543 -73.255
## 62  5.540 -73.299
## 63  5.544 -73.251
## 64  5.579 -73.298
## 65  5.542 -73.287
## 66  5.578 -73.275
## 67  5.547 -73.255
## 68  5.553 -73.264
## 69  5.546 -73.285
## 70  5.578 -73.271
## 71  5.579 -73.252
## 72  5.540 -73.250
## 73  5.544 -73.268
## 74  5.557 -73.297
## 75  5.553 -73.297
## 76  5.564 -73.264
## 77  5.562 -73.263
## 78  5.576 -73.290
## 79  5.563 -73.290
## 80  5.576 -73.283
## 81  5.556 -73.298
## 82  5.547 -73.272
## 83  5.571 -73.276
## 84  5.573 -73.268
## 85  5.572 -73.260
## 86  5.546 -73.280
## 87  5.569 -73.272
## 88  5.559 -73.257
## 89  5.556 -73.283
## 90  5.548 -73.286
## 91  5.557 -73.270
## 92  5.578 -73.265
## 93  5.580 -73.278
## 94  5.560 -73.263
## 95  5.558 -73.254
## 96  5.561 -73.273
## 97  5.553 -73.253
## 98  5.555 -73.266
## 99  5.576 -73.263
## 100 5.549 -73.264
as.owin(Y_5)
## window: rectangle = [5.54, 5.58] x [-73.3, -73.25] units
as.data.frame(Y_5)
##         x       y Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado
## 1   5.575 -73.268         0.7026732                             0.2991360
## 2   5.543 -73.286         0.7087010                             0.3340606
## 3   5.576 -73.298         0.7017520                             0.3393141
## 4   5.543 -73.251         0.7059049                             0.3171926
## 5   5.554 -73.251         0.7054854                             0.3358501
## 6   5.543 -73.297         0.7110817                             0.3477945
## 7   5.550 -73.254         0.7012688                             0.3411699
## 8   5.553 -73.273         0.7137616                             0.3492701
## 9   5.573 -73.275         0.7105483                             0.3567919
## 10  5.570 -73.273         0.7202223                             0.3568015
## 11  5.573 -73.250         0.7362153                             0.3597202
## 12  5.574 -73.296         0.7339790                             0.3628262
## 13  5.566 -73.291         0.7514377                             0.3682714
## 14  5.572 -73.272         0.7421811                             0.3708850
## 15  5.555 -73.281         0.7331554                             0.3798633
## 16  5.574 -73.253         0.7533281                             0.3912434
## 17  5.567 -73.286         0.7247215                             0.3827131
## 18  5.559 -73.261         0.7534498                             0.3803317
## 19  5.572 -73.256         0.7391675                             0.3810648
## 20  5.558 -73.277         0.7543980                             0.3843086
## 21  5.547 -73.279         0.7384275                             0.3969765
## 22  5.564 -73.283         0.7441869                             0.3798142
## 23  5.550 -73.258         0.7450494                             0.3984910
## 24  5.541 -73.299         0.7289576                             0.3815276
## 25  5.561 -73.272         0.8490427                             0.3947378
## 26  5.559 -73.278         0.7920595                             0.3892577
## 27  5.547 -73.261         0.8112685                             0.4383685
## 28  5.578 -73.265         0.9007474                             0.4340920
## 29  5.556 -73.264         0.8018667                             0.4123739
## 30  5.556 -73.273         0.7688961                             0.4330543
## 31  5.546 -73.254         0.8283577                             0.4101861
## 32  5.580 -73.283         0.8841883                             0.4334208
## 33  5.547 -73.263         0.7878809                             0.4000654
## 34  5.540 -73.270         0.8434585                             0.4359619
## 35  5.577 -73.275         0.8067768                             0.4461145
## 36  5.554 -73.269         0.8149295                             0.4334073
## 37  5.563 -73.266         0.8509928                             0.4098335
## 38  5.541 -73.270         0.8659456                             0.4243419
## 39  5.564 -73.273         0.7641143                             0.4043342
## 40  5.565 -73.261         0.8645853                             0.4491995
## 41  5.540 -73.263         0.7952560                             0.3998971
## 42  5.560 -73.253         0.7632455                             0.4302931
## 43  5.552 -73.300         0.8488116                             0.4472068
## 44  5.553 -73.254         0.7643642                             0.4267996
## 45  5.552 -73.272         0.7853386                             0.4306879
## 46  5.544 -73.253         0.8893194                             0.4438585
## 47  5.574 -73.297         0.7879383                             0.4515931
## 48  5.541 -73.288         0.7777631                             0.4295091
## 49  5.572 -73.262         0.7788205                             0.4156109
## 50  5.568 -73.271         0.7664077                             0.4343663
## 51  5.540 -73.299         0.7724759                             0.4395660
## 52  5.562 -73.300         0.8091705                             0.4244798
## 53  5.547 -73.284         0.9099795                             0.4376342
## 54  5.544 -73.273         0.7694987                             0.3986369
## 55  5.576 -73.266         0.8670346                             0.4312013
## 56  5.576 -73.254         0.7985044                             0.4420126
## 57  5.564 -73.300         0.9086912                             0.4478757
## 58  5.559 -73.264         0.7963039                             0.4312391
## 59  5.566 -73.297         0.7898150                             0.4336521
## 60  5.574 -73.281         0.8469558                             0.4648882
## 61  5.543 -73.255         0.8500429                             0.4539320
## 62  5.540 -73.299         0.7604993                             0.4701093
## 63  5.544 -73.251         0.8631985                             0.4692793
## 64  5.579 -73.298         0.8494692                             0.4604512
## 65  5.542 -73.287         0.7554524                             0.4617572
## 66  5.578 -73.275         0.7878699                             0.4549603
## 67  5.547 -73.255         0.7833852                             0.4646405
## 68  5.553 -73.264         0.8258192                             0.4623018
## 69  5.546 -73.285         0.8345510                             0.4681131
## 70  5.578 -73.271         0.7957878                             0.4703274
## 71  5.579 -73.252         0.7781054                             0.4518307
## 72  5.540 -73.250         0.7719382                             0.4602901
## 73  5.544 -73.268         0.8377899                             0.4532498
## 74  5.557 -73.297         0.7873545                             0.4911202
## 75  5.553 -73.297         0.8652038                             0.4718040
## 76  5.564 -73.264         0.7767990                             0.4799779
## 77  5.562 -73.263         0.8730995                             0.4866341
## 78  5.576 -73.290         0.8187260                             0.4876494
## 79  5.563 -73.290         0.7910377                             0.4780392
## 80  5.576 -73.283         0.7900116                             0.4958211
## 81  5.556 -73.298         0.8965371                             0.4933919
## 82  5.547 -73.272         0.8196465                             0.4948647
## 83  5.571 -73.276         0.7653513                             0.4766855
## 84  5.573 -73.268         0.8840478                             0.4799968
## 85  5.572 -73.260         0.8573880                             0.4712669
## 86  5.546 -73.280         0.8380801                             0.4814654
## 87  5.569 -73.272         0.8778693                             0.4719824
## 88  5.559 -73.257         0.8995971                             0.4720583
## 89  5.556 -73.283         0.8584176                             0.5345085
## 90  5.548 -73.286         0.8435062                             0.5050466
## 91  5.557 -73.270         0.7752904                             0.5432064
## 92  5.578 -73.265         0.9260580                             0.5398717
## 93  5.580 -73.278         0.9246158                             0.5247375
## 94  5.560 -73.263         0.9193302                             0.5331479
## 95  5.558 -73.254         0.9314929                             0.5802553
## 96  5.561 -73.273         0.9362472                             0.5228870
## 97  5.553 -73.253         0.9364005                             0.5173503
## 98  5.555 -73.266         0.9243760                             0.5377988
## 99  5.576 -73.263         0.9188795                             0.5019796
## 100 5.549 -73.264         0.9406476                             0.5304693
##     Temp_superfi_suelo presencia_ausencia_cultivos
## 1          0.826539827                           1
## 2          0.017394917                           1
## 3          0.351011699                           1
## 4          0.336168445                           0
## 5          0.193621764                           0
## 6          0.215849049                           0
## 7          0.584549947                           0
## 8          1.483054908                           1
## 9          0.006872773                           0
## 10         1.753836488                           0
## 11         2.843300949                           1
## 12         2.582178248                           1
## 13         2.852630476                           1
## 14         3.500861115                           0
## 15         2.814266943                           0
## 16         3.686865468                           0
## 17         3.618736131                           0
## 18         6.239539182                           0
## 19        25.520887833                           0
## 20        12.817117273                           1
## 21        18.230129061                           0
## 22        14.646657127                           1
## 23        11.681789665                           1
## 24        16.442318327                           0
## 25         4.757313609                           1
## 26        24.769329095                           1
## 27        11.302171311                           1
## 28        23.196069515                           0
## 29         5.470260922                           1
## 30        15.210452393                           1
## 31         9.281275270                           0
## 32        25.000765169                           0
## 33        16.993937823                           0
## 34         5.103845254                           0
## 35        15.090956978                           1
## 36        14.640395270                           0
## 37        10.127788157                           0
## 38         8.422640488                           0
## 39        11.886389973                           0
## 40        25.816393158                           1
## 41         8.710845223                           0
## 42        19.093821499                           0
## 43        20.871494635                           1
## 44         7.044146645                           0
## 45        15.033394136                           0
## 46        11.508236091                           1
## 47        22.598347709                           0
## 48         7.023766152                           0
## 49         7.915431207                           1
## 50        24.771317373                           0
## 51        15.766005895                           0
## 52         3.756143586                           0
## 53         4.889933105                           1
## 54        16.918064667                           0
## 55         8.333239533                           0
## 56        21.396693401                           0
## 57        10.205550911                           1
## 58        20.389451853                           1
## 59        18.368361255                           0
## 60        17.663204696                           1
## 61         9.416196640                           1
## 62        13.560064282                           1
## 63        21.746179395                           0
## 64         8.552850345                           0
## 65         3.849805406                           0
## 66        13.635003214                           0
## 67         8.335741235                           1
## 68         7.195944292                           0
## 69        10.624148205                           1
## 70        24.112370528                           0
## 71        25.053117412                           0
## 72        13.816253932                           1
## 73        12.877793376                           1
## 74        24.589545862                           1
## 75        22.807899692                           0
## 76        24.889900947                           1
## 77        22.425090742                           0
## 78        25.807794689                           0
## 79        15.640323852                           0
## 80         5.974928398                           0
## 81        19.246478485                           1
## 82        10.038566094                           1
## 83        20.299743510                           0
## 84         6.598101036                           0
## 85        13.864498408                           1
## 86        17.126823814                           0
## 87        24.069060162                           0
## 88        19.653361010                           0
## 89         8.625337943                           1
## 90        12.271206713                           0
## 91        13.201976116                           0
## 92        11.330843968                           0
## 93        11.824962656                           0
## 94        10.541765847                           0
## 95         8.252502616                           0
## 96        12.119605010                           0
## 97         4.921196095                           0
## 98        17.817380758                           0
## 99        24.119785104                           1
## 100       12.039486496                           1
marks(Y_5) <- 200
Grafico_densidad <- contour(density(y, 0.005), axes = FALSE)

Grafico_densidad
## window: rectangle = [5.54, 5.58] x [-73.3, -73.25] units
hist(y$x, nclass = 20)

hist(y$y, nclass = 20)

densidad <- owin(c(min(datos_posicion$x), max(datos_posicion$x)), c(min(datos_posicion$y), max(datos_posicion$y)))
cultivos <- y[densidad]
plot(density(cultivos))

contour(density(Y_2, 0.005),axes = FALSE)

z <-as.im(y_3)
plot(z)

z_1 <-as.im(y_3)
plot(z_1)
plot(y_3, add = TRUE, size =0.4, pch =3)
## Plotting the first column of marks

summary(y_3)
## Marked planar point pattern:  100 points
## Average intensity 50000 points per square unit
## 
## Coordinates are given to 3 decimal places
## i.e. rounded to the nearest multiple of 0.001 units
## 
## Mark variables: Ind_humedad_suelo, Ind_vegetacion_diferencia_normalizado, 
## Temp_superfi_suelo, presencia_ausencia_cultivos
## Summary:
##  Ind_humedad_suelo Ind_vegetacion_diferencia_normalizado Temp_superfi_suelo 
##  Min.   :0.7013    Min.   :0.2991                        Min.   : 0.006873  
##  1st Qu.:0.7592    1st Qu.:0.3981                        1st Qu.: 6.173386  
##  Median :0.7937    Median :0.4380                        Median :11.855676  
##  Mean   :0.8079    Mean   :0.4371                        Mean   :12.354472  
##  3rd Qu.:0.8576    3rd Qu.:0.4718                        3rd Qu.:18.264687  
##  Max.   :0.9406    Max.   :0.5803                        Max.   :25.816393  
##  presencia_ausencia_cultivos
##  0:62                       
##  1:38                       
##                             
##                             
##                             
##                             
## 
## Window: rectangle = [5.54, 5.58] x [-73.3, -73.25] units
##                     (0.04 x 0.05 units)
## Window area = 0.002 square units
set.seed(1193096924)
sec_lat <- seq(from=0, to=2000, by=2)
sec_long <- seq(from=0, to=500, by=2)
Latitud <- sample(sec_lat, size = 150, replace= TRUE)
longitud <- sample(sec_long, size = 150, replace= TRUE)
posicion_n <- data.frame(x= longitud, y= Latitud)
Ind_humedad_suelo = sort.int(runif(150, 0.7, 0.95), partial = 10)
Ind_vegetacion_diferencia_normalizado = sort.int(rnorm(150, 0.45, 0.06), partial = 10)
Temp_superfi_suelo = sort.int(26*rbeta(150, shape1 = 0.87,shape2 = 0.91), partial = 10)
presencia_ausencia_cultivos = factor(ifelse(rgamma(n=150, rate = 0.8, shape = 0.5)<0.5,0,1))
tabla_2 = data.frame(posicion_n,Ind_humedad_suelo,Ind_vegetacion_diferencia_normalizado,Temp_superfi_suelo,presencia_ausencia_cultivos)
library(spatstat)
datos_posicion_n = ppp(posicion$x, posicion$y, xrange=c(min(posicion$x), max(posicion$x)), yrange=c(min(posicion$y), max(posicion$y)))
## Warning: data contain duplicated points
any(duplicated(datos_posicion_n))
## [1] TRUE
y_n <- unique(datos_posicion_n)
plot(y_n)

summary(y_n)
## Planar point pattern:  98 points
## Average intensity 49000 points per square unit
## 
## Coordinates are given to 3 decimal places
## i.e. rounded to the nearest multiple of 0.001 units
## 
## Window: rectangle = [5.54, 5.58] x [-73.3, -73.25] units
##                     (0.04 x 0.05 units)
## Window area = 0.002 square units
puntos_cm2 <- summary(y_n)$intensity
puntos_m2 <- puntos_cm2/0.0001
puntos_m2
## [1] 4.9e+08
cuadricula <- quadratcount(y_n, nx=4, ny=4)
plot(cuadricula)

grafico_3d <- density(y_n, sigma = 60)
plot(grafico_3d)

plot(y_n, cex=0.5)

contorno <- contour(density(y_n, 0.005) , axes = TRUE)

CSR_hipotesis <- quadrat.test(y_n, nx=4)
plot(y_n)
plot(CSR_hipotesis, add=TRUE, cex=1)

CSR_hipotesis$p.value
## [1] 0.3284858
modelo_poisson <- ppm(y_n,~1)
modelo_poisson
## Stationary Poisson process
## Intensity: 49000
##             Estimate      S.E.  CI95.lo  CI95.hi Ztest     Zval
## log(lambda) 10.79958 0.1010153 10.60159 10.99756   *** 106.9103
dep_latitud <- ppm(y_n, ~y)
dep_latitud
## Nonstationary Poisson process
## 
## Log intensity:  ~y
## 
## Fitted trend coefficients:
## (Intercept)           y 
##   815.69266    10.98472 
## 
##              Estimate       S.E.     CI95.lo    CI95.hi Ztest     Zval
## (Intercept) 815.69266 516.908505 -197.429395 1828.81471       1.578021
## y            10.98472   7.054583   -2.842005   24.81145       1.557105
dep_longitud <- ppm(y_n, ~x)
dep_longitud
## Nonstationary Poisson process
## 
## Log intensity:  ~x
## 
## Fitted trend coefficients:
## (Intercept)           x 
##   36.371085   -4.599446 
## 
##              Estimate      S.E.   CI95.lo   CI95.hi Ztest       Zval
## (Intercept) 36.371085 48.690533 -59.06061 131.80278        0.7469847
## x           -4.599446  8.758236 -21.76527  12.56638       -0.5251566
funcion_x_mas_y <- ppm(y_n, ~x+y)
funcion_x_mas_y
## Nonstationary Poisson process
## 
## Log intensity:  ~x + y
## 
## Fitted trend coefficients:
## (Intercept)           x           y 
##  841.149622   -4.594583   10.983529 
## 
##               Estimate       S.E.     CI95.lo    CI95.hi Ztest       Zval
## (Intercept) 841.149622 519.183770 -176.431869 1858.73111        1.6201385
## x            -4.594583   8.757940  -21.759830   12.57066       -0.5246191
## y            10.983529   7.054632   -2.843295   24.81035        1.5569246
fun_poli_cuadarico <- ppm(y_n, ~polynom(x,y,2))
fun_poli_cuadarico
## Error in solve.default(M) : 
##   sistema es computacionalmente singular: número de condición recíproco = 2.06402e-22
## Warning: Cannot compute variance: Fisher information matrix is singular
## Error in solve.default(M) : 
##   sistema es computacionalmente singular: número de condición recíproco = 2.06402e-22
## Warning: Cannot compute variance: Fisher information matrix is singular
## Nonstationary Poisson process
## 
## Log intensity:  ~x + y + I(x^2) + I(x * y) + I(y^2)
## 
## Fitted trend coefficients:
##  (Intercept)            x            y       I(x^2)     I(x * y)       I(y^2) 
## 2100320.8352  -39950.1048   54285.0339    1213.9183    -360.9431     356.6567 
## 
## Standard errors unavailable; variance-covariance matrix is singular
comp_modelo <- anova(dep_latitud, funcion_x_mas_y)
comp_modelo
## Analysis of Deviance Table
## 
## Model 1: ~y   Poisson
## Model 2: ~x + y   Poisson
##   Npar Df Deviance
## 1    2            
## 2    3  1  0.27546
otra_comparacion <- anova(funcion_x_mas_y,fun_poli_cuadarico)
otra_comparacion
## Analysis of Deviance Table
## 
## Model 1: ~x + y   Poisson
## Model 2: ~x + y + I(x^2) + I(x * y) + I(y^2)      Poisson
##   Npar Df Deviance
## 1    3            
## 2    6  3   3.1068