Re: [R] Stats Package Fix

2019-08-07 Thread Abby Spurdle
(excerpts only) > Using this file, with the tab for Growth_Value (I have pasted some code > below), if I add the argument *exact = F *it produces the Wilcoxon signed > rank test with continuity correction. The description documentation leads > me to believe that's the wrong argument (should be the

Re: [R] Simulations of GAM and MARS models : sample size ; Y-outliers and missing X-data

2019-08-07 Thread Abby Spurdle
Sorry. Some more comments. (1) If you want an arbitrary sample size, you may need to write a function to produce a simulated data set, for that given sample size. Alternatively, you can use a random sample of size n, of an initial data set, assuming the initial data set is relatively large. (2) Fo

[R] Help with saving model created using caret's train function into a readable format

2019-08-07 Thread Kevin Cai
Hello all, I am trying to port some R code over to Python for someone else. In particular, I want to save a model/object created using the train function from the caret package: model <- train( x, y, trControl = trcontrol_1, tuneGrid = xgbGrid_1, method = "xgbTree" ) 'model' is l

[R] Stats Package Fix

2019-08-07 Thread Jay Waldron
Good afternoon, Using this file, with the tab for Growth_Value (I have pasted some code below), if I add the argument *exact = F *it produces the Wilcoxon signed rank test with continuity correction. The description documentation leads me to believe that's the wrong argument (should be the "corre

Re: [R] Simulations of GAM and MARS models : sample size ; Y-outliers and missing X-data

2019-08-07 Thread Abby Spurdle
> How can I modify my R codes to simulate the sample size, the presence of Y-outliers and the presence of missing data ? I don't know what it means for data to have 50% Y-outliers. That's new to me... As for the rest of your question. Modify your code so that a single function, say sim.test() com

Re: [R] Help with if else statement

2019-08-07 Thread Jim Lemon
Hi Ana, Or just for a bit of fun: pt<-read.table(text="eidQ phenoQ phenoH 117 -9 -9 125 -9 -9 138 -9 1 142 -9 -9 156 -9 -9 174 -9 -9 138 -9 1 1000127 2 1 1000690 2 -9 1000711 2

Re: [R] Help with if else statement

2019-08-07 Thread Bert Gunter
The ifelse() construction is fast, but after a couple of nested iterations, it gets messy and error-prone; so I believe to be avoided. In your case, there is a much better alternative, ?pmax . Ergo, something like: pt$pheno <- do.call(pmax, pt[, -1]) ?do.call is necessary to pass the list of col

Re: [R] Help with if else statement

2019-08-07 Thread Andrew Robinson
pmax() should work in this instance, as in any case you want the larger value. Andrew -- Andrew Robinson Director, CEBRA, School of BioSciences Reader & Associate Professor in Applied Statistics Tel: (+61) 0403 138 955 School of Mathematics and Statistics Fax: (+61) 03 8344 4599 University of Mel

Re: [R] Help with if else statement

2019-08-07 Thread Ana Marija
does this look ok: pt$pheno=ifelse(pt$phenoQ==-9 & pt$phenoH==-9,-9,ifelse(pt$phenoH==2 | pt$phenoQ==2,2,1)) On Wed, Aug 7, 2019 at 1:40 PM Ana Marija wrote: > > Hello, > > I have a data frame which looks like this: > > > head(pt) > eidQ phenoQ phenoH > 1 117 -9 -9 > 2 125

[R] Help with if else statement

2019-08-07 Thread Ana Marija
Hello, I have a data frame which looks like this: > head(pt) eidQ phenoQ phenoH 1 117 -9 -9 2 125 -9 -9 3 138 -9 1 4 142 -9 -9 5 156 -9 -9 6 174 -9 -9 7 138 -9 1 8 1000127 2 1 9 1000690 2

Re: [R] shinyWidgets::sliderTextInput

2019-08-07 Thread Erin Hodgess
Hi Sigbert Here is something that has both the sliderTextInput and Radio Buttons, which may be helpful: library("shiny") library("shinyWidgets") ui <- fluidPage( br(), sliderTextInput( inputId = "mySliderText", label = "My House", choices = list("choice 1" = "choice 1","c

[R] Understanding parameters of ugarch and DCC

2019-08-07 Thread Tommaso Ferrari
Dear all, I'm using *rugarch* and *rmgarch *to implement a DCC model over 30 different assets. While using *ugarchspec *for defining input parameters of univariate GARCH using a t-Student distribution, I have noticed that there is a parameter called *fixed.pars*. Using the example given in GitHub,

[R] [R-pkgs] New functions in ethnobotanyR 0.1.5

2019-08-07 Thread Cory Whitney
ethnobotanyR 0.1.5 is a patch. The package now includes four new functions: Updated UVs() following Tardio and Pardo-de-Santayana (2008) simple_UVs() now calculates a simple UVs cf. Albuquerque et al. (2006). Fidelity level per species FLs() from Friedman et al. (1986) is added. Now includes th

[R] Simulations of GAM and MARS models : sample size ; Y-outliers and missing X-data

2019-08-07 Thread varin sacha via R-help
Dear Experts, I have fitted MARS and GAM models on a real dataset. My goal is prediction. I have run crossvalidation many times to get an idea of the out-of-bag accuracy value. I use the Mean Squared Error (MSE) as an error evaluation criterion. I have published my paper and the reviewers ask m

Re: [R] shinyWidgets::sliderTextInput

2019-08-07 Thread Sigbert Klinke
Hi, Is there a label argument, please? I think that might be it. In my example I had a label, but this not the problem since > choices=list("choice1"=1, "choice2"=2,"choice3"=3) > as.character(choices) [1] "1" "2" "3" delivers the result as it is used in sliderTextInput. I was hoping there

Re: [R] filter and add a column

2019-08-07 Thread Eric Berger
Here is a different approach that does not involve dplyr or the creation of the intermediate data frame 'controls' f <- function(v) { any(v %in% c("E109","E119","E149")) & any(v %in% c("Caucasian")) & any(v %in% c("No kinship found","Ten or more third-degree relatives identified")) } tot$co