Questions tagged [envstats]

An R package to conduct environmental statistics.

12 questions
7
votes
1 answer

Create custom geom to compute summary statistics and display them *outside* the plotting region

I am the creator of the R package EnvStats. There is a function I use quite often called stripChart. I am just starting to learn ggplot2, and have spent the past several days poring over Hadley's book, Winston’s book, StackOverflow, and other…
Steve M
  • 441
  • 1
  • 3
  • 8
1
vote
1 answer

Looping and subsets for the kendall Seasonal Trend Test for numerous monitoring stations, EnvStats in R

Using the Kendall Seasonal Trend Test from the EnvStats package to assess water quality data, but I am having trouble adjusting the code to: return trend statistics for individual sites/stations (only thing that has worked so far is subsetting each…
Sam
  • 21
  • 1
1
vote
1 answer

EnvStats simulateVector function

I'm using the EnvStats package more specifically the simulateVector function to generate random samples from pdf's. I've tried using a Normal pdf and varying the parameters that truncate this pdf: > vfy <- simulateVector(10, distribution = "norm", +…
jpcgandre
  • 1,487
  • 5
  • 31
  • 55
0
votes
0 answers

raster.kendall function on spatialEco not EnvStats package

Recently I came across over this library in R spatialEco. I want to calculate the Kendall tau statistic for a raster stack in R. but I get an Error to "install EnvStats package before running this function", when I install this package, then get…
0
votes
1 answer

EnvStats::epdfPlot() throws error with continuous distribution

I am trying to compute an empirical probability distribution for a continuous variable using the epdfPlot() function in the EnvStats:: package. I keep getting an error when I accept the default of discrete=FALSE. Error in UseMethod("density") : …
Sean McKenzie
  • 707
  • 3
  • 13
0
votes
1 answer

Fitting data frame probability distributions with different lengths - EnvStat - looping in R

I'm trying to fit probability distributions in R using EnvStat package and looping to calculate multiple columns at once. Columns have different lengths and some code error is happening. The data frame does not remain in numeric format. Error…
Marcel
  • 147
  • 4
0
votes
1 answer

How can I insert a data frame in a function and then group by groups with tapply

I am new to programming in R and I have made a function that returns me some basic statistics from a list or vector that we insert. The problem comes when I want to insert a data frame. The dataframe I want to insert has 2 columns; the first refers…
Abel Pérez
  • 107
  • 7
0
votes
2 answers

How to change the values in `stat_n_text` function?

I have the following issue with labeling the smaple size in my dataset: library(ggplot2) library(EnvStats) library(tidyverse) cars_pre= mtcars %>% mutate(time="Pre") cars_post= mtcars %>% mutate(time="Post") df= rbind(cars_pre,cars_post) p <-…
yuliaUU
  • 1,581
  • 2
  • 12
  • 33
0
votes
1 answer

Use custom function in R table1 package

I am trying to build data summary tables in R using the table1 package. Does anyone know if it is possible to specify custom functions to render instead of the stats.default functions? I want to use the function geoSD and geoMean from the EnvStats…
Kunal
  • 1
  • 1
0
votes
0 answers

How to track points plotted in an ECDF back to an original data frame in R?

So I started with 5 data frames corresponding to different categories. Let's call them d1,d2,d3,d4,d5 defined with the code: d1<-data.frame(runif(1000,0,10000)) d2<-data.frame(runif(1000,0,10000)) d3<-data.frame(runif(1000,0,10000))…
sarwoz
  • 13
  • 2
0
votes
0 answers

bounded left skewed distribution giving a specific mean and SD R

I am looking for help to create a left-skewed distribution giving a specific mean and standard deviation. EnvStats package has a function to creates bounded right-skewed distribution as shown below with mean=2, sd=.9, lb=1,ub=5, but not left-skewed.…
Alan
  • 55
  • 1
  • 6
0
votes
2 answers

aggregate with function rosnerTest

I get an error "Error in if (any(outlier)) { : missing value where TRUE/FALSE needed" when I try to use the rosnerTest, from the package EnvStats. out1 <- aggregate(x = df$Price, by = list(df$Item), FUN = rosnerTest) I'm trying to use the…