Re: [R-es] Problemas con algunos atajos en Rstudio

2023-02-22 Thread Emilio L. Cano
Hola,

El comportamiento de CTRL + SHIFT + M lo puedes cambiar en Tools/Global 
Options, tendrás marcado “Use native pipe operator” en el grupo de opciones 
“Code”. CTRL+1 etc. ni idea, pero comprueba también las opciones “keybingings” 
y “modify keyboard shorcuts…” por si acaso se han cambiado.

Un saludo,
Emilio





> El 23 feb 2023, a las 1:06, Alfredo Diaz  escribió:
> 
> Cordial saludo,
> 
> Necesito de su ayuda dado que, cuando estoy trabajando en Rstudio no me
> están funcionando los atajos *CTRL + 1, CTRL + 2*, además cuando utilizo el
> atajo* CTRL + SHIFT + M* el operador que obtengo es: |>. Atajos como *CTRL +
> ENTER, ALT + -, ALT + SHIFT + K* funcionan perfectamente, por ende, no
> entiendo qué está pasando ¿Alguien sabe que puede estar ocurriendo? ¿Por
> qué puede ocurrir? ¿Qué debo hacer para solucionar este problema?
> 
> De antemano muchas gracias por las respuestas.
> 
> 
> Fraternalmente,
> -- 
> José Diaz E.
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es


[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] manejo bases de datos

2023-02-22 Thread Jose Betancourt Bethencourt
Estimado
Le agradezco especialmente
saludos
Jose

El 22/2/23, Carlos Ortega  escribió:
> Hola José,
>
> Mira este ejemplo que cubre todo lo que comentas...
>
> #--
> # Ejemplo manipulación de datos - altura - peso - cálculo BMI...
> library(readr)
> library(dplyr)
> library(magrittr)
>
> #-- Dirección de los datos iniciales
> url <- "
> https://raw.githubusercontent.com/abhaymise/Face-to-height-weight-BMI-estimation-/master/BMI%20data%20-%20Sheet1.csv
> "
>
> datos <-
>   # Leo fichero con datos de altura y peso
>   read_csv(url) %>%
>   #- quito columna BMI, luego la voy a calcular nuevamente
>   select(-BMI) %>%
>   #- añado una columna
>   mutate( miBMI = weight/(height^2)) %>%
>   #- quito columna id y UID que no hacen falta
>   select(-id, -UID)
> datos
>
> #-- Creo un conjunto de datos ficticio
> library(randomNames)
> datosnew <- data.frame(
>   name = randomNames(20, ethnicity = 2),
>   height = runif(20, min = 1, max = 2),
>   weight = runif(20, min = 50, max = 100)
> ) %>%
>   mutate(miBMI = weight/(height^2))
>
> #-- Añado datosnew a los datos originales
> datosfin <- datos %>%
>   bind_rows(datosnew)
>
> #-- Asignar un decil a cada persona en función de su BMI
> datosfin %<>%
>   # Asigno decil
>   mutate(decil_bmi = ntile(miBMI, 10)) %>%
>   # Ordeno el conjunto de mayor a menor decil
>   arrange(-decil_bmi)
>
> #-- Ver resultados
> head(datosfin)
> tail(datosfin)
> #
>
> Gracias,
> Carlos Ortega
> www.qualityexcellence.es
>
> El mié, 22 feb 2023 a las 12:06, Jose Betancourt Bethencourt (<
> betans...@gmail.com>) escribió:
>
>> Estimados
>> He trabajado en R, pero los cambios a las bases de datos los he hecho
>> en Excel. Quisiera saber como se puede desde el propio R:
>>
>> 1.  Anadir Mas casos (filas)
>> 2.  Calcular una nueva variable, ejemplo el IMC a partir del peso y
>> la
>> estatura
>> 3.  Agrupar edades en grupos (0-10, 11-20 etc.)
>> 4.  Ordenar casos (descendente o ascendente)
>> Saludos
>> José
>>
>> ___
>> R-help-es mailing list
>> R-help-es@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-help-es
>>
>
>
> --
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>


-- 
Dr. Jose A. Betancourt Bethencourt
Universidad de Ciencias Medicas Carlos j. Finlay

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] Problemas con algunos atajos en Rstudio

2023-02-22 Thread Alfredo Diaz
Cordial saludo,

Necesito de su ayuda dado que, cuando estoy trabajando en Rstudio no me
están funcionando los atajos *CTRL + 1, CTRL + 2*, además cuando utilizo el
atajo* CTRL + SHIFT + M* el operador que obtengo es: |>. Atajos como *CTRL +
ENTER, ALT + -, ALT + SHIFT + K* funcionan perfectamente, por ende, no
entiendo qué está pasando ¿Alguien sabe que puede estar ocurriendo? ¿Por
qué puede ocurrir? ¿Qué debo hacer para solucionar este problema?

De antemano muchas gracias por las respuestas.


Fraternalmente,
-- 
José Diaz E.

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Problem of intercept?

2023-02-22 Thread varin sacha via R-help
Dear Peter, Bert and Timothy,

Really appreciated your help. I guess Peter's comments were the nearest of what 
I was trying to do.
I have tried but it still does not work. I mean the graph is showing the 
coefficients I am not expecting !
I will try to explain. 
Starting from the equation : Y = b0 + b1*x1 where bo and b1 are the regression 
beta coefficients representing the intercept and the slope, respectively.
Suppose that, I wish to investigate the differences in Y between males and 
females. Based on the gender variable, I can create a new dichotomous/dummy 
variable that takes the value :

1 if a person is male
0 if a person is female

and use this variable as a predictor in the regression equation, leading to the 
following model :

b0 + b1 if person is male
b0 if person is female

the coefficients can be interpreted as follow:

1. b0 is the average Y among female
2. b0 + b1 is the average Y among male
3. and b1 is the average difference in Y between males and females

The graph with my R code is showing the coefficients I was expecting for 
multiple regression but not for simple regression. I mean I am expecting to see 
b0 + b1 for coefficients in the plot for simple regression and the plot is 
showing me b1 for simple regression ! Is there a solution to my problem?

Best,


Le mercredi 22 février 2023 à 10:59:38 UTC+1, peter dalgaard  
a écrit : 





Not sure what you are trying to do here.

The immediate issue is that you are getting 'y' on the RHS, because that is the 
1st column in Dataset. So "for (i in 2:3)" might be closer to intention. 

However, a 0/1 regresson with no intercept implies that the mean for the "0" 
group is zero, and with two regressors that the mean is zero for the (0,0) 
group. Looking at the data, this is quite clearly not the case.

I suppose you may have intended to fit the models _with_ the intercept and then 
_ignore_ the intercept for plotting purposes, i.e. lm(y~x11+x12, 
Dataset)$coef[-1], etc.?

(Also, I suspect that you don't actually have y=7 and y=867 in the dataset.)

-pd

> On 21 Feb 2023, at 22:33 , varin sacha via R-help  
> wrote:
> 
> Dear R-experts,
> 
> Here below my R code working with quite a few warnings. 
> x11 and x12 are dichotomous variable (0=no and 1=yes). I substract 1 to 
> ignore intercept.
> I would like not to ignore intercept. How to modify my R code because if I 
> just remove -1 it does not work?
> 
> 
> y= c(32,45,65,34,23,43,65,76,87,98,7,867,56,45,65,76,88,34,55,66)
> x11=c(0,1,1,0,0,1,1,1,0,0,1,0,0,1,0,0,1,1,0,1)
> x12=c(0,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,1,0,0)
>  
> Dataset=data.frame(y,x11,x12)
>  
> a=lm(y~x11+x12-1,Dataset)$coef
> b=NULL
> for(i in c(1:2)) {
>  f=formula(paste('y~',names(Dataset)[i],-1))
>  b=c(b,lm(f,Dataset)$coef)
> }
> coef=data.frame(rbind(a,b))
> coef$Model=c('Multi','Single')
> library(reshape2)
> coef.long<-melt(coef,id.vars="Model")
>  
> library(ggplot2)
> ggplot(coef.long,aes(x=variable,y=value,fill=Model))+
>  geom_bar(stat="identity",position="dodge")+
>  scale_fill_discrete(name="Model",
>  labels=c("Multiple", "Simple"))+
>  labs(title =paste('La différences des coefficients
>  entre la régression multiple et simple'),
>  x="Models",y="Coefficient")+
>  coord_flip()
>  
>  
>  
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] wininet deprecation

2023-02-22 Thread Stadler Thomas
Hi Enrico,

thanks for your suggestion. 

rgds

Thomas

-Ursprüngliche Nachricht-
Von: Enrico Schumann  
Gesendet: Dienstag, 21. Februar 2023 12:31
An: gisbert.se...@wido.bv.aok.de; Stadler Thomas 
Cc: r-help@r-project.org
Betreff: Re: [R] wininet deprecation

On Tue, 21 Feb 2023, Selke, Gisbert W. writes:

> On Mon, 20 Feb 2023 15:58:33 +, Stadler Thomas 
>  wrote:
>
>> as the download method 'wininet' is deprecated,  I'm looking into 
>> alternative ways to install packages from within R.
>> Unfortunately, curl, libcurl and wget refuse to cooperate with Kerberos on 
>> our corporate setup.
>> When exactly will the 'wininet' method stop working? R release 4.3?
> Same problem here. It has been reported before to be a major nuisance if 
> you're working in an environment with a need for security and data protection.
> Unfortunately, it seems it has been decided to go for this regression of 
> functionality.
>
> In our case we managed to circumnavigate the problem by building a 
> local CRAN mirror inside our firewall using the open source Nexus 
> repository. Seems a bit overkill (given that wininet has done the 
> trick nicely up to now), but at least it works.
>
> HTH.
>
> \Gisbert

There is also the miniCRAN package
(https://cran.r-project.org/package=miniCRAN).


--
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net


 

Bitte denken Sie an die Umwelt, bevor Sie diese E-Mail ausdrucken. Ist diese 
E-Mail nicht an Sie adressiert, bitten wir Sie, uns zu informieren und die 
E-Mail zu loeschen. Da der E-Mail-Verkehr weder sicher noch vor Einblicken und 
Veraenderungen durch Dritte geschuetzt ist, lehnen wir jegliche Haftung fuer 
Schaeden ab, die daraus entstehen koennen.
Please consider the environment before printing this e-mail. If this e-mail is 
not addressed to you, please inform us and delete the e-mail. As e-mail traffic 
is not securely protected against being seen or changed by third parties, we do 
not assume any liability for damages that may arise from the use of e-mail.
Veuillez penser a l'environnement avant d'imprimer cet e-mail. Si vous n'etes 
pas le destinataire de cet e-mail, nous vous prions de nous en informer et de 
l'effacer. La circulation des e-mails n'etant ni sure ni a l'abri de la prise 
de connaissance ou de la modification par des tiers, nous declinons toute 
responsabilite pour les dommages qui pourraient en resulter.

Disclaimer
https://www.vpbank.com/disclaimer_e_mail__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] wininet deprecation

2023-02-22 Thread Stadler Thomas
Hi Gisbert,

thanks for your suggestion. It seems I will have to look into local mirroring 
solutions after all.

rgds

Thomas

-Ursprüngliche Nachricht-
Von: Selke, Gisbert W.  
Gesendet: Dienstag, 21. Februar 2023 12:17
An: r-help@r-project.org
Cc: Stadler Thomas 
Betreff: Re: [R] wininet deprecation

On Mon, 20 Feb 2023 15:58:33 +, Stadler Thomas  
wrote:

> as the download method 'wininet' is deprecated,  I'm looking into alternative 
> ways to install packages from within R.
> Unfortunately, curl, libcurl and wget refuse to cooperate with Kerberos on 
> our corporate setup.
> When exactly will the 'wininet' method stop working? R release 4.3?
Same problem here. It has been reported before to be a major nuisance if you're 
working in an environment with a need for security and data protection.
Unfortunately, it seems it has been decided to go for this regression of 
functionality.

In our case we managed to circumnavigate the problem by building a local CRAN 
mirror inside our firewall using the open source Nexus repository. Seems a bit 
overkill (given that wininet has done the trick nicely up to now), but at least 
it works.

HTH.

\Gisbert


 

Bitte denken Sie an die Umwelt, bevor Sie diese E-Mail ausdrucken. Ist diese 
E-Mail nicht an Sie adressiert, bitten wir Sie, uns zu informieren und die 
E-Mail zu loeschen. Da der E-Mail-Verkehr weder sicher noch vor Einblicken und 
Veraenderungen durch Dritte geschuetzt ist, lehnen wir jegliche Haftung fuer 
Schaeden ab, die daraus entstehen koennen.
Please consider the environment before printing this e-mail. If this e-mail is 
not addressed to you, please inform us and delete the e-mail. As e-mail traffic 
is not securely protected against being seen or changed by third parties, we do 
not assume any liability for damages that may arise from the use of e-mail.
Veuillez penser a l'environnement avant d'imprimer cet e-mail. Si vous n'etes 
pas le destinataire de cet e-mail, nous vous prions de nous en informer et de 
l'effacer. La circulation des e-mails n'etant ni sure ni a l'abri de la prise 
de connaissance ou de la modification par des tiers, nous declinons toute 
responsabilite pour les dommages qui pourraient en resulter.

Disclaimer
https://www.vpbank.com/disclaimer_e_mail__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R-es] manejo bases de datos

2023-02-22 Thread Eric Concha
Hola José, si pudieras compartir un subconjunto de datos y un poco más 
de detalle de lo que deseas hacer, se podría responder con más 
precisión. Por ahora un adelanto:

1. para añadir filas puedes usar rbin() del sistema base

2. para crear una columna llamada IMC al DF dataframe usando el sistema 
base: dataframe$IMC = elcalculo  ... con data.table sería: dataframe[, 
IMC=elcalculo]

3. para realizar operaciones de agrupación hay varias opciones, una de 
las más usadas es la libreria dplyr del paquete tidyverse 
(https://dplyr.tidyverse.org/articles/grouping.html), pero a mi me gusta 
usar la libreria data.table 
(https://github.com/Rdatatable/data.table/wiki/Getting-started)

4. para ordenar también lo puedes hacer con dplyr, sistema base o 
data.table (la función setkey())


Espero que esos datos te puedan orientar.

Saludos !!





On 22-02-23 08:06, Jose Betancourt Bethencourt wrote:
> Estimados
> He trabajado en R, pero los cambios a las bases de datos los he hecho
> en Excel. Quisiera saber como se puede desde el propio R:
>
> 1.Anadir Mas casos (filas)
> 2.Calcular una nueva variable, ejemplo el IMC a partir del peso y la 
> estatura
> 3.Agrupar edades en grupos (0-10, 11-20 etc.)
> 4.Ordenar casos (descendente o ascendente)
> Saludos
> José
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] manejo bases de datos

2023-02-22 Thread LeugimSan via R-help-es
Hola Jos�.

Tienes dos opciones para abordar esta cuesti�n: desde el propio c�digo de R 
[empezando con instrucciones como fix() o edit() para editar de manera muy 
b�sica el conjunto de datos] o desde un entorno gr�fico de R (me centrar� en 
esta �ltima opci�n porque es lo m�s parecido a Excel que vas a tener e imagino 
que es lo que te interesa).

Creo que los GUI de R m�s avanzados para manipular gr�ficamente los conjuntos 
de datos son JASP (https://jasp-stats.org/) y  JAMOVI (https://www.jamovi.org/).

Yo prefiero entornos menos "alejados" de R como RStudio 
(https://posit.co/products/open-source/rstudio/) o RCommander (Rcmdr en CRAN) 
pero quiz� no te sirvan tan bien como los dos anteriores para trabajar los 
datos como si fuera desde una hoja de c�lculo.

Mi recomendaci�n es que le eches un ojo a JASP (un proyecto bastante 
interesante de la Universidad de Amsterdam) a ver si cumple con tus 
requerimientos. En esta URL tienes materiales para empezar: 
https://jasp-stats.org/teaching-with-jasp/


Un saludo,
Miguel.





De: R-help-es  en nombre de Jose Betancourt 
Bethencourt 
Enviado: mi�rcoles, 22 de febrero de 2023 12:06
Para: r-help-es
Asunto: [R-es] manejo bases de datos

Estimados
He trabajado en R, pero los cambios a las bases de datos los he hecho
en Excel. Quisiera saber como se puede desde el propio R:

1.  Anadir Mas casos (filas)
2.  Calcular una nueva variable, ejemplo el IMC a partir del peso y la 
estatura
3.  Agrupar edades en grupos (0-10, 11-20 etc.)
4.  Ordenar casos (descendente o ascendente)
Saludos
Jos�

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es



Nota: A informaci�n contida nesta mensaxe e os seus posibles documentos 
adxuntos � privada e confidencial e est� dirixida �nicamente � seu 
destinatario/a. Se vostede non � o/a destinatario/a orixinal desta mensaxe, por 
favor elim�nea. A distribuci�n ou copia desta mensaxe non est� autorizada.

Nota: La informaci�n contenida en este mensaje y sus posibles documentos 
adjuntos es privada y confidencial y est� dirigida �nicamente a su 
destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, 
por favor elim�nelo. La distribuci�n o copia de este mensaje no est� autorizada.

See more languages: http://www.sergas.es/aviso-confidencialidad

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] manejo bases de datos

2023-02-22 Thread Jose Betancourt Bethencourt
Estimados
He trabajado en R, pero los cambios a las bases de datos los he hecho
en Excel. Quisiera saber como se puede desde el propio R:

1.  Anadir Mas casos (filas)
2.  Calcular una nueva variable, ejemplo el IMC a partir del peso y la 
estatura
3.  Agrupar edades en grupos (0-10, 11-20 etc.)
4.  Ordenar casos (descendente o ascendente)
Saludos
José

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Problem of intercept?

2023-02-22 Thread peter dalgaard
Not sure what you are trying to do here.

The immediate issue is that you are getting 'y' on the RHS, because that is the 
1st column in Dataset. So "for (i in 2:3)" might be closer to intention. 

However, a 0/1 regresson with no intercept implies that the mean for the "0" 
group is zero, and with two regressors that the mean is zero for the (0,0) 
group. Looking at the data, this is quite clearly not the case.

I suppose you may have intended to fit the models _with_ the intercept and then 
_ignore_ the intercept for plotting purposes, i.e. lm(y~x11+x12, 
Dataset)$coef[-1], etc.?

(Also, I suspect that you don't actually have y=7 and y=867 in the dataset.)

-pd
 
> On 21 Feb 2023, at 22:33 , varin sacha via R-help  
> wrote:
> 
> Dear R-experts,
> 
> Here below my R code working with quite a few warnings. 
> x11 and x12 are dichotomous variable (0=no and 1=yes). I substract 1 to 
> ignore intercept.
> I would like not to ignore intercept. How to modify my R code because if I 
> just remove -1 it does not work?
> 
> 
> y= c(32,45,65,34,23,43,65,76,87,98,7,867,56,45,65,76,88,34,55,66)
> x11=c(0,1,1,0,0,1,1,1,0,0,1,0,0,1,0,0,1,1,0,1)
> x12=c(0,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,1,0,0)
>  
> Dataset=data.frame(y,x11,x12)
>  
> a=lm(y~x11+x12-1,Dataset)$coef
> b=NULL
> for(i in c(1:2)) {
>   f=formula(paste('y~',names(Dataset)[i],-1))
>   b=c(b,lm(f,Dataset)$coef)
> }
> coef=data.frame(rbind(a,b))
> coef$Model=c('Multi','Single')
> library(reshape2)
> coef.long<-melt(coef,id.vars="Model")
>  
> library(ggplot2)
> ggplot(coef.long,aes(x=variable,y=value,fill=Model))+
>   geom_bar(stat="identity",position="dodge")+
>   scale_fill_discrete(name="Model",
>   labels=c("Multiple", "Simple"))+
>   labs(title =paste('La différences des coefficients
>   entre la régression multiple et simple'),
>   x="Models",y="Coefficient")+
>   coord_flip()
>  
>  
>  
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] MFA variables graph, filtered by separate.analyses

2023-02-22 Thread gavin duley
Hi John,

On Wed, 22 Feb 2023 at 01:46, John Fox  wrote:
> I think that it's likely that Jim meant the hetcor() function in the
> polycor package.

Thanks, I managed to find it based on the function name anyway.

Thanks,
gavin,

-- 
Gavin Duley 

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.