我有一些由 GPS/GNSS 记录的空间数据,包括纬度/经度和椭圆体上方高度(HAE,米)高度值,所有数据均参考 NAD83(2011),EPSG:6318。我正在尝试转换霍兹。到 State Plane NY East(EPSG:6537,这是成功的),但如何将高度/高度数据转换为 NAVD88,US-ft(EPSG:6360)?我可以使用水平应用sf::st_transform(6537),但我不知道如何应用垂直。我尝试在第一次转换后再串一个sf::st_transform(6360),但这没有用。下面是一个可重现的示例,作为参考,NOAA VDatum 在线输出显示了正确的值(转换后的高程应约为 5.899 英尺)
library(sf)
library(tidyverse)
pt <- data.frame(Lat = 41.1578110483, Lon = -73.8716163883, Alt = -29.3619984455) %>%
st_as_sf(coords = c("Lon", "Lat", "Alt"), crs = 6318, agr = "constant", remove = FALSE) %>%
st_transform(6537) %>%
mutate(x = st_coordinates(.)[,1],
y = st_coordinates(.)[,2],
z = st_coordinates(.)[,3])
pt
Run Code Online (Sandbox Code Playgroud)
Simple feature collection with 1 feature and 6 fields
Attribute-geometry relationship: 3 constant, 0 aggregate, 0 identity, 3 NA's
Geometry type: POINT …Run Code Online (Sandbox Code Playgroud) 我是 python 菜鸟,但我正在尝试渲染使用下面的 R Markdown 块内的 python 代码生成的表。当在 Jupyter 中运行时,Python 代码会输出一个很好的格式化表格,但我似乎无法在 Markdown 文档中复制它。
{python, engine.path = '/usr/bin/python3'}
import pandas as pd
import numpy as np
df1 = pd.read_csv(r'./data/crest_results_table.txt', sep='\t')
df2 = pd.read_csv(r'./data/crest_formats_table.txt', sep='\t')
results_table = df1.pivot_table(values=['Result'],index=['Anlys_Mthd','CAS','AnalTParam','RDCSRS','NRDCSRS','IGWSRS'],columns=['SampNum','LabID','SampDate'],aggfunc=np.max)
formats_table = df2.pivot_table(values=['Result'],index=['Anlys_Mthd','CAS','AnalTParam','RDCSRS','NRDCSRS','IGWSRS'],columns=['SampNum','LabID','SampDate'],aggfunc=np.max)
def color_cells(s):
if s == -1:
return 'color:{0}; background-color: white; font-weight:bold; font-style:italic; font-size:small'.format('black')
elif s == -2:
return 'color:{0}; background-color: orange; font-weight:bold; font-style:italic; font-size:small'.format('black')
elif s == -3:
return 'color:{0}; background-color: yellow; font-weight:bold; font-size:small'.format('black')
elif s == -4:
return 'color:{0}; background-color: …Run Code Online (Sandbox Code Playgroud) 我正在尝试将多个 dygraph 绘图放在 Flexdashboard 的单个选项卡上。我从这里和这里尝试了很多不同的选择
\n\n我的 RMD 文件如下所示:
\n\n ---\n title: "Project Dashboard"\n output: \n flexdashboard::flex_dashboard:\n orientation: columns\n vertical_layout: scroll\n ---\n # Intro {.sidebar}\n\n # Page 1\n\n ## Column 1 {.tabset .tabset-fade data-width=850}\n\n ### Site 1\n\n ```{r Data, echo=FALSE, fig.height=2}\n\n s <- dygraph(as.xts(df,order.by=df$DateTime), group = "NC") %>% \n dyOptions(drawPoints = TRUE, pointSize = 1) %>%\n dyAxis("y", label = "Salinity (PSU)", valueRange = c(16, 30)) %>%\n dyRangeSelector(height = 20) %>% \n dyLegend(width = 400)\n\n t <- …Run Code Online (Sandbox Code Playgroud)