【发布时间】:2018-01-22 07:46:54
【问题描述】:
我需要在这个反应数据框中将某些数字更改为 NA,例如将所有 -1 更改为 NA 或所有负数,因此它们不会在 historgam 中绘制
pointsInBounds <- reactive({
if (is.null(input$map_bounds))
return(Data[TRUE,])
bounds <- input$map_bounds
latRng <- range(bounds$north, bounds$south)
lngRng <- range(bounds$east, bounds$west)
subset(Organisms(),
lat >= latRng[1] & lat <= latRng[2] &
lon >= lngRng[1] & lon <= lngRng[2])
})
##histogram
output$hist <- renderPlot({plot1<-
# If no organisms are in view, don't plot
if (nrow(pointsInBounds()) == 0)
return()
hist(...)
【问题讨论】:
-
您应该能够使用与通常在 R 中相同的程序:
df[df < 0] <- 0 -
我在使用
comparison (3) is possible only for atomic and list types时收到此错误代码