As noted, this is not the place to ask about dplyr but the answer you may
want is perhaps straight R.
If you have a list called weekdays and you know you o not want to take the
fifth, then indexing with -5 removes it:
> weekdays <- list("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
>
On Thu, 18 Nov 2021 16:40:14 -0500
"Christopher W. Ryan via R-help" wrote:
> I've just learned about pluck() and chuck() in the purrr package. Very
> cool! As I understand it, they both will return one element of a
> list, either by name or by [[]] index, or even "first" or "last"
>
> I was
Estimado Juan Manuel Dias
Yo lo realizo con vectores, en realidad hay muchas formas, si usted piensa
en if, está en lo correcto.
Hay un problema, mire el siguiente ejemplo, puede ser que comparte el error
que usted tiene y aprende sobre su propio código antes de cambiarlo por
otra solución.
tidyverse is an RStudio ecosystem of packages -- it is not part of R's
"standard" package distro, so as the posting guide linked below says:
"For questions about functions in standard packages distributed with R (see
the FAQ Add-on packages in R
I've just learned about pluck() and chuck() in the purrr package. Very
cool! As I understand it, they both will return one element of a list,
either by name or by [[]] index, or even "first" or "last"
I was hoping to find a way to return all *but* one specified element of
a list. Speaking
Hi RosalinaZakaria,
Talk about using a sledgehammer to crack a nut. In your example the
two objects are character vectors. How about:
dt_comb1gd <-paste0(dtpaigd,dtpmgd)
Jim
On Fri, Nov 19, 2021 at 2:15 AM ROSLINAZAIRIMAH BINTI ZAKARIA .
wrote:
>
> Dear all,
>
> I try to merge two columns
Buenas:
Prueba la función dplyr::coalesce
https://dplyr.tidyverse.org/reference/coalesce.html, está diseñada para
trabajar con NAs. Creo que es lo que necesitas
El El jue, 18 nov 2021 a las 19:36, juan manuel dias
escribió:
> Hola, como andan!
> Necesito crear una variable nueva
Hello,
Use an index giving the "" positions.
i <- nchar(dtpmgd) == 0L
dtpmgd[i] <- dtpaigd[i]
Or, in one line,
dtpmgd[nchar(dtpmgd) == 0L] <- dtpaigd[nchar(dtpmgd) == 0L]
Hope this helps,
Rui Barradas
Às 07:02 de 18/11/21, ROSLINAZAIRIMAH BINTI ZAKARIA . escreveu:
Dear all,
I try
Hola, como andan!
Necesito crear una variable nueva "*Dirección_Final*" que sea igual a la
variable "*Dirección*", pero que si "*Dirección" *es NA traiga "*Dirección
General*", si "*Dirección General*" es NA traiga "*Subsecretaria*", y si "
*Subsecretaria*" es NA traiga "*Secretaria*". Estoy
I haven't been able to get remote desktop working, I suspect it's disabled
for security reasons.
Any other thoughts/suggestions?
On Thu, Nov 18, 2021 at 2:22 AM Mark Fowler
wrote:
> Hi,
>
>
>
> This issue bears some similarity to a problem I’ve been experiencing over
> the last few days. R
HI Stephen,
The reason I suggested the test was that I had a real flakey and
annoying GUI problem a couple of years ago.
It had to do with selection by mouse etc. The IT group could not
reproduce the problem (when they connected remotely) and I realized
that when I worked from home I also avoided
I have not tried that. I'm not certain if I have the permissions for remote
desktop, but I will find out and give it a shot if possible.
On Wed, Nov 17, 2021, 12:04 PM Eric Berger wrote:
> Hi Stephen,
> Does the problem still occur if you connect remotely to your computer from
> a different
On 18/11/2021 09:02, ROSLINAZAIRIMAH BINTI ZAKARIA . wrote:
Dear all,
I try to merge two columns consisting of characters using the 'coalesce'
function from dplyr package. However, two data still have not merged, data
no. 124 1nd 143. Any help is very much appreciated. I provide the data as
From my example,
as(employees, "People")
more general coercion is possible; see the documentation ?setAs.
From your problem description I would have opted for the solution that you now
have, with two slots rather than inheritance. Inheritance has a kind of weird
contract when using another
Dear all,
I try to merge two columns consisting of characters using the 'coalesce'
function from dplyr package. However, two data still have not merged, data
no. 124 1nd 143. Any help is very much appreciated. I provide the data as
follows.
> dput(dtpaigd)
c("C+", "B+", "C+", "B+", "C+", "A-",
Hola:
Gracias por la respuesta. Nunca he utilizado variables globales por miedo de
meter la pata.
Sí, tienes razón. Lo mejor es pasar al nuevo espacio el dataframe. Se
simplifica mucho.
Gracias y saludos.
On Thu, 18 Nov 2021 13:58:53 +0100
Proyecto R-UCA wrote:
> Buenas,
>
> No he
Buenas,
No he profundizado en el motivo pero como dices falla si las variables
no están en el data.frame. Tienes que agregarlas primero al data.frame.
Si el espacio del que hablas es el padre, o algún ascendiente, no
habría problemas, pues R cuando no existe una variable en un entorno
mira en
Gracias por la respuesta!
El código tuyo funciona sin problema, pero cuando lo "adapto" me da error:
> ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
+ trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
+ group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
+ weight <- c(ctl,
Buenas,
a ver si esto te sirve:
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
dd <- data.frame(weight = weight, group = group, ctl = ctl, trt=trt)
model
Sí! Gracias por responder!
Funciona sin problema:
> X = "group"
+ X
[1] "group"
+ lm.D9 <- lm(weight ~ get (X), data = df)
+ summary (lm.D9)
Call:
lm(formula = weight ~ get(X), data = df)
Residuals:
Min 1Q Median 3Q Max
-1,0710 -0,4937 0,0685 0,2462 1,3690
Hola:
Creo que lo que quieres es esto:
lm.D9 <- lm(weight ~ get(X))
Saludos,
Marcelino
El 18/11/2021 a las 12:03, Griera escribió:
Hola, buenos días:
No es un problema concreto que tenga ahora, pero es un problema general
que no se si tiene solución fácil. Hago una regresión (de lm.html):
Hola:
Gracias por la respuesta. Disculpa, el ejemplo está mal planteado. En realidad
seria:
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
df <-
Hi
above tapply and aggregate, split *apply could be used)
sapply(with(df, split(z, y)), mean)
Cheers
Petr
> -Original Message-
> From: R-help On Behalf Of Luigi Marongiu
> Sent: Wednesday, November 17, 2021 2:21 PM
> To: r-help
> Subject: [R] vectorization of loops in R
>
> Hello,
Hola, buenos días:
No es un problema concreto que tenga ahora, pero es un problema general
que no se si tiene solución fácil. Hago una regresión (de lm.html):
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,
24 matches
Mail list logo