Re: [R] GAM with binary predictors

2023-02-16 Thread Thierry Onkelinx via R-help
Dear Sacha, use glm() in this case. I'd rather code the covariable as TRUE / FALSE or as a factor. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team

Re: [R] getting to a point where packages are installed and "ready to use", without unnecessarily reinstalling packages

2022-10-25 Thread Thierry Onkelinx via R-help
Dear Kelly, Have a look at the renv package (https://CRAN.R-project.org/package=renv). Once setup, your code reduces to renv::restore() Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH

Re: [R] inconsistencies between HLM and clmm results for the signs for the coefficients

2022-10-21 Thread Thierry Onkelinx via R-help
Dear Debbie, Have a look at the vignette of the ordinal package. Look for the equation that defines \eta. And note the minus sign associated with \beta. You'll need to find the equation used in HLM and compare it with the equation from ordinal. Best regards, ir. Thierry Onkelinx Statisticus

Re: [R] Live Online Training for High School Teachers and Students

2021-11-04 Thread Thierry Onkelinx via R-help
Dear Tracy, Maybe a workshop of Data Carpentry (https://datacarpentry.org/) might be relevant. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Thierry Onkelinx via R-help
eth is not a dataframe but of the class rxlsx. You'll need to convert eth into a dataframe. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteits

Re: [R] Secondary y axis in ggplot2: did not respond when change its y-axis value

2021-01-12 Thread Thierry Onkelinx via R-help
. That is not a good idea. https://blog.datawrapper.de/dualaxis/ ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality A

Re: [R] Need guidance on summarizing time data

2020-11-30 Thread Thierry Onkelinx via R-help
Dear Bruce, I think this should be straightforward with tidyverse. If not please provide a small reproducible data set with dput(). library(tidyverse) count(Active, Time) count(Active, Date, Time) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government

Re: [R] backslash in xtable (generate latex code from R)

2020-11-06 Thread Thierry Onkelinx via R-help
You could use kable() from the knitr package. kable(mytable, format = "latex", escape = FALSE) \begin{tabular}{l} \hline $\beta_0$\\ \hline aa\\ \hline bb\\ \hline cc$\alpha_1$\\ \hline \end{tabular} ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government o

Re: [R] Reorganize the data (dplyr or other packages?)

2020-08-17 Thread Thierry Onkelinx via R-help
Yes. However reshape2 is a retired package. The author recommends to use his new package tidyr. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie

Re: [R] Reorganize the data (dplyr or other packages?)

2020-08-17 Thread Thierry Onkelinx via R-help
You are looking for tidyr::pivot_longer() Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics &

Re: [R] lme4 - Mixed Model question

2020-07-13 Thread Thierry Onkelinx via R-help
effect as setting its coefficient to zero for that set of observations. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg /

Re: [R] unique scale color ggplot2

2020-07-07 Thread Thierry Onkelinx via R-help
Don't use the cut() function. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkel...

Re: [R] unique scale color ggplot2

2020-07-07 Thread Thierry Onkelinx via R-help
Dear Catalin, use scale_fill_gradient() and set fixed limits ggplot(df1, aes(x=as.factor(spei), y=as.factor(month), fill = cut(cor, zCuts))) + geom_tile() + scale_fill_gradient(limits = c(-0.7, 0.7)) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid

Re: [R] Rstudio does not run on ubuntu 20

2020-06-15 Thread Thierry Onkelinx via R-help
Dear Luigi, This is rather an RStudio problem than an R problem. I suggest contacting RStudio or their community help forum at https://community.rstudio.com/ Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN

Re: [R] Package renv and Rscript

2020-04-14 Thread Thierry Onkelinx via R-help
Dear Ben, I think that you first need to go to your project and then start Rscript from that location. renv() needs to pick up the .Renviron file located at the root of your project. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders

Re: [R] to create a new variable based on values in other variables

2020-04-07 Thread Thierry Onkelinx via R-help
Dear Ding, It seems that you are looking for the ifelse() function. Clear use of pmax() and pmin() reduces the number of if statements. m1 <- c(12, 23, 22, 23) m2 <- c(23, 23, 3, 5) Ravg <- ifelse( pmax(m1, m2) == 23, pmin(m1, m2), (m1 + m2) / 2 ) Best regards, ir. Thierry

Re: [R] stats::power.t.test error

2019-10-04 Thread Thierry Onkelinx via R-help
a better understanding of power calculation by doing such exercise. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics &

[R] mutate() error

2019-09-05 Thread Thierry Onkelinx via R-help
o default df is a data.frame, id_column a string, all functions are imported. Can someone explain to me why I'm getting this error? Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITU

Re: [R] linear mixed model required for the U.S. FDA

2019-08-19 Thread Thierry Onkelinx via R-help
0265 1.4471 2.0243 1.4092 Precision for subject_T (component 2) 1.3545 0.2436 0.9350 1.3345 1.8913 1.2962 Rho1:2 for subject_T 0.9176 0.0236 0.8631 0.9205 0.9551 0.9261 Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid /

Re: [R] Simulate I x J contingency tables using correlation coefficient using bivariate normal distribution

2019-08-19 Thread Thierry Onkelinx via R-help
atrix(correl, ncol = length(lambda), nrow = length(lambda)) diag(sigma) <- 1 binorm <- rmvnorm(n, sigma = sigma) bip <- apply(binorm, 2, pnorm) bipois <- sapply( seq_along(lambda), function(i) { qpois(bip[, i], lambda = lambda[i]) } ) plot(bipois) table(data.frame(bipois)) Be

Re: [R] Debugging Rmarkdown

2019-04-18 Thread Thierry Onkelinx via R-help
Dear Patrick, This is not easy to debug without a reprex I would check the content of zzz and wide.i in the loop str(wide.i) zzz <- rbind(zzz, wide.i) str(zzz) Note that the Rmd always runs in a clean environment. This might explain the difference Best regards, ir. Thierry Onkel

Re: [R] Why does R do this?

2019-01-08 Thread Thierry Onkelinx via R-help
3)] ) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkel...@inbo.be

Re: [R] R code for if-then-do code blocks

2018-12-17 Thread Thierry Onkelinx via R-help
ed = {d1 %>% rownames_to_column("ID") %>% mutate(test1 = NA, test2 = NA, test4 = NA, test5 = NA) %>% ddply("ID", within, if (gender == "f" & workshop == 1) { test1 <- 1 test1 <- 6 + test1 test2 <-

Re: [R] Request for aid in first R script

2018-11-19 Thread Thierry Onkelinx via R-help
Dear Kepler, Yes, R can do this all. But this is is to help you when you get stuck, not to do all the work for you... You are asking basic stuff, so any introduction book on R should contain sufficient information to get you going. So please do read on of those first. Best regards, ir. Thierry

Re: [R] Using rmarkdown with many plots created in a loop

2018-08-20 Thread Thierry Onkelinx
d <- paste(rmd, collapse = "\n") cat(rmd) ``` ```{r results = "asis"} rendered <- knit(text = rmd, quiet = TRUE) cat(rendered, sep = "\n") ``` The child.Rmd file ## ID {{x}} ```{r, fig.cap = "The caption: ID = {{x}}", echo = FALSE} i <- {{x}} detail

Re: [R] initiate elements in a dataframe with lists

2018-07-25 Thread Thierry Onkelinx
Dear Bogdan, You are looking for x$intersectA <- vector("list", nrow(x)) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie &am

Re: [R] Help with knitr pkg

2018-07-19 Thread Thierry Onkelinx
(when knitr is not loaded). Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thier

Re: [R] scale_y_continuous with sec.axis

2018-07-17 Thread Thierry Onkelinx
Dear Anonymous, Please do read the help file: https://ggplot2.tidyverse.org/reference/sec_axis.html If you read it carefully you'll understand that is doesn't pick a time series. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT

Re: [R] (no subject)

2018-07-16 Thread Thierry Onkelinx
Dear Laura, I came across the anipaths package (https://cran.r-project.org/web/packages/anipaths/vignettes/anipaths.html) It might be useful for you. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK

Re: [R] Dinamic variables in loop

2018-05-08 Thread Thierry Onkelinx
Dear Laura, It looks like you want to remove all rows for which each column is NA. You can to that with the code below. na.matrix <- is.na(MyData) all.na.row <- apply(na.matrix, 1, all) MyData[!all.na.row, ] Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Ov

Re: [R] Merging dataframes

2018-05-02 Thread Thierry Onkelinx
able_B, by = "Email") anti_join(Table_B, Table_A, by = "Email") Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kw

Re: [R] Copy text from Script syntax into .txt

2018-04-24 Thread Thierry Onkelinx
Dear Roberto, The easiest way IMHO is to convert your script into an R markdown document. See https://rmarkdown.rstudio.com/ Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE

Re: [R] Reasons to Use R in a Public Administrations and Ideas for a Short Training

2018-04-19 Thread Thierry Onkelinx
. And you significantly reduce the need to copy/paste results. Think about a list of packages which you can recommend to your audience. I would consider the tidyverse collection. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT

Re: [R] iterative read - write

2018-04-17 Thread Thierry Onkelinx
. Here is some pseudo code. my_summary <- function(input) { raw <- read.table(input) summarised <- summary(raw) output <- calculate_output(input) write.csv(summarised, output) } inputs <- list.files("raw/data/path") sapply(inputs, my_summary) Best regar

Re: [R] lintr error

2018-04-02 Thread Thierry Onkelinx
Try to (re-)install magrittr. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality A

[R] Problem with reading data from an UTF-16 database

2018-03-14 Thread Thierry Onkelinx
1] drat_0.1.3 bit_1.1-12 odbc_1.1.2 compiler_3.4.3 hms_0.3 tools_3.4.3pillar_1.2.1 tibble_1.4.2 [9] yaml_2.1.17Rcpp_0.12.14 bit64_0.9-7blob_1.1.0 rlang_0.2.0fortunes_1.5-4 ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders I

Re: [R] Precision in R

2018-02-26 Thread Thierry Onkelinx
This is described in R FAQ 7.31 ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thier

Re: [R] glm package - Negative binomial regression model - Error

2018-02-26 Thread Thierry Onkelinx
Dear Paula, There are probably missing observations in your data set. Read the na.action part of the glm help file. na.exclude is most likely what you are looking for. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR

Re: [R] Take the maximum of every 12 columns

2018-02-20 Thread Thierry Onkelinx
The maximum over twelve columns is the maximum of the twelve maxima of each of the columns. single_col_max <- apply(x, 2, max) twelve_col_max <- apply( matrix(single_col_max, nrow = 12), 2, max ) ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Fl

Re: [R] Error while working with png output on linux server

2018-02-01 Thread Thierry Onkelinx
Dear Sanjeev, It seems that you system neither supports X11 devices nor cairo devices. See http://lmgtfy.com/?q=R+unable+to+open+connection+to+X11 for possible solutions. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR

Re: [R] Could the Odds represent weight in Generalized Linear Model?

2018-01-31 Thread Thierry Onkelinx
Dear Lenny, \beta_1 is the log odds ratio for age. If you want the odds ratio, then you need to calculate it. It looks like some reading up on glm won't harm you. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR

Re: [R] Could the Odds represent weight in Generalized Linear Model?

2018-01-30 Thread Thierry Onkelinx
Dear Lenny, You can do this by using Age as an offset factor. dataset$wAge <- dataset$Age * 1.02 glm(cbind(Yes,No) ~ offset(wAge) + Times + Type, family=binomial, data = dataset) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Fland

Re: [R] Help making first dataset R package

2018-01-17 Thread Thierry Onkelinx
. Note that R is case sensitive. the extension should be .RData instead of Rdata. See https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN

Re: [R] Packages couldn't load

2018-01-16 Thread Thierry Onkelinx
You need to make sure that the rJava package is working. Consider using the readxl package instead of xlsx. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST

Re: [R] Finding center of mass in a hydrologic time series

2017-12-16 Thread Thierry Onkelinx
Slightly faster: sum(cumsum(hyd) <= .5 * sum(hyd)) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Bio

Re: [R] overlay two histograms ggplot

2017-12-14 Thread Thierry Onkelinx
Dear Elahe, Something like joint <- rbind( data.frame(x = gg$Az, veg = gg$veg, type = "Alz"), data.frame(x = tt$Cont, veg = gg$veg, type = "Cont") ) ggplot(joint, aes(x = x, fill = veg, colour = type)) + geom_plot(alpha = 0.2) Best regards, ir. Thierry Onkelinx Sta

Re: [R] Preventing repeated package installation, or pre installing packages

2017-11-29 Thread Thierry Onkelinx
Dear Larry, Have a look at https://github.com/inbo/rstable That is a dockerfile with a stable version of R and a set of packages. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE

Re: [R] Multiple sets of proportion tests

2017-11-24 Thread Thierry Onkelinx
Hi anonymous, ?prop.test states that it returns a list. And one of the element is 'p.value'. str() on the output of prop.test() reveals that too. So prop.test()$p.value or prop.test()["p.value"] should work. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaams

Re: [R] number to volume weighted distribution

2017-11-24 Thread Thierry Onkelinx
wx), ylim = 0:1) Best regards, Thierry ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance t

Re: [R] weighted average grouped by variables

2017-11-09 Thread Thierry Onkelinx
Dear Massimo, It seems straightforward to use weighted.mean() in a dplyr context library(dplyr) mydf %>% group_by(date_time, type) %>% summarise(vel = weighted.mean(speed, n_vehicles)) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Gove

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread Thierry Onkelinx
The combination of list.files(), gsub() and file.rename() should to the trick. ir. Thierry Onkelinx Statisticus/ Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg /

Re: [R] Add wrapper to Shiny in R package

2017-09-21 Thread Thierry Onkelinx
Dear Axel, I've used environment for such problems. assign("xs", xs, envir = my.env) in the myApp function get("xs", envir = my.env) in the server function Best regards, ir. Thierry Onkelinx Statisticus/ Statiscian Vlaamse Overheid / Government of Flanders INSTI

Re: [R] Keep on getting message errors when trying to install and load packages

2017-09-21 Thread Thierry Onkelinx
Dear Paul, We install R in C:/R/R-x.y.z and packages in C:/R/library. This makes the packages location independent from the R version. Best regards, ir. Thierry Onkelinx Statisticus/ Statiscian Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH

Re: [R] Keep on getting message errors when trying to install and load packages

2017-09-21 Thread Thierry Onkelinx
. Thierry Onkelinx Statisticus/ Statiscian Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkel...@inbo.be Kliniekstraat 25, B-1070

Re: [R] Shiny App inside R Package

2017-09-17 Thread Thierry Onkelinx
Dear Axel, I tend to place Shiny apps in the "inst" directory of the package. See https://stackoverflow.com/questions/37830819/developing-shiny-app-as-a-package-and-deploying-it-to-shiny-server Best regards, ir. Thierry Onkelinx Statisticus/ Statiscian Vlaamse Overheid / Government o

Re: [R] post_processor in rmarkdown not working

2017-09-08 Thread Thierry Onkelinx
from https://github.com/inbo/inbomd_examples. Note that you need some extra work after installing INBOmd to inbo_rapport() to run. See the README at https://github.com/inbo/INBOmd I've created an issue https://github.com/rstudio/rmarkdown/issues/1138 ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Thierry Onkelinx
nning the post_processor manually works. eval(parse( text = readLines( " https://raw.githubusercontent.com/inbo/INBOmd/post_processor/R/rsos_article.R " )[72:92] )) post_processor(output_file = "skeleton.tex") system("pdflatex skeleton.tex") Best regards, i

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Thierry Onkelinx
Dear Heinz, Yes. The idea of the post_processor() is that 1) pandoc converts the .md to .tex 2) the post_processors changes the .tex 3) the .tex is compiled into .pdf Hence the post_processors need to read, change and overwrite the tex output file. Best regards, ir. Thierry Onkelinx Instituut

[R] post_processor in rmarkdown not working

2017-09-06 Thread Thierry Onkelinx
width = 60, concordance = TRUE ), opts_chunk = opts_chunk, knit_hooks = knit_hooks ), pandoc = pandoc_options( to = "latex", latex_engine = "xelatex", args = args, keep_tex = keep_tex ), post_processor = post_processor,

Re: [R] PROC MIXED RANDOM equivalence in R nlme

2017-08-11 Thread Thierry Onkelinx
of observation per group is useful too. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the stat

Re: [R] Has For bucle be impooved in R

2017-08-07 Thread Thierry Onkelinx
01 909.9946 939.6379 2476.415 100 a Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the stati

Re: [R] climate data-set; aggregate date (day)

2017-08-03 Thread Thierry Onkelinx
library(dplyr) library(lubridate) data %>% group_by(floor_date(Timestamp, unit = "day")) %>% summarise(rain = sum(Rain_mm_tot)) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team

Re: [R] ggplot problem

2017-05-24 Thread Thierry Onkelinx
Dear Greg, Make sure that your x variable (Betas) is categorical. That is required for geom_boxplot(). And please do read the posting guide. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteits

Re: [R] Logical Operators' inconsistent Behavior

2017-05-19 Thread Thierry Onkelinx
UE/FALSE against unknown hence the output is unknown. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistic

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Thierry Onkelinx
other situations it might be more of an issue. The workaround (NA -> FALSE, basically) is in place in R-patched and R-devel. -pd > On 28 Apr 2017, at 07:47 , Thierry Onkelinx <thierry.onkel...@inbo.be> wrote: > > We have several computers with the same problem. > > Op 28

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-27 Thread Thierry Onkelinx
We have several computers with the same problem. Op 28 apr. 2017 7:25 a.m. schreef "Jean-Claude Arbaut" : Hello, I am currently getting a strange error when I call installed.packages(): Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && : missing

Re: [R] Frequency of Combinations

2017-04-25 Thread Thierry Onkelinx
Dear Mustafa, Please keep the mailing list in cc. Since you claim to have written the code, you can share the code so we can review it. That makes more sense than having us to write code for you... Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute

Re: [R] Frequency of Combinations

2017-04-24 Thread Thierry Onkelinx
combination 3. select the relevant drugs in sheet 2 with filter() 4. join long sheet 1 and filtered sheet2 with inner_join() 5. summarise() the drug codes and names after group_by(patient_id) 6. count() the number of drug codes. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek

Re: [R] GLMM for Combined experiments and overdispersed data

2017-04-24 Thread Thierry Onkelinx
Please don't cross post. You've send the message to the mixed models mailing list as well (which more appropriate). ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality A

Re: [R] passing API key in leaflet

2017-03-30 Thread Thierry Onkelinx
) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done

Re: [R] Archive format

2017-03-29 Thread Thierry Onkelinx
, XML, JSON, ... will depend upon the data (and the metadata). Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium

[R] passing API key in leaflet

2017-03-25 Thread Thierry Onkelinx
ry(leaflet) leaflet() %>% addProviderTiles( "Thunderforest.OpenCycleMap", options = providerTileOptions(apikey = Sys.getenv("OCM_API")) ) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team

Re: [R] Post hoc comparisons for interaction effects linear mixed effects models (lm4)

2017-03-25 Thread Thierry Onkelinx
Dear Katherina, Multcomp can't handle interactions automatically. You need to create the contrasts manually. Best regards, Thierry Op 25-mrt.-2017 08:13 schreef "Katharina Voigt" : > Hi, > I want to obtain post hoc comparisons for a model with a three-way >

Re: [R] Options for bootstrapped CIs for indirect effect: Nested data structure, missing data, and fully continuous X variable

2017-03-20 Thread Thierry Onkelinx
could use the boot package as Bert suggested. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the stat

Re: [R] inadverted reordering of a df column when it is copied to another df

2017-03-17 Thread Thierry Onkelinx
Dear Karl, This is hard to investigate without a reproducible example. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 An

Re: [R] weird ggplot geom_segment behaviour

2017-03-17 Thread Thierry Onkelinx
Dear Petr, Don't use xlim() but rather coord_cartesian(xlim = ...). See https://rpubs.com/INBOstats/zoom_in Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality A

Re: [R] display UTF8 characters in pdf

2017-03-12 Thread Thierry Onkelinx
Dear all, Thanks to Ista and Olivier. The solution of Ista works for some characters but not all. The solution of Olivier works, at least for the characters that I've tried. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team

[R] display UTF8 characters in pdf

2017-03-10 Thread Thierry Onkelinx
mand gives several similar warnings, all related to the symbols which are not rendered properly: Warning messages: 1: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label), ... : conversion failure on '' in 'mbcsToSbcs': dot substituted for I'm running R 3.3.2 under Ubuntu 16.04.1 and ggplot

Re: [R] How to speed this up?

2017-02-28 Thread Thierry Onkelinx
able(region = prefix$region)) ) system.time({ prefix.sample <- sample(prefix$prefix, n, prob = prefix$Freq, replace = TRUE) nums <- apply( matrix( sample(0:9, 6 * n, replace = TRUE), ncol = 6 ), 1, paste, collapse = "" ) phonenumbers <- pas

Re: [R] legend in ggplot2

2017-02-02 Thread Thierry Onkelinx
e", Shore = "red")) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician

Re: [R] HELP lme4 & lmerTest INSTALLATION

2017-01-25 Thread Thierry Onkelinx
Dear Rui, nlme is a recommended package, lme4 is (currently) not. You need to install it. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Klinieks

Re: [R] Suggestions for vectorizing/double loop

2017-01-23 Thread Thierry Onkelinx
Dear Luanna, Assuming that oldnames and newnames are character (and not factor), the just use stringsAsFactors = FALSE. That will save you from having to convert the factors back to character. data.frame(oldnames, newnames, stringsAsFactor = FALSE) Best regards, ir. Thierry Onkelinx Instituut

Re: [R] Adding regression line to each individual plot in a window with multiple plots

2017-01-18 Thread Thierry Onkelinx
t;, "Xvalue", XA:XB) %>% gather("Ycat", "Yvalue", YA:YB) # create the plot library(ggplot2) ggplot(long, aes(x = Xvalue, y = Yvalue)) + geom_smooth(method = "lm") + geom_point() + facet_grid(Ycat ~ Xcat, scales = "free") Best regards,

Re: [R] Sweave: Incorporating warnings into a Sweave output chunck

2017-01-04 Thread Thierry Onkelinx
Dear Duncan, I'd recommend to switch from Sweave to knitr. Knitr has more options for handling warnings and errors than Sweave. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biomet

Re: [R] Any help on R code interpretation?

2016-12-22 Thread Thierry Onkelinx
Dear Marna, It's a combinations of two functions: %*% and t() help("%*%") and help("t") will open their helpfiles. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / t

Re: [R] ggplot aestetics: beginner question - I am lost in endless possibilites

2016-12-15 Thread Thierry Onkelinx
Here is a solution ggplot(exdatframe2) + geom_tile(aes(x = exdatframeT, y = Name, fill = knownstate), colour = "black", height = 0.5) + scale_fill_discrete(na.value = "white") Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research

Re: [R] Benefit of Iterators (package iterator)

2016-12-08 Thread Thierry Onkelinx
b Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is do

Re: [R] Inconsistency of 1^NA=1 vs. 1.1^NA=NA

2016-11-17 Thread Thierry Onkelinx
Dear Da, NA represents an unknown value x. 1 ^ x = 1 for all possible values of x. Hence 1 ^ NA = 1. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality A

Re: [R] Documenting a function using roxygen2

2016-10-11 Thread Thierry Onkelinx
the author, license and version at the package level. devtools and Roxygen make it very easy to create a package. Even if it would contain only one or a few functions. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie

Re: [R] Question about ggplot2 symbol and legend change

2016-10-11 Thread Thierry Onkelinx
Dear Luis, Please don't post in HTML, it mangles the code. You want something like p + scale_shape_manual(values = c(16, 2)) Untested as you failed to provide a reproducible example. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature

Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread Thierry Onkelinx
Dear Roger, Maybe you want to return(mod) instead of return(mod$coef) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 An

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Thierry Onkelinx
Here is a ggplot2, tidyr, dplyr solution library(tidyr) library(dplyr) library(ggplot2) ds %>% gather() %>% group_by(key) %>% summarize(total = sum(value)) %>% ggplot(aes(x = key, y = total)) + geom_bar(stat = "identity") ir. Thierry Onkelinx Instituut voor n

Re: [R] R-package (“SeCuredSurv”)

2016-09-27 Thread Thierry Onkelinx
Dear Anonymous, It's seems like that package never made it to CRAN. You should contact the package author or the author of the reference. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg /

Re: [R] commercial license

2016-09-12 Thread Thierry Onkelinx
Dear Benjamin, Have a look at FAQ 2.11: https://cran.r-project.org/doc/FAQ/R-FAQ.html#Can-I-use-R-for-commercial-purposes_003f Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biomet

Re: [R] digital online identifier (doi) CRAN manual?

2016-09-11 Thread Thierry Onkelinx
Dear Stephen, I use https://zenodo.org/ to get a DOI for a package. E.g. http://dx.doi.org/10.5281/zenodo.48423 Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics &

Re: [R] nlme: fewer observations than random effects in all level 1 groups

2016-08-26 Thread Thierry Onkelinx
a model to only 4 points. fit1 <- lme(value ~ time * CorT, random = ~1|SS, data = data10) fit2 <- lme(value ~ time * CorT, random = ~time|SS, data = data10) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Bio

Re: [R] lme to determine if there is a group effect

2016-08-25 Thread Thierry Onkelinx
of question. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is

Re: [R] Reducing execution time

2016-07-27 Thread Thierry Onkelinx
A reproducible example makes your problem easier to understand. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium

Re: [R] Has R recently made performance improvements in accumulation?

2016-07-19 Thread Thierry Onkelinx
6, Adjusted R-squared: 0.9624 F-statistic: 3829 on 4 and 595 DF, p-value: < 2.2e-16 ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Ander

Re: [R] Lake Analyzer Help

2016-07-13 Thread Thierry Onkelinx
Please keep the mailing list in cc. See http://adv-r.had.co.nz/Reproducibility.html for some instructions. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Klinieks

  1   2   3   >