Skip to content

Commit 2956f66

Browse files
authored
Update maricopa_field_metadata.Rmd
1 parent 053fe95 commit 2956f66

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

scripts/maricopa_field_metadata.Rmd

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,23 @@ write.csv(plots, file = '20160421_plots.csv')
119119

120120
```
121121
122+
Here is an example of how to add lat1 and lon1 for X1 and Y1, add lat2 and lon2 for X2 and Y2 to grid data frame using the projection I provided before.
123+
124+
125+
```r
126+
require(proj4)
127+
options(digits = 12)
128+
x1y1=cbind(grid$x1,grid$y1)
129+
x2y2=cbind(grid$x2,grid$y2)
130+
proj= '+proj=tmerc +lat_0=0 +lon_0=-111.843479 +k=1 +x_0=12285.092664 +y_0=-3661028.344732 +datum=WGS84 +units=m +no_defs '
131+
latlon1=project(x1y1, proj, inverse = T, degrees = TRUE, silent = FALSE, ellps.default="sphere")
132+
latlon2=project(x2y2, proj, inverse = T, degrees = TRUE, silent = FALSE, ellps.default="sphere")
133+
grid$lon1=latlon1[,1]
134+
grid$lat1=latlon1[,2]
135+
grid$lon2=latlon2[,1]
136+
grid$lat2=latlon2[,2]
137+
```
138+
122139
123140
## Cultivars
124141
@@ -160,4 +177,4 @@ For any traits that we upload, an entry in `trait_covariate_associations` is req
160177
```{r}
161178
insert_tca <- paste0("insert into trait_covariate_associations (trait_variable_id, covariate_variable_id, required) values (", 6000000001:6000000008, ", 343, 'f');")
162179
writeLines(insert_tca, con = 'trait_covariate_associations.sql')
163-
```
180+
```

0 commit comments

Comments
 (0)