Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread Abby Spurdle
I'm sorry.
I misread your example, this morning.
(I didn't read the code after the line that calls plot).

After looking at this problem again, interpolation doesn't apply, and
extrapolation would be a last resort.
If you can assume your data comes from a particular type of
distribution, such as a lognormal distribution, then a better approach
would be to find the most likely parameters.

i.e.
This falls within the broader scope of maximum likelihood.
(Except that you're dealing with a table of quantile-probability
pairs, rather than raw observational data).

I suspect that there's a relatively easy way of finding the parameters.

I'll think about it...
But someone else may come back with an answer first...


On Sat, Mar 6, 2021 at 8:17 AM Abby Spurdle  wrote:
>
> I note three problems with your data:
> (1) The name "percent" is misleading, perhaps you want "probability"?
> (2) There are straight (or near-straight) regions, each of which, is
> equally (or near-equally) spaced, which is not what I would expect in
> problems involving "quantiles".
> (3) Your plot (approximating the distribution function) is
> back-the-front (as per what is customary).
>
>
> On Fri, Mar 5, 2021 at 10:14 PM PIKAL Petr  wrote:
> >
> > Dear all
> >
> > I have table of quantiles, probably from lognormal distribution
> >
> >  dput(temp)
> > temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069,
> > 0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1,
> > 0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Names = c("size", "percent"
> > ), row.names = c(NA, -9L), class = "data.frame")
> >
> > and I need to calculate quantile for size 0.1
> >
> > plot(temp$size, temp$percent, pch=19, xlim=c(0,2))
> > ss <- approxfun(temp$size, temp$percent)
> > points((0:100)/50, ss((0:100)/50))
> > abline(v=.1)
> >
> > If I had original data it would be quite easy with ecdf/quantile function 
> > but without it I am lost what function I could use for such task.
> >
> > Please, give me some hint where to look.
> >
> >
> > Best regards
> >
> > Petr
> > Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
> > partnerů PRECHEZA a.s. jsou zveřejněny na: 
> > https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
> > processing and protection of business partner's personal data are available 
> > on website: https://www.precheza.cz/en/personal-data-protection-principles/
> > Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné 
> > a podléhají tomuto právně závaznému prohlá±ení o vyloučení odpovědnosti: 
> > https://www.precheza.cz/01-dovetek/ | This email and any documents attached 
> > to it may be confidential and are subject to the legally binding 
> > disclaimer: https://www.precheza.cz/en/01-disclaimer/
> >
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > 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.

__
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] Separar respuestas en distintas columnas.

2021-03-05 Thread Juan Carlos Lopez Mesa
Hola,

Prueba con este código de ejemplo. Saludos

library(tidyverse)

data <- data.frame(paciente = LETTERS[1:5],
   variable = c("Demencia, Enfermedad Pulmonar",
"Cáncer",
"Enfermedad Cardíaca, Enfermedad Pulmonar",
"Enfermedad Pulmonar, Cáncer",
"Enfermedad Pulmonar, Demencia, Afasia
primaria progresiva diagnosticada 2010"))


data %>%
  separate_rows(variable, sep = ",") %>%
  mutate(variable = str_squish(variable), # Para quitar los espacios en
blanco indeseados
 id = 1) %>%
  spread(key = variable, value = id)

El vie, 5 mar 2021 a las 13:55, juan manuel dias ()
escribió:

> Hola Estimados/as,
>
> Tengo la siguiente tarea que realizar.
>
> Tengo una base y una de las variables (problemas_salud_paciente) es de
> respuesta múltiple (acepta más de una opción de respuesta por caso/fila)
> pero tiene cargadas todas las respuestas en la misma columna, y
> dichas opciones están separadas por una coma (",").
>
> 1- Necesito separar cada opción de respuesta en una columna distinta.
>
> 2- Generar tantas columnas como opciones de respuesta tenga.
>
> 3- Luego, a cada columna (opción de respuesta) debería asignarle valor 1
> según si la fila/caso haya respondido por esa opción.
>
> Así está la variable en la base:
>
> id   problemas_salud_paciente
>  1Demencia
>  2Demencia
>  3Enfermedad Pulmonar, Demencia, Afasia primaria progresiva
> diagnosticada 2010
>  4Enfermedad Cardíaca
>
> Y así necesitaría que quede:
>
> id  demencia | enferm_pulmonar | afasia_prima_progr  | enfermedad_cardiaca
>  1  1
>  2  1
>  3  1   11
>
>  4
> 1
>
> Dejo un csv con una muestra de casos de esa variable.
>
> Muchas gracias. Saludos, Juan.
>
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>

-- 
*Aviso legal:* El contenido de este mensaje y los archivos adjuntos son 
confidenciales y de uso exclusivo de la Universidad Nacional de Colombia. 
Se encuentran dirigidos sólo para el uso del destinatario al cual van 
enviados. La reproducción, lectura y/o copia se encuentran prohibidas a 
cualquier persona diferente a este y puede ser ilegal. Si usted lo ha 
recibido por error, infórmenos y elimínelo de su correo. Los Datos 
Personales serán tratados conforme a la Ley 1581 de 2012 y a nuestra 
Política de Datos Personales que podrá consultar en la página web 
www.unal.edu.co .* *Las opiniones, informaciones, 
conclusiones y cualquier otro tipo de dato contenido en este correo 
electrónico, no relacionados con la actividad de la Universidad Nacional de 
Colombia, se entenderá como personales y de ninguna manera son avaladas por 
la Universidad.

[[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: [ESS] ESS M-x R failing in a Windows installation

2021-03-05 Thread Jeremie Juste via ESS-help
Hello Steve,

Yest this is a known problem on windows.

A temporary solution might be to use the command M-x ess-r-newest.
For my part I have rebinded  the above command to a key C-'.
It is not the best solution but it works for me.
If I come up with a better fix I'll update.

HTH,
Jeremie




On Friday,  5 Mar 2021 at 15:51, Steve Gutreuter via ESS-help wrote:
> M-x R is returning the message "Searching for program: No such file or
> directory, Rterm" under MS Windows.
>
> R 4.0.3 is installed in c:\Program Files\R\4.0.3, and Rterm.exe is
> present in c:/Program Files/R/R-4.0.3/bin/x64.
> My path environment variable includes c:\Program Files\R\4.0.3.
> R starts fine outside of Emacs.
> My .emacs file includes:
>    (require 'ess-rutils)
>    (setq inferior-ess-r-program "c:/Program
> Files/R/R-4.0.3/bin/x64/Rterm.exe)
> I am using Vincent Goulet's emacs-26.1-modified-2.exe and
> emacs-27.1-modified-1.exe which bundle ESS within the Emacs
> installation.
> Everything worked fine under Emacs 26.1 and earlier.  I upgraded to
> Emacs 27.1 and M-x R still worked.  I backed down to Emacs 26.1 and
> now M-x R is broken.
>
> I am baffled as to why ESS is not finding R.  Any clues?
>
> Many thanks

-- 
Jeremie Juste

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] ESS M-x R failing in a Windows installation

2021-03-05 Thread Steve Gutreuter via ESS-help
M-x R is returning the message "Searching for program: No such file or 
directory, Rterm" under MS Windows.


R 4.0.3 is installed in c:\Program Files\R\4.0.3, and Rterm.exe is 
present in c:/Program Files/R/R-4.0.3/bin/x64.

My path environment variable includes c:\Program Files\R\4.0.3.
R starts fine outside of Emacs.
My .emacs file includes:
   (require 'ess-rutils)
   (setq inferior-ess-r-program "c:/Program 
Files/R/R-4.0.3/bin/x64/Rterm.exe)
I am using Vincent Goulet's emacs-26.1-modified-2.exe and 
emacs-27.1-modified-1.exe which bundle ESS within the Emacs installation.
Everything worked fine under Emacs 26.1 and earlier.  I upgraded to 
Emacs 27.1 and M-x R still worked.  I backed down to Emacs 26.1 and now 
M-x R is broken.


I am baffled as to why ESS is not finding R.  Any clues?

Many thanks
--
Steve Gutreuter

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] problem downloading R

2021-03-05 Thread Abby Spurdle
This was quite some time ago.
Namely, 2019.

At the time, I was using a mix of old Windows 8 and 9 computers.
The problem happened on Windows 8, but not Windows 9.

Note that I was trying to help the OP.
Beyond that, I'm not concerned about it.


On Fri, Mar 5, 2021 at 9:30 PM Uwe Ligges
 wrote:
>
> Sounds like you always got corrupted vesions. Either an issue with your
> connection or the mirror. What happens if you try another mirror and
> clear your browser caches?
>
> Best,
> Uwe Ligges
>
> On 05.03.2021 08:58, Abby Spurdle wrote:
> > Does the following sound familiar?
> >
> > The Windows installer starts installing (or decompressing) R, flashing
> > one file name at a time.
> > And then, part way through, says  file is corrupt, and gives you
> > the choice to ignore.
> > And if you click ignore, then the next file does the same thing.
> > And one quickly realizes, that every subsequent file will have the same 
> > message.
> >
> > Then if you re-download the installation file, the same thing happens.
> > Except that the first file flagged as corrupted, is not necessarily
> > the same file.
> >
> >
> > On Fri, Mar 5, 2021 at 5:55 AM Dick Mathews  
> > wrote:
> >>
> >> I am trying to download the Windows version of R. This computer is Win7,
> >> I do have Win10 computers also.
> >>
> >> Tried R4.0.4, got message these files are corrupted.
> >>
> >> Then tried R4.0.3, got same message as above.
> >>
> >> Tried the next, R4.0.2, got same message.
> >>
> >> I checked to see if I was downloading the proper version, seems okay.
> >>
> >> What is the problem? Can anybody help me with this?
> >>
> >> Dick Mathews
> >>
> >> __
> >> 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.
> >
> > __
> > 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.
> >

__
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] quantile from quantile table calculation without original data

2021-03-05 Thread Abby Spurdle
I note three problems with your data:
(1) The name "percent" is misleading, perhaps you want "probability"?
(2) There are straight (or near-straight) regions, each of which, is
equally (or near-equally) spaced, which is not what I would expect in
problems involving "quantiles".
(3) Your plot (approximating the distribution function) is
back-the-front (as per what is customary).


On Fri, Mar 5, 2021 at 10:14 PM PIKAL Petr  wrote:
>
> Dear all
>
> I have table of quantiles, probably from lognormal distribution
>
>  dput(temp)
> temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069,
> 0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1,
> 0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Names = c("size", "percent"
> ), row.names = c(NA, -9L), class = "data.frame")
>
> and I need to calculate quantile for size 0.1
>
> plot(temp$size, temp$percent, pch=19, xlim=c(0,2))
> ss <- approxfun(temp$size, temp$percent)
> points((0:100)/50, ss((0:100)/50))
> abline(v=.1)
>
> If I had original data it would be quite easy with ecdf/quantile function but 
> without it I am lost what function I could use for such task.
>
> Please, give me some hint where to look.
>
>
> Best regards
>
> Petr
> Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
> partnerů PRECHEZA a.s. jsou zveřejněny na: 
> https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
> processing and protection of business partner's personal data are available 
> on website: https://www.precheza.cz/en/personal-data-protection-principles/
> Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
> podléhají tomuto právně závaznému prohlá±ení o vyloučení odpovědnosti: 
> https://www.precheza.cz/01-dovetek/ | This email and any documents attached 
> to it may be confidential and are subject to the legally binding disclaimer: 
> https://www.precheza.cz/en/01-disclaimer/
>
>
> [[alternative HTML version deleted]]
>
> __
> 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.

__
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.


[R-es] Separar respuestas en distintas columnas.

2021-03-05 Thread juan manuel dias
Hola Estimados/as,

Tengo la siguiente tarea que realizar.

Tengo una base y una de las variables (problemas_salud_paciente) es de
respuesta múltiple (acepta más de una opción de respuesta por caso/fila)
pero tiene cargadas todas las respuestas en la misma columna, y
dichas opciones están separadas por una coma (",").

1- Necesito separar cada opción de respuesta en una columna distinta.

2- Generar tantas columnas como opciones de respuesta tenga.

3- Luego, a cada columna (opción de respuesta) debería asignarle valor 1
según si la fila/caso haya respondido por esa opción.

Así está la variable en la base:

id   problemas_salud_paciente
 1Demencia
 2Demencia
 3Enfermedad Pulmonar, Demencia, Afasia primaria progresiva
diagnosticada 2010
 4Enfermedad Cardíaca

Y así necesitaría que quede:

id  demencia | enferm_pulmonar | afasia_prima_progr  | enfermedad_cardiaca
 1  1
 2  1
 3  1   11

 4
  1

Dejo un csv con una muestra de casos de esa variable.

Muchas gracias. Saludos, Juan.


ejemplo_salud.csv
Description: MS-Excel spreadsheet
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread David Winsemius



On 3/5/21 1:14 AM, PIKAL Petr wrote:

Dear all

I have table of quantiles, probably from lognormal distribution

  dput(temp)
temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069,
0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1,
0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Names = c("size", "percent"
), row.names = c(NA, -9L), class = "data.frame")

and I need to calculate quantile for size 0.1

plot(temp$size, temp$percent, pch=19, xlim=c(0,2))
ss <- approxfun(temp$size, temp$percent)
points((0:100)/50, ss((0:100)/50))
abline(v=.1)

If I had original data it would be quite easy with ecdf/quantile function but 
without it I am lost what function I could use for such task.


The quantiles are in reverse order so tryoing to match the data to 
quantiles from candidate parameters requires subtracting them from unity:


> temp$size
[1] 1.6000 0.9466 0.8062 0.6477 0.5069 0.3781 0.3047 0.2681 0.1907
> qlnorm(1-temp$percent, -.5)
[1] 6.21116124 3.14198142 2.18485959 1.19063854 0.60653066 0.30897659 
0.16837670 0.11708517 0.05922877

> qlnorm(1-temp$percent, -.9)
[1] 4.16346589 2.10613313 1.46455518 0.79810888 0.40656966 0.20711321 
0.11286628 0.07848454 0.03970223

> qlnorm(1-temp$percent, -2)
[1] 1.38589740 0.70107082 0.48750807 0.26566737 0.13533528 0.06894200 
0.03756992 0.02612523 0.01321572

> qlnorm(1-temp$percent, -1.6)
[1] 2.06751597 1.04587476 0.72727658 0.39632914 0.20189652 0.10284937 
0.05604773 0.03897427 0.01971554

> qlnorm(1-temp$percent, -1.6, .5)
[1] 0.64608380 0.45951983 0.38319004 0.28287360 0.20189652 0.14410042 
0.10637595 0.08870608 0.06309120

> qlnorm(1-temp$percent, -1, .5)
[1] 1.1772414 0.8372997 0.6982178 0.5154293 0.3678794 0.2625681 
0.1938296 0.1616330 0.1149597

> qlnorm(1-temp$percent, -1, .4)
[1] 0.9328967 0.7103066 0.6142340 0.4818106 0.3678794 0.2808889 
0.2203318 0.1905308 0.1450700

> qlnorm(1-temp$percent, -0.5, .4)
[1] 1.5380866 1.1710976 1.0127006 0.7943715 0.6065307 0.4631076 
0.3632657 0.3141322 0.2391799

> qlnorm(1-temp$percent, -0.55, .4)
[1] 1.4630732 1.1139825 0.9633106 0.7556295 0.5769498 0.4405216 
0.3455491 0.2988118 0.2275150

> qlnorm(1-temp$percent, -0.55, .35)
[1] 1.3024170 1.0260318 0.9035201 0.7305712 0.5769498 0.4556313 
0.3684158 0.3244257 0.2555795

> qlnorm(1-temp$percent, -0.55, .45)
[1] 1.6435467 1.2094723 1.0270578 0.7815473 0.5769498 0.4259129 
0.3241016 0.2752201 0.2025322

> qlnorm(1-temp$percent, -0.53, .45)
[1] 1.6767486 1.2339052 1.0478057 0.7973356 0.5886050 0.4345169 
0.3306489 0.2807799 0.2066236

> qlnorm(1-temp$percent, -0.57, .45)
[1] 1.6110023 1.1855231 1.0067207 0.7660716 0.5655254 0.4174793 
0.3176840 0.2697704 0.1985218


Seems like it might be an acceptable fit. modulo the underlying data 
gathering situation which really should be considered.


You can fiddle with that result. My statistical hat (not of PhD level 
certification) says that the middle quantiles in this sequence probably 
have the lowest sampling error for a lognormal, but I'm rather unsure 
about that. A counter-argument might be that since there is a hard lower 
bound of 0 for the 0-th quantile that you should be more worried about 
matching the 0.1907 value to the 0.01 order statistic, since 99% of the 
data is know to be above it. Seems like efforts at matching the 0.50 
quantile to 0.5069 for the logmean parameter and matching the 0.01 
quantile 0.1907 for estimation of  the variance estimate might be 
preferred to worrying too much about the 1.6 value which would be in the 
right tail (and far away from your region of extrapolation.)



Further trial and error:


> qlnorm(1-temp$percent, -0.58, .47)
[1] 1.6709353 1.2129813 1.0225804 0.7687497 0.5598984 0.4077870 
0.3065638 0.2584427 0.1876112

> qlnorm(1-temp$percent, -0.65, .47)
[1] 1.5579697 1.1309763 0.9534476 0.7167775 0.5220458 0.3802181 
0.2858382 0.2409704 0.1749275

> qlnorm(1-temp$percent, -0.65, .5)
[1] 1.6705851 1.1881849 0.9908182 0.7314290 0.5220458 0.3726018 
0.2750573 0.2293682 0.1631355

> qlnorm(1-temp$percent, -0.65, .4)
[1] 1.3238434 1.0079731 0.8716395 0.6837218 0.5220458 0.3986004 
0.3126657 0.2703761 0.2058641

> qlnorm(1-temp$percent, -0.68, .4)
[1] 1.2847179 0.9781830 0.8458786 0.6635148 0.5066170 0.3868200 
0.3034251 0.2623852 0.1997799

> qlnorm(1-temp$percent, -0.65, .39)
[1] 1.2934016 0.9915290 0.8605402 0.6791257 0.5220458 0.4012980 
0.3166985 0.2748601 0.2107093

>
> qlnorm(1-temp$percent, -0.65, .42)
[1] 1.3868932 1.0416839 0.8942693 0.6930076 0.5220458 0.3932595 
0.3047536 0.2616262 0.1965053

> qlnorm(1-temp$percent, -0.68, .42)
[1] 1.3459043 1.0108975 0.8678396 0.6725261 0.5066170 0.3816369 
0.2957468 0.2538940 0.1906976



(I did make an effort at searching for quantile matching as a method for 
distribution fitting, but came up empty.)



--

David.



Please, give me some hint where to look.


Best regards

Petr

>[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and 

Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread Jeff Newmiller
Your example could probably be resolved with approx. If you want a more robust 
solution, it looks like the fBasics package can do spline interpolation. You 
may want to spline on the log  of your size variable and use exp on the output 
if you want to avoid negative results.

On March 5, 2021 1:14:22 AM PST, PIKAL Petr  wrote:
>Dear all
>
>I have table of quantiles, probably from lognormal distribution
>
> dput(temp)
>temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069,
>0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1,
>0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Names = c("size", "percent"
>), row.names = c(NA, -9L), class = "data.frame")
>
>and I need to calculate quantile for size 0.1
>
>plot(temp$size, temp$percent, pch=19, xlim=c(0,2))
>ss <- approxfun(temp$size, temp$percent)
>points((0:100)/50, ss((0:100)/50))
>abline(v=.1)
>
>If I had original data it would be quite easy with ecdf/quantile
>function but without it I am lost what function I could use for such
>task.
>
>Please, give me some hint where to look.
>
>
>Best regards
>
>Petr
>Osobn� �daje: Informace o zpracov�n� a ochran� osobn�ch �daj�
>obchodn�ch partner� PRECHEZA a.s. jsou zve�ejn�ny na:
>https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information
>about processing and protection of business partner's personal data are
>available on website:
>https://www.precheza.cz/en/personal-data-protection-principles/
>D�v�rnost: Tento e-mail a jak�koliv k n�mu p�ipojen� dokumenty jsou
>d�v�rn� a podl�haj� tomuto pr�vn� z�vazn�mu prohl�en� o vylou�en�
>odpov�dnosti: https://www.precheza.cz/01-dovetek/ | This email and any
>documents attached to it may be confidential and are subject to the
>legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/
>
>
>   [[alternative HTML version deleted]]

-- 
Sent from my phone. Please excuse my brevity.

__
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: [ESS] [External] Re: [External] Re: [External] Re: emacs 27.1 crashes regularly on Mac M1

2021-03-05 Thread Richard M. Heiberger via ESS-help
I am out of my depth.  I downloaded
https://emacsformacosx.com/emacs-builds/Emacs-27.1-1-universal.dmg
When I unpacked it, it has the same files as vincent's distribution.
download
  -rwxr-xr-x   1 rmh  staff   7308192 Aug 12  2020 Emacs-x86_64-10_10
  -rw-r--r--@  1 rmh  staff  15484072 Aug 12  2020 Emacs-x86_64-10_10.pdmp
  -rwxr-xr-x   1 rmh  staff   7418304 Aug 12  2020 Emacs-x86_64-10_14
  -rw-r--r--@  1 rmh  staff  15484336 Aug 12  2020 Emacs-x86_64-10_14.pdmp
  -rw-r--r--@  1 rmh  staff  15484072 Aug 12  2020 Emacs.pdmp
   lrwxr-xr-x   1 rmh  staff16 Aug 12  2020 bin -> bin-x86_64-10_10
  drwxr-xr-x   6 rmh  staff   204 Aug 12  2020 bin-x86_64-10_10
  drwxr-xr-x   6 rmh  staff   204 Aug 12  2020 bin-x86_64-10_14
 
Vincent
  -rwxr-xr-x@  1 rmh  admin   7308192 Sep 16 10:09 Emacs-x86_64-10_10
  -rw-r--r--@  1 rmh  admin  15484072 Aug 12  2020 Emacs-x86_64-10_10.pdmp
  -rwxr-xr-x@  1 rmh  admin   7418304 Sep 16 10:09 Emacs-x86_64-10_14
  -rw-r--r--@  1 rmh  admin  15484336 Aug 12  2020 Emacs-x86_64-10_14.pdmp
  -rw-r--r--@  1 rmh  admin  15484072 Aug 12  2020 Emacs.pdmp
   lrwxr-xr-x   1 rmh  admin16 Sep 16 10:09 bin -> bin-x86_64-10_10
  drwxr-xr-x@  6 rmh  admin   192 Sep 16 10:09 bin-x86_64-10_10
  drwxr-xr-x@  6 rmh  admin   192 Sep 16 10:09 bin-x86_64-10_14

My March 1 crash report said
> Process:   Emacs-x86_64-10_14 [1112]
> Path:  
> /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
> Identifier:org.gnu.Emacs
> Version:   Version 27.1 (9.0)
> Code Type: X86-64 (Translated)
> Parent Process:??? [1]
> Responsible:   Emacs-x86_64-10_14 [1112]

Which looks to be translated (Code Type: X86-64 (Translated))

Why is it running Emacs-x86_64-10_14 when the redirection
  lrwxr-xr-x   1 rmh  admin16 Sep 16 10:09 bin -> bin-x86_64-10_10
suggests it should be running 
Emacs-x86_64-10_10


I will not finish the installation (by dragging the newly downloaded Emacs to 
the Appliations folder)
until I hear further.

Rich


From: Richard M. Heiberger 
Sent: Friday, March 5, 2021 12:18
To: ess-help@r-project.org; Sparapani, Rodney
Subject: Re: [External] Re: [ESS]  [External] Re: [External] Re: emacs 27.1 
crashes regularly on Mac M1

good idea. i am now downloading a universal build instead of the x86-64 that 
Vincent Goulet distributed.
I will report back in a few days.


From: ESS-help  on behalf of Sparapani, Rodney 
via ESS-help 
Sent: Friday, March 5, 2021 09:17
To: ess-help@r-project.org
Subject: [External] Re: [ESS]  [External] Re: [External] Re: emacs 27.1 crashes 
regularly on Mac M1

Hi Rich:

To me, it seems unlikely that this is an emacs issue.
I think you should be sending your crash reports to
Apple.  Especially if this is a Rosetta issue as you
suspect.  My 2 cents ;o)

--

Rodney Sparapani, Associate Professor of Biostatistics
Chair ISBA Section on Biostatistics and Pharmaceutical Statistics
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus


__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] [External] Re: [External] Re: [External] Re: emacs 27.1 crashes regularly on Mac M1

2021-03-05 Thread Richard M. Heiberger via ESS-help
good idea. i am now downloading a universal build instead of the x86-64 that 
Vincent Goulet distributed.
I will report back in a few days.


From: ESS-help  on behalf of Sparapani, Rodney 
via ESS-help 
Sent: Friday, March 5, 2021 09:17
To: ess-help@r-project.org
Subject: [External] Re: [ESS]  [External] Re: [External] Re: emacs 27.1 crashes 
regularly on Mac M1

Hi Rich:

To me, it seems unlikely that this is an emacs issue.
I think you should be sending your crash reports to
Apple.  Especially if this is a Rosetta issue as you
suspect.  My 2 cents ;o)

--

Rodney Sparapani, Associate Professor of Biostatistics
Chair ISBA Section on Biostatistics and Pharmaceutical Statistics
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus


__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] readline with trailing space

2021-03-05 Thread Greg Minshall via ESS-help
Jeremie,

i am runnnig

ess-version: 18.10.3snapshot [elpa: 20210109.1455] (loaded from
/home/minshall/.emacs.d/elpa/ess-20210109.1455/)

under arch linux.  i don't see the behavior you see.  in my
configuration, both test() and test1() seem to accept a line of
characters.

have you tried starting emacs -whatever (like, -q or -Q or ...)?

cheers, Greg

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] "global parameter" warning using data.table in package.

2021-03-05 Thread Bert Gunter
I believe these questions belong on r-package-devel, not here.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Fri, Mar 5, 2021 at 5:25 AM Martin Møller Skarbiniks Pedersen <
traxpla...@gmail.com> wrote:

> Hi,
>
>   I am converting a couple of functions into a R-package. Many of the
> functions use data.table.
>   I have two questions using data.table in my own package.
>   Normally I would put each question in separate emails but I think they
> might be connected.
>
> First question is short and I think the answer is yes.
> 1. Do I always need to prefix data.table each time I use something from
> that package?
> Eg. DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6),
> v=1:9)
>
> Second question is longer.
> 2.  In this small example code:
> hello <- function() {
>   DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6),
> v=1:9)
>   DT[, .(sum(v))]
> }
>
> I get these warnings from R CMD check:
> hello: no visible global function definition for ‘.’
> hello: no visible binding for global variable ‘v’
> Undefined global functions or variables:
>   . v
>
> According to: vignette("datatable-importing", package = "data.table")
> The solution is
> hello <- function() {
>   v <- NULL
>   . <- NULL
>
> And it works but looks a bit weird.
> Is there a better solution?
>
> Regards
> Martin
>
> [[alternative HTML version deleted]]
>
> __
> 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.
>

[[alternative HTML version deleted]]

__
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] A tibble with date column appears different in shiny

2021-03-05 Thread Gayathri Nagarajan
Hi Rui

Alas, at last this worked and this is what I did :

1) I stopped debugging and started a fresh new table to display in shiny UI
using this example-https://shiny.rstudio.com/gallery/basic-datatable.html
2) Now instead of the table mpg, I plugged in my us_counties above at first
and it worked :-)

I really don't have an answer as to how this was working fine till 2 days
back with the reactive inputs I had in Shiny UI or the read.csv

command for the .csv file in GITHUB.


Thanks so much to you for your help as you tried to relentlessly help me
out the past three days.
*So the conclusion is - Starting afresh with DT::dataTableOutput solved the
issue*

*Code  change*
*===*

In UI.R:
tabPanel(strong("Table"),DT::dataTableOutput("dumtable"))

In Server.R
output$dumtable <- DT::renderDataTable(DT::datatable({
 data <- us_counties
   data <- data[data$state == input$state,]


   data <- data[data$county == input$county,]

   data <- data[data$date >= input$date2,]

head(data,n=input$obs)
   }))
   



Regards
Gayathri


On Thu, 4 Mar 2021 at 21:51, Gayathri Nagarajan <
gayathri.nagara...@gmail.com> wrote:

> Hi Rui
>
> Tried renderDatatable, but now my shiny UI shows Blank for my tibble. Not
> sure what Iam missing suddenly when this was working fine a day back.
>
> The one change I did was:
>
> x <- getURL("
> https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv
> ")
> us_counties <- read.csv(text = x)
>
> Error in function (type, msg, asError = TRUE)  :
>   error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol
> version
>
> Hence had to change this to :
>
>
>   urlfile="
> https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv
> "
>   #GN added 3/3
>   #GN comment 3/4
>   #us_counties<-read_csv(url(urlfile),col_types = list(date = col_date()))
>   #GN Add 3/4
>   #GN added 3/3
>   cols_spec <- cols(
> date = col_date(format = ""),
> county = col_character(),
> state = col_character(),
> fips = col_character(),
> cases = col_double(),
> deaths = col_double()
>   )
>
>   us_counties <- read_csv(url(urlfile), col_types = cols_spec)
>  ===
>
>
> Regards
> Gayathri
>
>
> On Thu, 4 Mar 2021 at 08:41, Rui Barradas  wrote:
>
>> Hello,
>>
>> This is a known issue with renderTable. Show the results with
>> renderDataTable instead.
>>
>> Hope this helps,
>>
>> Rui Barradas
>>
>> Às 15:24 de 03/03/21, Gayathri Nagarajan escreveu:
>> > Hi Team
>> >
>> > I have a tibble like the below :
>> >
>> > class(us_counties)
>> > [1] "tbl_df" "tbl""data.frame"
>> >
>> > head(us_counties)
>> > # A tibble: 6 x 8
>> >date   deaths Todays_deaths county state fips
>> >   
>> > 1 2020-03-19  0 0 Abbev~ Sout~ 45001
>> > 2 2020-03-20  0 0 Abbev~ Sout~ 45001
>> > 3 2020-03-21  0 0 Abbev~ Sout~ 45001
>> > 4 2020-03-22  0 0 Abbev~ Sout~ 45001
>> > 5 2020-03-23  0 0 Abbev~ Sout~ 45001
>> > 6 2020-03-24  0 0 Abbev~ Sout~ 45001
>> >
>> > str(us_counties)
>> > tibble [1,082,715 x 8] (S3: tbl_df/tbl/data.frame)
>> >   $ date : Date[1:1082715], format: "2020-03-19" ...
>> >   $ deaths   : num [1:1082715] 0 0 0 0 0 0 0 0 0 0 ...
>> >   $ Todays_deaths: num [1:1082715] 0 0 0 0 0 0 0 0 0 0 ...
>> >   $ county   : chr [1:1082715] "Abbeville" "Abbeville" "Abbeville"
>> > "Abbeville" ...
>> >   $ state: chr [1:1082715] "South Carolina" "South Carolina"
>> "South
>> > Carolina" "South Carolina" ...
>> >   $ fips : chr [1:1082715] "45001" "45001" "45001" "45001" ...
>> >   $ cases: num [1:1082715] 1 1 1 1 1 1 3 4 4 4 ...
>> >   $ Todays_cases : num [1:1082715] 0 0 0 0 0 0 0 0 0 0 ...
>> >   - attr(*, "spec")=
>> >.. cols(
>> >..   date = col_date(format = ""),
>> >..   county = col_character(),
>> >..   state = col_character(),
>> >..   fips = col_character(),
>> >..   cases = col_double(),
>> >..   deaths = col_double()
>> >.. )
>> >   - attr(*, ".internal.selfref")=
>> >>
>> >
>> >
>> >
>> > Now when I display this in shiny UI using a simple  command:
>> >
>> >
>> > # Generate an HTML table view of the data 
>> > output$ttable <- renderTable({
>> > head(us_counties
>> >  , n = input$obs)
>> > })
>> >
>> >
>> > I get a display like the below
>> >
>> > datedeathsTodays_deathscountystatefipscasesTodays_cases
>> > 18679.00 34.00 0.00 Abbeville South Carolina 45001 2184.00 0.00
>> > 18680.00 34.00 0.00 Abbeville South Carolina 45001 2191.00 0.00
>> > 18681.00 34.00 0.00 Abbeville South Carolina 45001 2192.00 0.00
>> >
>> > This is the change I made
>> >
>> > old code
>> > 
>> >   #x <- getURL("
>> >
>> 

Re: [ESS] [External] Re: [External] Re: emacs 27.1 crashes regularly on Mac M1

2021-03-05 Thread Sparapani, Rodney via ESS-help
Hi Rich:

To me, it seems unlikely that this is an emacs issue.
I think you should be sending your crash reports to
Apple.  Especially if this is a Rosetta issue as you 
suspect.  My 2 cents ;o)

-- 

Rodney Sparapani, Associate Professor of Biostatistics
Chair ISBA Section on Biostatistics and Pharmaceutical Statistics 
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus
 

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[R] poLCA problem

2021-03-05 Thread Scott Colwell
Good morning everyone,

I am running into errors with poLCA as follows:

Error in round(mf) : non-numeric argument to mathematical function.

Here is what I have. Both variables are coded as 1, 2, 3

df <- as.data.frame(data)

items <- c("x1", "x2")  <- there are more variables but shortened for this
purpose

df2 <- df[items]

i <- cbind(x1, x2)~1

poLCA (i, df2, nclass=2, maxiter=100, nrep=10, verbose =TRUE)

It is after the poLCA that I get the error. Any thoughts on what is causing
this?

Thanks,

Scott

[[alternative HTML version deleted]]

__
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] "global parameter" warning using data.table in package.

2021-03-05 Thread Martin Møller Skarbiniks Pedersen
Please ignore my previous email. I just found the R-package-devel mailing
list.

On Fri, 5 Mar 2021 at 14:25, Martin Møller Skarbiniks Pedersen <
traxpla...@gmail.com> wrote:

> Hi,
>
>   I am converting a couple of functions into a R-package. Many of the
> functions use data.table.
>   I have two questions using data.table in my own package.
>   Normally I would put each question in separate emails but I think they
> might be connected.
>
> First question is short and I think the answer is yes.
> 1. Do I always need to prefix data.table each time I use something from
> that package?
> Eg. DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6),
> v=1:9)
>
> Second question is longer.
> 2.  In this small example code:
> hello <- function() {
>   DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6),
> v=1:9)
>   DT[, .(sum(v))]
> }
>
> I get these warnings from R CMD check:
> hello: no visible global function definition for ‘.’
> hello: no visible binding for global variable ‘v’
> Undefined global functions or variables:
>   . v
>
> According to: vignette("datatable-importing", package = "data.table")
> The solution is
> hello <- function() {
>   v <- NULL
>   . <- NULL
>
> And it works but looks a bit weird.
> Is there a better solution?
>
> Regards
> Martin
>


-- 
Til uvedkommende, der læser med: Der er ingen grund til at læse min
mail. Jeg har intet at gøre med FARC, al-Jihad, al-Qaida, Hamas, Hizb
al-Mujahidin eller ETA. Jeg har aldrig gjort Zakat, går ikke ind for
Istishad, har ikke lavet en bilbombe eller kernevåben og jeg ved
dårligt nok, hvad Al Manar og бомба betyder.  Men tak for den udviste
interesse.

Leve Ligemageriet!
Styrk pøbelvældet!
Bevar misundelsesafgifterne og cafepengene!
Hurra for ældrebyrden!

[[alternative HTML version deleted]]

__
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.


[R] "global parameter" warning using data.table in package.

2021-03-05 Thread Martin Møller Skarbiniks Pedersen
Hi,

  I am converting a couple of functions into a R-package. Many of the
functions use data.table.
  I have two questions using data.table in my own package.
  Normally I would put each question in separate emails but I think they
might be connected.

First question is short and I think the answer is yes.
1. Do I always need to prefix data.table each time I use something from
that package?
Eg. DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6),
v=1:9)

Second question is longer.
2.  In this small example code:
hello <- function() {
  DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6),
v=1:9)
  DT[, .(sum(v))]
}

I get these warnings from R CMD check:
hello: no visible global function definition for ‘.’
hello: no visible binding for global variable ‘v’
Undefined global functions or variables:
  . v

According to: vignette("datatable-importing", package = "data.table")
The solution is
hello <- function() {
  v <- NULL
  . <- NULL

And it works but looks a bit weird.
Is there a better solution?

Regards
Martin

[[alternative HTML version deleted]]

__
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.


[ESS] readline with trailing space

2021-03-05 Thread Jeremie Juste via ESS-help
Hello,

I have noticed a behavior that I don't understand. When I call the
following function from the prompt.
test <- function(){
a <- readline("selection: ")
a
}

> test()
> selection: |
I can only type one character and the readline function exits before I can
press enter.

however

test1 <- function(){
a <- readline("selection:")
a
}
> test1()
> selection:|
works as expected.
> selection: abc[Ret]

However calling directly readline with a space in the prompt does what I
would expect.

> a <- readline("selection: ")
> selection: abc[Ret]
> a
> "abc"

It is the expected behavior or am I missing something?


I can reproduce this behavior on Windows and Linux.
I cannot reproduce this behavior in a bash terminal, or on RStudio.
I'm using ess-version: 18.10.3snapshot [elpa: 20200825.829] (loaded from
/home/djj/.emacs.d/elpa/ess-20200825.829/) but the problem still persist
in the latest version. 

Best regards.
-- 
Jeremie Juste

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Trailing slash deleted from find-file prompt

2021-03-05 Thread Brendan.Halpin via ESS-help
To demonstrate:

Starting an R session with M-x R. The comments "# default-directory" are 
evaluated with C-u C-x C-e. Sourcing a small file doesn't change 
default-directory, but running it from the buffer with C-c C-r strips the final 
slash. 

ess-version: 18.10.3snapshot [elpa: 20210227.2101] (loaded from 
/home/brendan/.emacs.d/elpa/ess-20210227.2101/)

> setwd('/tmp/test/')
> # default-directory "/tmp/test/"
> ls()
character(0)
> # default-directory "/tmp/test/"
> source("mwe.R")
[1] "Start 2021-03-05 10:44:32"
[1] "End   2021-03-05 10:44:32"
> # default-directory "/tmp/test/"
> start <- Sys.time()
+ print(sprintf("Start %s", start))
+ print(sprintf("End   %s", Sys.time()))
> [1] "Start 2021-03-05 10:44:49"
> [1] "End   2021-03-05 10:44:49"
> # default-directory "/tmp/test"

However, I can't reproduce this all the time: in a fresh emacs session it might 
not happen to begin with.

I have reproduced this in emacs -q, with just:
(package-initialize)
(require 'ess)
as setup, so it's not down to my (extensive) cruft.

It may be worth noting that this happens in the *R* buffer, but not the mwe.R 
buffer (which retains the correct value). 

Regards,

Brendan
-- 
Brendan Halpin, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147
Room F1-007 x 3147
http://teaching.sociology.ul.ie/bhalpin/wordpress
twitter:@BrendanTHalpin
Papers online at: http://teaching.sociology.ul.ie/bhalpin/publications.html
ULSociology on Facebook: Sociology@Limerick twitter:@ULSociology

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Trailing slash deleted from find-file prompt

2021-03-05 Thread Brendan.Halpin via ESS-help
Thanks for the hint.

They have the values nil (use current) and t (ask) respectively, for the moment.

Brendan
-- 
Brendan Halpin, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147
Room F1-007 x 3147
http://teaching.sociology.ul.ie/bhalpin/wordpress
twitter:@BrendanTHalpin
Papers online at: http://teaching.sociology.ul.ie/bhalpin/publications.html
ULSociology on Facebook: Sociology@Limerick twitter:@ULSociology

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] A tibble with date column appears different in shiny

2021-03-05 Thread ruipbarradas
Hello,

In

us_counties <- read.csv(text = x)

remove 'text=', you are reading from a url, not from a text string.

Hope this helps,

Rui Barradas

- Mensagem de Gayathri Nagarajan  -

  Data: Thu, 4 Mar 2021 21:51:05 -0800

  De: Gayathri Nagarajan 

  Assunto: Re: [R] A tibble with date column appears different in shiny

  Para: Rui Barradas 

> Hi Rui
>
> Tried renderDatatable, but now my shiny UI shows Blank for my  
> tibble. Not sure what Iam missing suddenly when this was working  
> fine a day back.
>
> The one change I did was:
>
> x <-  
> getURL("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv;)
>
>  us_counties <- read.csv(text = x)
>
> Error in function (type, msg, asError = TRUE)  :
>
>    error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert  
> protocol version
>
> Hence had to change this to :
>
>    
> urlfile="https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv;
>
>    #GN added 3/3
>
>    #GN comment 3/4
>
>    #us_counties<-read_csv(url(urlfile),col_types = list(date = col_date()))
>
>    #GN Add 3/4
>
>    #GN added 3/3
>
>    cols_spec <- cols(
>
>      date = col_date(format = ""),
>
>      county = col_character(),
>
>      state = col_character(),
>
>      fips = col_character(),
>
>      cases = col_double(),
>
>      deaths = col_double()
>
>    )
>
>   
>
>    us_counties <- read_csv(url(urlfile), col_types = cols_spec)
>
>   ===
>
>  
>
>  
>
>
>
> Regards
>
> Gayathri
>
> On Thu, 4 Mar 2021 at 08:41, Rui Barradas  wrote:
>
>> Hello,
>>
>>
>>
>>  This is a known issue with renderTable. Show the results with
>>
>>  renderDataTable instead.
>>
>>
>>
>>  Hope this helps,
>>
>>
>>
>>  Rui Barradas
>>
>>
>>
>>  Às 15:24 de 03/03/21, Gayathri Nagarajan escreveu:
>>
>>  > Hi Team
>>
>>  >
>>
>>  > I have a tibble like the below :
>>
>>  >
>>
>>  > class(us_counties)
>>
>>  > [1] "tbl_df"     "tbl"        "data.frame"
>>
>>  >
>>
>>  > head(us_counties)
>>
>>  > # A tibble: 6 x 8
>>
>>  >    date       deaths Todays_deaths county state fips
>>
>>  >                       
>>
>>  > 1 2020-03-19      0             0 Abbev~ Sout~ 45001
>>
>>  > 2 2020-03-20      0             0 Abbev~ Sout~ 45001
>>
>>  > 3 2020-03-21      0             0 Abbev~ Sout~ 45001
>>
>>  > 4 2020-03-22      0             0 Abbev~ Sout~ 45001
>>
>>  > 5 2020-03-23      0             0 Abbev~ Sout~ 45001
>>
>>  > 6 2020-03-24      0             0 Abbev~ Sout~ 45001
>>
>>  >
>>
>>  > str(us_counties)
>>
>>  > tibble [1,082,715 x 8] (S3: tbl_df/tbl/data.frame)
>>
>>  >   $ date         : Date[1:1082715], format: "2020-03-19" ...
>>
>>  >   $ deaths       : num [1:1082715] 0 0 0 0 0 0 0 0 0 0 ...
>>
>>  >   $ Todays_deaths: num [1:1082715] 0 0 0 0 0 0 0 0 0 0 ...
>>
>>  >   $ county       : chr [1:1082715] "Abbeville" "Abbeville" "Abbeville"
>>
>>  > "Abbeville" ...
>>
>>  >   $ state        : chr [1:1082715] "South Carolina" "South  
>> Carolina" "South
>>
>>  > Carolina" "South Carolina" ...
>>
>>  >   $ fips         : chr [1:1082715] "45001" "45001" "45001" "45001" ...
>>
>>  >   $ cases        : num [1:1082715] 1 1 1 1 1 1 3 4 4 4 ...
>>
>>  >   $ Todays_cases : num [1:1082715] 0 0 0 0 0 0 0 0 0 0 ...
>>
>>  >   - attr(*, "spec")=
>>
>>  >    .. cols(
>>
>>  >    ..   date = col_date(format = ""),
>>
>>  >    ..   county = col_character(),
>>
>>  >    ..   state = col_character(),
>>
>>  >    ..   fips = col_character(),
>>
>>  >    ..   cases = col_double(),
>>
>>  >    ..   deaths = col_double()
>>
>>  >    .. )
>>
>>  >   - attr(*, ".internal.selfref")=
>>
>>  >>
>>
>>  >
>>
>>  >
>>
>>  >
>>
>>  > Now when I display this in shiny UI using a simple  command:
>>
>>  >
>>
>>  >
>>
>>  >     # Generate an HTML table view of the data 
>>
>>  >     output$ttable <- renderTable({
>>
>>  >         head(us_counties
>>
>>  >              , n = input$obs)
>>
>>  >     })
>>
>>  >
>>
>>  >
>>
>>  > I get a display like the below
>>
>>  >
>>
>>  > datedeathsTodays_deathscountystatefipscasesTodays_cases
>>
>>  > 18679.00 34.00 0.00 Abbeville South Carolina 45001 2184.00 0.00
>>
>>  > 18680.00 34.00 0.00 Abbeville South Carolina 45001 2191.00 0.00
>>
>>  > 18681.00 34.00 0.00 Abbeville South Carolina 45001 2192.00 0.00
>>
>>  >
>>
>>  > This is the change I made
>>
>>  >
>>
>>  > old code
>>
>>  > 
>>
>>  >   #x <- getURL("
>>
>>  >  
>> https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv
>>
>>  > ")
>>
>>  >    #us_counties <- read.csv(text = x)
>>
>>  >    # 855612 Rows , 6 columns class(us_counties)
>>
>>  >
>>
>>  >
>>
>>  > this stopped working, so I changed to below
>>
>>  >
>>
>>  >
>>
>>  >    urlfile="
>>
>>  >  
>> https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv
>>
>>  > "
>>
>>  >    #GN added 3/3
>>
>>  >    us_counties<-read_csv(url(urlfile),col_types = list(date =  
>> col_date()))
>>
>>  >
>>
>>  >   Please let me know how to correct 

[R] quantile from quantile table calculation without original data

2021-03-05 Thread PIKAL Petr
Dear all

I have table of quantiles, probably from lognormal distribution

 dput(temp)
temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069,
0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1,
0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Names = c("size", "percent"
), row.names = c(NA, -9L), class = "data.frame")

and I need to calculate quantile for size 0.1

plot(temp$size, temp$percent, pch=19, xlim=c(0,2))
ss <- approxfun(temp$size, temp$percent)
points((0:100)/50, ss((0:100)/50))
abline(v=.1)

If I had original data it would be quite easy with ecdf/quantile function but 
without it I am lost what function I could use for such task.

Please, give me some hint where to look.


Best regards

Petr
Osobn� �daje: Informace o zpracov�n� a ochran� osobn�ch �daj� obchodn�ch 
partner� PRECHEZA a.s. jsou zve�ejn�ny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner's personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
D�v�rnost: Tento e-mail a jak�koliv k n�mu p�ipojen� dokumenty jsou d�v�rn� a 
podl�haj� tomuto pr�vn� z�vazn�mu prohl�en� o vylou�en� odpov�dnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/


[[alternative HTML version deleted]]

__
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] problem downloading R

2021-03-05 Thread Uwe Ligges
Sounds like you always got corrupted vesions. Either an issue with your 
connection or the mirror. What happens if you try another mirror and 
clear your browser caches?


Best,
Uwe Ligges

On 05.03.2021 08:58, Abby Spurdle wrote:

Does the following sound familiar?

The Windows installer starts installing (or decompressing) R, flashing
one file name at a time.
And then, part way through, says  file is corrupt, and gives you
the choice to ignore.
And if you click ignore, then the next file does the same thing.
And one quickly realizes, that every subsequent file will have the same message.

Then if you re-download the installation file, the same thing happens.
Except that the first file flagged as corrupted, is not necessarily
the same file.


On Fri, Mar 5, 2021 at 5:55 AM Dick Mathews  wrote:


I am trying to download the Windows version of R. This computer is Win7,
I do have Win10 computers also.

Tried R4.0.4, got message these files are corrupted.

Then tried R4.0.3, got same message as above.

Tried the next, R4.0.2, got same message.

I checked to see if I was downloading the proper version, seems okay.

What is the problem? Can anybody help me with this?

Dick Mathews

__
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.


__
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.



__
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.