Re: [R] function doesn't exists but still runs.....

2023-01-19 Thread Bill Dunlap
Look into R's scoping rules. E.g., https://bookdown.org/rdpeng/rprogdatascience/scoping-rules-of-r.html. * When a function looks up a name, it looks it up in the environment in which the function was defined. * Functions in a package are generally defined in the package's environment (although

[R] function doesn't exists but still runs.....

2023-01-19 Thread akshay kulkarni
dear members, I am using the RSelenium package which uses the function selenium() from the wdman package. The selenium function contains the function java_check at line 12. If I try to run it, it throws an error: > javapath <- java_check() Error in java_check() :

Re: [R-es] Suma de datos de una tabla

2023-01-19 Thread David Camilo Gomez Medina
Muchas gracias Carlos y Manuel por el aporte, me ayudó bastante. On Thu, 19 Jan 2023 at 04:12, Carlos Ortega wrote: > Hola, > > Sí, he cambiado de forma de hacerlo, así lo tienes directo en un > data.table... > Y sale el 2000 que no sé porqué no salía antes. > >

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Gabor Grothendieck
If the equations are in the form shown in your post then take the log of both sides, expand the logs and replace log(whatever) with new variables so now the equations are in linear form and are easy to solve. __ R-help@r-project.org mailing list -- To

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Søren Højsgaard via R-help
Dear Troels, Are you aware of the caracas package for computer algebra in R? The package provides an interface to the SymPy package in python via the reticulate package. I have no idea if the package can be helpful in your connection, but please report succeses and failures back. Best regards

Re: [R] MLE Estimation of Gamma Distribution Parameters for data with 'zeros'

2023-01-19 Thread Ken Kleinman
There's at least one package that can do zero-inflated gamma regression (Rfast2::zigamma). I'm not sure it's ML, though. On Thu, Jan 19, 2023 at 10:17 AM Jeff Newmiller wrote: > Beware of adding a constant... the magnitude of the constant used can have > an outsized impact on the answer

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Berend Hasselman
If you need to solve a nonlinear system of equations you could have a look at the CRAN Task View: Numerical Mathematics: https://cran.r-project.org/view=NumericalMathematics Specifically look in the subsection "Root Finding and Fixed Points". Berend Hasselman > On 19 Jan 2023, at 10:41,

Re: [R] MLE Estimation of Gamma Distribution Parameters for data with 'zeros'

2023-01-19 Thread Marc Girondot via R-help
Another situation for the presence of 0 is about dosage when concentration is below the detection limit. It is not necessary to discretize the data. We propose a method here: Salvat-Leal I, Cortés-Gómez AA, Romero D, Girondot M (2022) New method for imputation of unquantifiable values using

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Troels Ring
Hi Jeff - that is definitely not fair, this is a highly respected scientist but old me are probably not clever enough to explain problem which I think is not too difficult. Basically, it is a series of consecutive statements of H and Mg and K combining to ATP and ADP, creatin and creatinP

Re: [R] MLE Estimation of Gamma Distribution Parameters for data with 'zeros'

2023-01-19 Thread Jeff Newmiller
Beware of adding a constant... the magnitude of the constant used can have an outsized impact on the answer obtained. See e.g. https://gist.github.com/jdnewmil/99301a88de702ad2fcbaef33326b08b4 On January 19, 2023 3:49:29 AM PST, peter dalgaard wrote: >Not necessarily homework, Bert. There's a

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread J C Nash
A crude but often informative approach is to treat the nonlinear equations as a nonlinear least squared problem. This is NOT a generally recommended solution technique, but can help to show some of the multiple solutions. Moreover, it forces some attention to the problem. Unfortunately, it

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Jeff Newmiller
But it is simultaneously an example of why some researchers like black box solvers... a system of dozens of nonlinear equations can potentially have many or even infinite solutions. If the researcher is weak in math, they may have no idea which solutions are possible and having a tool like

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Troels Ring
Hi Tim  - the results from  this paper have had big impact on quite complicated problems of physiology so I thought I might like to understand how they came by, calculating them myself. Writing up the statements from which the inferences in the paper were generated using Mathematica were meant

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Ebert,Timothy Aaron
This is a poster child for why we like open source software. "I dump numbers into a black box and get numbers out but I cannot verify how the numbers out were calculated so they must be correct" approach to analysis does not really work for me. Tim -Original Message- From: R-help On

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Troels Ring
Thanks,   Valentin for the suggestion. I'm not sure I can go that way. I include below the statements from the paper containing the knowledge on the basis of which I would like to know at specified [H] the concentration of each of the many metabolites given the constraints. I have tried to

Re: [R-es] función dinámica con lapply en un data.table

2023-01-19 Thread patricio fuenmayor
Gracias Carlos te cuento que el factor debe multiplicar a la columna en lo que envías ... está multiplicando a cada fila consecutivamente le metí un poco de cabeza y logré hacerlo con furrr::future_imap

Re: [R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Valentin Petzel
Hello Troels, As fair as I understand you attempt to numerically solve a system of non linear equations in multiple variables in R. R does not provide this functionality natively, but have you tried multiroot from the rootSolve package:

[R] The rgl package update may affect your scripts

2023-01-19 Thread Duncan Murdoch
To all users of the rgl package: CRAN has just accepted an update of rgl to version 1.0.1. This release deprecates a number of functions which have been in the package for a very long time, and this may affect your scripts. Here are the news items about it: * The long promised

Re: [R] MLE Estimation of Gamma Distribution Parameters for data with 'zeros'

2023-01-19 Thread peter dalgaard
Not necessarily homework, Bert. There's a generic issue with MLE and rounded data, in that gamma densities may be 0 at the boundary but small numbers are represented as 0, making the log-likelihood -Inf. The cleanest way out is to switch to a discretized distribution in the likelihood, so

[R] R emulation of FindRoot in Mathematica

2023-01-19 Thread Troels Ring
Hi friends - I hope this is not a misplaced question. From the literature (Kushmerick AJP 1997;272:C1739-C1747) I have a series of Mathematica equations which are solved together to yield over different pH values the concentrations of metabolites in skeletal muscle using the Mathematica

Re: [R-es] Suma de datos de una tabla

2023-01-19 Thread Proyecto R-UCA
Buenas, Creo que el siguiente código hace lo que pides, cambiando Chile y las columnas por los de tu caso. library(carData) data(Chile) indice <- sort(unique(Chile$population)) f <- function(valor, data, indice) { sum(data[indice == valor], na.rm = TRUE) } ## Una lista con las sumas de