Re: [R] (no subject)

2022-11-07 Thread Ivan Krylov
On Sun, 6 Nov 2022 23:34:46 + Nick Wray wrote: > Most of the sets work fine with MICE but with a few I get an error > message: > > This data set, which generated the error message has five columns > > iter imp variable > 1 1 986Error in terms.formula(tmp, simplify = TRUE) : >

Re: [R] Associate a .R file with the RGui

2022-11-07 Thread Uwe Ligges
On 06.11.2022 19:43, Amarjit Chandhial wrote: Hi Uwe, I can do 1. 1. Add the line if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1]) to the Rprofile.site file; and My Rprofile.site file is: "C:/PROGRA~1/R/R-42~1.2/etc/Rprofile.site" How do I do 2, step-by-step? 2.

Re: [R] [External] Re: Selecting a minimum value of an attribute associated with point values neighboring a given point and assigning it as a new attribute

2022-11-07 Thread Duhl, Tiffany R.
Thanks so much Eric! I'm going to play around with your toy code (pun intended) & see if I can make it work for my application. Cheers, -Tiffany From: Eric Berger Sent: Sunday, November 6, 2022 10:27 AM To: Bert Gunter Cc: Duhl, Tiffany R. ; R-help Subject:

Re: [R] Associate a .R file with the RGui

2022-11-07 Thread Amarjit Chandhial via R-help
Hi Uwe, Many Thanks. Amarjiit > On 7 Nov 2022, at 14:00, Uwe Ligges wrote: > > > >> On 06.11.2022 19:43, Amarjit Chandhial wrote: >> Hi Uwe, >> I can do 1. >> 1. Add the line >> if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1]) >> to the Rprofile.site file; and >> My

Re: [R] [External] Re: Selecting a minimum value of an attribute associated with point values neighboring a given point and assigning it as a new attribute

2022-11-07 Thread Micha Silver
Eric's solution notwithstanding, here's a more "spatial" approach. I first create a fictitious set of 1000 points (and save to CSV to replicate your workflow) library(sf) library(spdep) # Prepare fictitious data # Create a data.frame with 1000 random points, and save to CSV LON <-

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
Dear Tim, Actually, I am replacing a big for loop by the lapply() function, and report the progress: lapply(TP, function(i) { BODY; print(i)}) Can you please adjust your solution in this light? THanking you, Yours sincerely, AKSHAY M KULKARNI

Re: [R] print and lapply....

2022-11-07 Thread Ebert,Timothy Aaron
Dear Akshay, I think we have provided several solutions to the question asked. Can you please adjust your question to more closely align with what you need. It would be nice if you can provide sufficient detail so that we can see how you have adapted our solutions and how these have not

Re: [R] print and lapply....

2022-11-07 Thread Bert Gunter
" The lapply() caches the result, and prints the output of the function in question immediately after printing the final i. " I don't believe you understand how lists or lapply works. You seem to be trying to intuit from empirical behavior. Bad idea, if so. You need to read the docs or spend

Re: [R] print and lapply....

2022-11-07 Thread Rui Barradas
Às 19:22 de 07/11/2022, akshay kulkarni escreveu: Dear Rui, THanks for your reply...The point is the loop is a scraping code, and in your examples you have assumed that the body acts on i, the loop variable. Can you adapt your code to JUST PRINT the loop variable i ? By the

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
Dear Rui, THanks for your reply...The point is the loop is a scraping code, and in your examples you have assumed that the body acts on i, the loop variable. Can you adapt your code to JUST PRINT the loop variable i ? By the by, I think I have stumbled upon the answer: The

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
Dear Bert, Actually, I am replacing a big for loop by the lapply() function, and report the progress: lapply(TP, function(i) { BODY; print(i)}) Can you please adjust your solution in this light? THanking you, Yours sincerely, AKSHAY M KULKARNI

Re: [R] print and lapply....

2022-11-07 Thread Andrew Simmons
put print() around x^2 On Mon, Nov 7, 2022, 12:18 akshay kulkarni wrote: > Dear members, > I have the following code and output: > > > TP <- 1:4 > > lapply(TP,function(x){print(x);x^2}) > [1] 1 > [1] 2 > [1] 3 > [1] 4 > [[1]] > [1] 1 > > [[2]] > [1] 4 > > [[3]] >

[R] print and lapply....

2022-11-07 Thread akshay kulkarni
Dear members, I have the following code and output: > TP <- 1:4 > lapply(TP,function(x){print(x);x^2}) [1] 1 [1] 2 [1] 3 [1] 4 [[1]] [1] 1 [[2]] [1] 4 [[3]] [1] 9 [[4]] [1] 16 How do I make the print function output x along with x^2, i.e not at the beginning but

Re: [R] print and lapply....

2022-11-07 Thread Ebert,Timothy Aaron
Another option is use paste() within print() lapply(TP,function(x){print(paste("x= ",x, " x^2 = ", x^2))}) Tim -Original Message- From: R-help On Behalf Of Andrew Simmons Sent: Monday, November 7, 2022 12:21 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] print and

Re: [R] print and lapply....

2022-11-07 Thread Bert Gunter
Well... yes, of course. But assuming the sole purpose is to print the results and not to save them for further processing, the OP's approach seems rather painful. My preference would be to vectorize: > print(cbind(TP, TPsq =TP^2), print.gap = 3) TP TPsq [1,]1 1 [2,]2 4

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
Dear Andrew It doesn't work: > lapply(TP,function(x){print(x^2)}) [1] 1 [1] 4 [1] 9 [1] 16 [[1]] [1] 1 [[2]] [1] 4 [[3]] [1] 9 [[4]] [1] 16 Basically, lapply() is implemented by a for loop. So there must be some way right? tHanking you, Yours sincerely, AKSHAY M

Re: [R] print and lapply....

2022-11-07 Thread Andrew Simmons
I meant something like: TP <- 1:4 lapply(TP, function(x) { print(x) print(x^2) }) You may wish to add cat("\n") after print(x^2) so that your results from each iteration are separated. You may also wish to add invisible() around lapply() if you're not saving / / using the return list in

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
Dear Rui, Actually, I am replacing a big for loop by the lapply() function, and report the progress: lapply(TP, function(i) { BODY; print(i)}) Can you please adjust your solution in this light? THanking you, Yours sincerely, AKSHAY M KULKARNI

Re: [R] print and lapply....

2022-11-07 Thread Rui Barradas
Às 17:17 de 07/11/2022, akshay kulkarni escreveu: Dear members, I have the following code and output: TP <- 1:4 lapply(TP,function(x){print(x);x^2}) [1] 1 [1] 2 [1] 3 [1] 4 [[1]] [1] 1 [[2]] [1] 4 [[3]] [1] 9 [[4]] [1] 16 How do I make the print function

Re: [R] print and lapply....

2022-11-07 Thread Rui Barradas
Às 18:33 de 07/11/2022, akshay kulkarni escreveu: Dear Rui, Actually, I am replacing a big for loop by the lapply() function, and report the progress: lapply(TP, function(i) { BODY; print(i)}) Can you please adjust your solution in this light? THanking you, Yours

Re: [R] [External] Re: Selecting a minimum value of an attribute associated with point values neighboring a given point and assigning it as a new attribute

2022-11-07 Thread Eric Berger
## Some further comments and approaches, divided into 3 sections ## ## Section 1: Micha's modified code ## Section 2: Eric's modified code: ##a) uses Micha's dist_matrix from dnearneigh instead of the f() function ##b) add check that it gets the same solution as Micha's modified code ##

Re: [R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread Emilio L. Cano
Hola, Expande un poco más el “no me deja” para poder ayudarte mejor . Cuando un paquete no se logra instalar aparece un mensaje de error que normalmente tiene que ver con dependencias (de otros paquetes o del sistema). A ver qué dice ese mensaje. Comparte también tu versión de R y el mensaje

[R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread ligelaii76
> > Buenos dias, > De repente la libreria dplyr ha dejado de funcionar y me dice que no ha > podido instalar “cil”y “lifecycle” > He intentado instalarlos por separado pero no me deja.ademas que he > actualizado todos los paqetes que tenia instalados y no me ha dejado. > > He intentado

Re: [R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread Emilio L. Cano
El mensaje que tienes dice que necesitas una versión actualizada de rlang. Me despista lo de “pegar la librería”. Los paquetes no se pegan, se instalan: install.packages("lifecycle”) La expresión anterior instalaría por defecto las dependencias, pero si tienes algún error puedes instalar el

Re: [R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread ligelaii76
Buenas tardes, No puedo comoartir mucha informacion,puesto que es del trabajo. Despues de pegar la lobreria lofecycle y dplyr,me sigue dando error y me dice que la version deberia ser de lifecycle >= 1.0.0 Para hacerlo instale el paquete remote,pero me volvio a dar mas errores. El error de

Re: [R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread ligelaii76
La version de R es R3.6.1 No puedo instalar otra version mas nueva. Enviado desde mi iPhone > El 7 nov 2022, a las 17:36, ligelai...@gmail.com escribió: > > Buenas tardes, > No puedo comoartir mucha informacion,puesto que es del trabajo. > Despues de pegar la lobreria lofecycle y dplyr,me

Re: [R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread ligelaii76
Hola, Al pegar la libreria me refiero a que cogi manualmente los archivos con librerias y pegarlos en el directorio correspondiente de la otra persona. Al copiar mis librerias donde mi compañera,me pidio la version >= 1.0.0 de lifecycle. Ademas de otras librerias diferentes. Por otro lado,las

Re: [R-es] Problemas libreria dplyr -pide libreria cli y lifecycle pero no me deja descargaralas

2022-11-07 Thread ligelaii76
Buenos días Carlos, Por motivos corporativos no piedo instalar otra version diferente a la 3.6.1. Intente instalar RTools y tanpoco me lo permitió. Lo único que se me ocurre es desinstalar e instalar de nuevo. Al desinstalar R ,limpia todas las librerías descargadas? Tambien,me surge la duda,al

[ESS] Tab completion for CamelCase

2022-11-07 Thread Naresh Gurbuxani via ESS-help
My ess setup on mac works well with tab completion of CamelCase variable names. However, on Windows, tab completes variable names with all lowercase letters. So it does give me complete variable name, which needs some letters to be converted to uppercase. Can tab completion on Windows give