Re: [R] for loop implementation in below problem

2021-03-21 Thread Jim Lemon
Hi Goyani, You are setting "PRE" to the return value of "if" which is one of TRUE (1), FALSE(0) or NULL. Because GAY is always missing in your example, "PRE" is always set to 1. Then you always want to pass 1 in the sample list, and that will not assign anything to PRE. By correcting the "if"

[R-es] cv.fitted en gbm

2021-03-21 Thread Manuel Mendoza
Buenos días. He utilizado fit$cv.fitted en gbm para obtener las predicciones OOF (por CV), para regresión, y funciona perfectamente. Sin embargo, cuando lo aplico con clasificación multiclase me sale una matriz con tantas columnas como clases tiene la variable objetivo. Primero pensé que serían

[R] using aws.s3::s3 sync to dowlaod files from public s3 Bucket without credentials?

2021-03-21 Thread nevil amos
Hi I am developing a package that reives on some large datasets stored in aws s3. I have made the bucket and all objects in the bucket public, but still cannot sync them to my local directory without providing my AWS key pair. without these credentials I get a "bucket does not exist" message.

Re: [R] Rstudio crashed when I try to train a nnet model.

2021-03-21 Thread Jiefei Wang
Hi Baki, This should be a different issue. It looks like there is no problem in the R terminal. Does the crash happen every time when you run the code in RStudio? If so, this should be a bug in RStudio and you need to consult RStudio's mailing list as R and RStudio are maintained by different

Re: [R] for loop implementation in below problem

2021-03-21 Thread Jim Lemon
Hi Goyani, In its present form, the function stalls because you haven't defined pmat before trying to pass it to the function. gmat and wmat suffered the same fate. Even if I define these matrices as I think you have, "solve" fails because at least one is singular. First, put the function in order

Re: [R] Colorizing contribution of variables

2021-03-21 Thread Mahmood Naderan-Tahan
Yes I am using factoextra. >When you choose the argument "contrib" the colors are based on the >strength of the relationship overall (the length of the arrow), not >the contribution of any individual direction. Then, the question is why the legend is not in 0 to 1 scale? Regards, Mahmood

Re: [R] About fviz_famd_ind()

2021-03-21 Thread Sarah Goslee
The way to start is looking at the help for that function, which includes: ... Arguments to be passed to the function fviz() so you may have more low-level control through those arguments. If fviz() itself doesn't do what you want, it also allows you to pass additional arguments to its

Re: [R] Colorizing contribution of variables

2021-03-21 Thread Sarah Goslee
Hi, I am going to assume that you are using factoextra, and are working the example from the function in question, but it would be useful for you to explicitly state that when you're asking a question about a particular package and function. When you choose the argument "contrib" the colors are

[R] for loop implementation in below problem

2021-03-21 Thread Goyani Zankrut
I created custom function according to my requirement which is given below: *selection.index<- function(ID, phen_mat, gen_mat, weight_mat, GAY){ ID = toString(ID) p<- as.matrix(phen_mat) g<- as.matrix(gen_mat) w<- as.matrix(weight_mat) bmat<- solve(phen_mat) %*% gen_mat %*%

Re: [R] Optimization function producing negative parameter values

2021-03-21 Thread J C Nash
This is likely because Hessian is being approximated. Numerical approximation to Hessian will overstep the bounds because the routines that are called don't respect the bounds (they likely don't have the bounds available). Writing numerical approximations that respect bounds and other

Re: [R] Optimization function producing negative parameter values

2021-03-21 Thread Bill Dunlap
Does optim go out of bounds when you specify hessian=FALSE? hessian=TRUE causes some out-of-bounds evaluations of f. > optim(c(X=1,Y=1), > function(XY){print(unname(XY));(XY[["X"]]+1)^4+(XY[["Y"]]-2)^4}, method= > "L-BFGS-B", lower=c(0.001,0.001), upper=c(1.5,1.5), hessian=TRUE) [1] 1 1 [1]

[R] Colorizing contribution of variables

2021-03-21 Thread Mahmood Naderan-Tahan
Hi I use the following function to plot the variables with their contributions. fviz_famd_var(res.famd, "quanti.var", col.var = "contrib", gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"), repel = TRUE) The result can be seen at

Re: [R] Optimization function producing negative parameter values

2021-03-21 Thread J C Nash
Can you put together your example as a single runnable scipt? If so, I'll try some other tools to see what is going on. There have been rumours of some glitches in the L-BFGS-B R implementation, but so far I've not been able to acquire any that I can reproduce. John Nash (maintainer of optimx

[R] Optimization function producing negative parameter values

2021-03-21 Thread Shah Alam
Dear all, I am using optim() to estimate unknown parameters by minimizing the residual sums of squares. I created a function with the model. The model is working fine. The optim function is producing negative parameter values, even I have introduced upper and lower bounds (given in code).

[R] About fviz_famd_ind()

2021-03-21 Thread Mahmood Naderan-Tahan
Hi I use fviz_famd_ind() from factoextra and I would like to know 1) How can I decrease the font size? 2) How to increase max.overlaps? ind <- get_famd_ind(res.famd) fviz_famd_ind(res.famd, col.ind = "cos2", gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"), repel

Re: [R] Rstudio crashed when I try to train a nnet model.

2021-03-21 Thread Baki UNAL via R-help
Hi Jiefei I run the code below in RGui > nn2 <- nnet(TQ~.,data = train, size=c(15,15), linout=T, MaxNWts =4000, > maxit=2000) But I got the following output: # weights:  435initial  value 55650.887782 final  value 55650.887782 converged Program early converged. Program didn't any calculations. 

Re: [R] Rstudio crashed when I try to train a nnet model.

2021-03-21 Thread Jiefei Wang
Hi Baki, Perhaps out of memory? Would you be able to run your code through the R terminal? It probably can give us more information to debug the issue. Best, Jiefei On Mon, Mar 22, 2021 at 12:23 AM Baki UNAL via R-help wrote: > Hi, > I tried to train a neural network with following code: >

[R] Rstudio crashed when I try to train a nnet model.

2021-03-21 Thread Baki UNAL via R-help
Hi, I tried to train a neural network with following code: nn2 <- nnet(TQ~.,data = train, size=c(15,15), linout=T, MaxNWts =4000, maxit=2000) When I executed the code R studio crashed with following error: "R Session Aborted R encountered a fatal error. The session was terminated. Start new

[R] How to average minutes per hour per month in the form of '# hours #minutes'

2021-03-21 Thread Dr Eberhard W Lisse
Hi, I have minutes worked by day (with some more information) which when using library(tidyverse) library(lubridate) run through CONSMINUTES %>% select(datum, dauer) %>% arrange(desc(datum)) look somewhat like # A tibble: 142

Re: [R] R-help Digest, Vol 217, Issue 20

2021-03-21 Thread Bert Gunter
... or a George Box (I believe) said: The crucial "Declaration of Independence." Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Mar 20, 2021 at 4:25 PM