[R] Axis scaling for PCA biplot

2022-11-15 Thread Christian Hennig
Hi there, I'm puzzled about the axis scaling in the PCA biplot. Here's an example. library(pdfCluster) # package cepp seems to have the same data set. data(oliveoil) # 572 observations 10 variables olive <- oliveoil[,3:10] # numerical variables prolive <- princomp(olive) summary(prolive) # Im

[R] Issue installing gamm4 for R v4.2.2

2022-11-15 Thread Nedelec, Pierre via R-help
Hello, I'm having issues installing the package gamm4 with R v4.2.2. It seems to fail because of the required package minqa. (ERROR: compilation failed for package �minqa� below). minqa is not listed as a requirement on the gamm4 package, but maybe it i

[R] Initial value choosing in nleqslv package

2022-11-15 Thread ASHLIN VARKEY
In my work, I use l-moments for estimation and obtain a system of nonlinear equations. I am using the 'nleqslv' package in the R- program to solve these equations but am struggling to choose initial values. Is there any criteria to choose initial values in this package or is there any other method

Re: [R] Initial value choosing in nleqslv package

2022-11-15 Thread Ebert,Timothy Aaron
I would suggest treating initial values as hyperparameters. Try a range of values to understand how your choice influences your outcome. Plot the result. Eventually (I hope) you will get a feel for the right answer for your specific type of data and you will be able to reduce the time needed for

Re: [R] Initial value choosing in nleqslv package

2022-11-15 Thread Jeff Newmiller
There is a reason linear algebra techniques are so popular... they are much more deterministic than nonlinear techniques. Deriving a method of starting a nonlinear optimization is highly specific to the equations, not to the optimization algorithm. In some cases you can create an approximation u

[R] 2023 John M. Chambers Software Award

2022-11-15 Thread Raymond Wong via R-help
Dear R-help listers, The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers Statistical Software Award. In 1998 the Association for Computing Machinery (ACM) presented the ACM Software System Award to John Chambers for the de

Re: [R] Issue installing gamm4 for R v4.2.2

2022-11-15 Thread Ivan Krylov
Hello Pierre, Thank you for providing both sessionInfo() and the installation log, it's very helpful! В Mon, 14 Nov 2022 20:48:13 + "Nedelec, Pierre via R-help" пишет: > /usr/local/opt/gcc/bin/gfortran -fno-optimize-sibling-calls -fPIC > -g -O2 -c altmov.f -o altmov.o ... > clang (LLVM op

Re: [R] Initial value choosing in nleqslv package

2022-11-15 Thread J C Nash
A rather crude approach to solving nonlinear equations is to rewrite the equations as residuals and minimize the sum of squares. A zero sumsquares gives a solution. It is NOT guaranteed to work, of course. I recommend a Marquardt approach minpack.lm::nlslm or my nlsr::nlfb. You will need to spec

Re: [R] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-15 Thread Bert Gunter
1. Not developers, helpers (though there may be some developers among us, too). Ergo, we don't make changes to code or man pages either. 2. If no satisfactory reply here, R-Sig-mixed-models is where you should post. And post there first for mixed models questions in future. Cheers, Bert On Mon,

Re: [R] Initial value choosing in nleqslv package

2022-11-15 Thread Bert Gunter
I addition to the advice you have already received, you might have a look here, https://cran.r-project.org/web/views/Optimization.html to see if there might be tools to assist in your 'metasearch' . I wouldn't be surprised if that is a vain hope for the reasons you have already been given, but it c

[R] add specific fields in for loop

2022-11-15 Thread Kai Yang via R-help
Hi Team, I can write a for loop like this: for (i in columns(df)){   .. } But it will working on all column in dataframe df. If I want to work on some of specific fields (say: the fields' name content 'date'), how should I modify the for loop? I changed the code below, but it doesn't work. f

Re: [R] add specific fields in for loop

2022-11-15 Thread Bert Gunter
There is no function columns() in base R. Is 'date' an object that contains column names or indices? Or do you mean that it is a string that appears in the column names you wish to loop over? A small reprex should be easy to provide to show us explicitly what you want. Please do so -- unless, of c

Re: [R] add specific fields in for loop

2022-11-15 Thread avi.e.gross
Kai, As Bert pointed out, it may not be clear what you want. As a GUESS, you have some arbitrary data.frame object with multiple columns and you want to do something on selected columns. Consider changing your idea to be in several stages for simplicity and then optionally later rewriting it.

Re: [R] add specific fields in for loop

2022-11-15 Thread Kai Yang via R-help
Hello Bert and Avi,Sorry, it is typo. it should be: for (i in colnames(df)){   .. } below is the code I'm currently using try2.un$ab2 <-   ifelse(grepl("ab2",try2.un$data1), try2.un$data1,          ifelse(grepl("ab2",try2.un$data2), try2.un$data2,                 ifelse(grepl("ab2",try2.un$dat

Re: [R] add specific fields in for loop

2022-11-15 Thread Rui Barradas
Às 16:18 de 15/11/2022, Kai Yang via R-help escreveu: Hi Team, I can write a for loop like this: for (i in columns(df)){   .. } But it will working on all column in dataframe df. If I want to work on some of specific fields (say: the fields' name content 'date'), how should I modify the f

Re: [R] add specific fields in for loop

2022-11-15 Thread Kai Yang via R-help
Hello Rui, Yes, it should be the one I want. I modified the code as: for(i in grep("data", names(df))) {   try2.un$ab2 <-     ifelse(grepl("ab2",  [i]),   [i], NA) } But I got error message:  Error: unexpected '[' in: "  try2.un$ab2 <-     ifelse(grepl("ab2",[" I think I use [i] in a wrong way.

Re: [R] add specific fields in for loop

2022-11-15 Thread Rui Barradas
Às 19:39 de 15/11/2022, Kai Yang escreveu: Hello Rui, Yes, it should be the one I want. I modified the code as: for(i in grep("data", names(df))) {   try2.un$ab2 <-     ifelse(grepl("ab2",  [i]),   [i], NA) } But I got error message: Error: unexpected '[' in: "  try2.un$ab2 <-     ifelse(gre

Re: [R] add specific fields in for loop

2022-11-15 Thread Kai Yang via R-help
Hi Rui, This is a great help. Thank you, Kai On Tuesday, November 15, 2022 at 11:48:12 AM PST, Rui Barradas wrote: Às 19:39 de 15/11/2022, Kai Yang escreveu: > Hello Rui, > Yes, it should be the one I want. I modified the code as: > > for(i in grep("data", names(df))) { >    try2.un$ab

[R] picewiseSEM undefined columns selected

2022-11-15 Thread Michael Eisenring
Dear r-help list members, I would like to run a pathway analysis using the R-package piecewiseSEM (v.2.12). I used a very simple model structure that is similar to the example in the piecewiseSEM description. Unfortunatley, once I execute the "as.psem" function I get the error "Error in `[.data

Re: [R] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-15 Thread Iago
Dear Bert and all other "helpers", I agree that not all of you are developers. If I look at the DESCRIPTION of the nlme package I can see the next: Contact: see 'MailingList' BugReports: https://bugs.r-project.org MailingList: R-help@r-project.org Maintainer: R Core Team As

Re: [R] add specific fields in for loop

2022-11-15 Thread avi.e.gross
Kai, I have read all the messages exchanged so far and what I have not yet seen is a clear explanation of what you want to do. I mean not as R code that may have mistakes, but as what your goal is. Your code below was a gigantic set of nested if statements that is not trivial to parse.

Re: [R] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-15 Thread Andrew Simmons
This seems to be a bug. I tried creating this function in the global environment: str.pdMat <- function (object, ...) { if (nlme::isInitialized(object)) { NextMethod() } else { cat(" Uninitialized positive definite matrix structure of class ", class(object)[

Re: [R] add specific fields in for loop

2022-11-15 Thread Kai Yang via R-help
Hi Avi, Thank you spent time for my question. Your explanations is very clear and abundant. I use R for a shot time and still keep learning. So, my question may not very clear for your guys. sorry about that. Thank you again, KaiOn Tuesday, November 15, 2022 at 02:54:38 PM PST, avi.e.gr...@