Re: [R] Fortune nomination .... Re: Looping through a dataframe

2020-07-24 Thread Chris Evans
I really don't want to put too many Emails to the list but I had the same 
reaction to that lovely line ... so now my question is:

Is there a way to make fortune nominations other than through the list.  I see 
the package has a long list of illustrious authors but I can't find a side 
channel or open port for nominations despite a bit of searching.

TIA and very best to all,

Chris

- Original Message -
> From: "John Kane" 
> To: "David Winsemius" 
> Cc: "R. Help Mailing List" 
> Sent: Saturday, 25 July, 2020 02:55:34
> Subject: Re: [R] Fortune nomination  Re: Looping through a dataframe

> Yes I think so.
> 
> On Fri, 24 Jul 2020 at 20:53, David Winsemius 
> wrote:
> 
>>
>> On 7/21/20 2:31 PM, Jim Lemon wrote:
>> >   I want to get a total for the number of years of data for each
>> company. When I loop through the data 
>>
>> After two one liners using `table`:
>> > I'm too lazy to provide a difficult way.
>> >
>> > Jim
>> >
>>
>> __
>> 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.
>>
> 
> 
> --
> John Kane
> Kingston ON Canada
> 
>   [[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.

-- 
Small contribution in our coronavirus rigours: 
https://www.coresystemtrust.org.uk/home/free-options-to-replace-paper-core-forms-during-the-coronavirus-pandemic/

Chris Evans  Visiting Professor, University of Sheffield 

I do some consultation work for the University of Roehampton 
 and other places
but  remains my main Email address.  I have a work web site 
at:
   https://www.psyctc.org/psyctc/
and a site I manage for CORE and CORE system trust at:
   http://www.coresystemtrust.org.uk/
I have "semigrated" to France, see: 
   https://www.psyctc.org/pelerinage2016/semigrating-to-france/ 
   
https://www.psyctc.org/pelerinage2016/register-to-get-updates-from-pelerinage2016/

If you want an Emeeting, I am trying to keep them to Thursdays and my diary is 
at:
   https://www.psyctc.org/pelerinage2016/ceworkdiary/
Beware: French time, generally an hour ahead of UK.

__
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] prevent XML::readHTMLTable from suppressing

2020-07-24 Thread Spencer Graves

Hello, All:


  Thanks to Rasmus Liland, William Michels, and Luke Tierney with 
my earlier web scraping question.  With their help, I've made progress.  
Sadly, I still have a problem:  One field has "", which gets 
suppressed by XML::readHTMLTable:



sosURL <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;

sosChars <- RCurl::getURL(sosURL)
MOcan <- XML::readHTMLTable(sosChars)
MOcan[[2]][1, 2]
[1] "4476 FIVE MILE RDSENECA MO 64865"


(Seneca <- regexpr('SENECA', sosChars))
substring(sosChars, Seneca-22, Seneca+14)


[1] "4476 FIVE MILE RDSENECA MO 64865"


  How can I get essentially the same result but without having 
XML::readHTMLTable suppress ""?



NOTE:  I get something very similar with xml2::read_html and 
rvest::html_table:



sosPointers <- xml2::read_html(sosChars)
MOcan2 <- rvest::html_table(sosPointers)
MOcan2[[2]][1, 2]
[1] "4476 FIVE MILE RDSENECA MO 64865"


  MOcan2 does not have names, and some of the fields are 
automatically converted to integers, which I think is not smart in this 
application.



  Thanks,
  Spencer Graves

__
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] Fortune nomination .... Re: Looping through a dataframe

2020-07-24 Thread John Kane
Yes I think so.

On Fri, 24 Jul 2020 at 20:53, David Winsemius 
wrote:

>
> On 7/21/20 2:31 PM, Jim Lemon wrote:
> >   I want to get a total for the number of years of data for each
> company. When I loop through the data 
>
> After two one liners using `table`:
> > I'm too lazy to provide a difficult way.
> >
> > Jim
> >
>
> __
> 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.
>


-- 
John Kane
Kingston ON Canada

[[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] Fortune nomination .... Re: Looping through a dataframe

2020-07-24 Thread David Winsemius



On 7/21/20 2:31 PM, Jim Lemon wrote:

  I want to get a total for the number of years of data for each company. When 
I loop through the data 


After two one liners using `table`:

I'm too lazy to provide a difficult way.

Jim



__
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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread Rui Barradas

Hello,

I've just tried it.

library(ggplot2)
#library(grid)
library(cowplot)

s <- ggplot(data = subset(iris, Species == 'virginica'), 
aes(Sepal.Length, Sepal.Width)) + geom_point()
v <- ggplot(data = subset(iris, Species == 'setosa'), aes(Sepal.Length, 
Sepal.Width)) + geom_point()


#g2 <- ggplotGrob(s)
#g3 <- ggplotGrob(v)
#g <- rbind(g2, g3, size = "first")

cowplot::plot_grid(s, v, align = "h", nrow = 2, rel_heights = 2:1)


Hope this helps,

Rui Barradas

Às 19:57 de 24/07/2020, Felipe Carrillo via R-help escreveu:

What about cowplot?
https://cran.r-project.org/web/packages/cowplot/vignettes/introduction.html

 On Friday, July 24, 2020, 11:51:17 AM PDT, H  wrote:
  
  On 07/24/2020 02:03 PM, Jeff Newmiller wrote:

The set of people interested in helping when you supply a minimal reproducible 
example is rather larger than the set of people willing to read the 
documentation for you (hint) and guess what aspect of alignment you are having 
trouble with.

On July 24, 2020 10:46:57 AM PDT, H  wrote:

On 07/24/2020 01:14 PM, John Kane wrote:

Well, I am not looking for help debugging my code but for

information to better understand arranging plots vertically. The code
above aligns them horizontally as expected.

Sigh, we know the code works but we do not know what the plots are

and we cannot play around with them to see if we can help you if we
have nothing to work with.

On Fri, 24 Jul 2020 at 12:12, H 
> wrote:

     On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
     > Hav a look at the packages cowplot and patchwork
     >
     >> On 24.07.2020, at 02:36, H 
> wrote:

     >>
     >> I am trying to arrange two plots vertically, ie plot 2 below

plot 1, where I want the plots to align columnwise but have a height
ratio of eg 3:1.

     >>
     >> My attempts so far after consulting various webpages is that

the following code aligns them columnwise correctly but I have, so far,
failed in setting the relative heights...

     >>
     >> g2<-ggplotGrob(s)
     >> g3<-ggplotGrob(v)
     >> g<-rbind(g2, g3, size = "first")
     >> g$widths<-unit.pmax(g2$widths, g3$widths)
     >>
     >> what would the appropriate statement for the relative heights

to add here be?

     >>
     >> grid.newpage()
     >> grid.draw(g)
     >>
     >> Thank you!
     >>
     >> __
     >> 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.

     So this is not possible without using one of those two packages?

I got the impression I should be able to use grid.arrange to do so but
was not able to get it to work without disturbing the width alignment
above...

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


--
John Kane
Kingston ON Canada

No need to play around with anything. I am simply looking for
assistance on how to use eg arrangeGrob to not only align two plots
columnwise but also adjust their heights relative to each other rather
than 1:1.

Can arrangeGrob() be used for that?


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

Look at https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html 
where there are two mpg charts, one above the other. What would I need to add 
to:

|library(gtable) g2 <-ggplotGrob(p2) g3 <-ggplotGrob(p3) g <-rbind(g2, g3, size = 
"first") g$widths <-unit.pmax(g2$widths, g3$widths) grid.newpage() grid.draw(g) |

|to make the second chart 1/2 the size of the top one?|

||


     [[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, 

Re: [R] curl options?

2020-07-24 Thread Roy Mendelssohn - NOAA Federal via R-help
Found it.  On June 9,  in the R-developers mail-list,  a chain under the topic 
"SSL certificate issues".

-Roy


> On Jul 24, 2020, at 1:21 PM, Roy Mendelssohn - NOAA Federal 
>  wrote:
> 
> Thank you very much.  That indeed did work,  more specifically as (to include 
> solution for the record):
> 
>> sshInfo <- rerddap::info('hawaii_soest_f75b_adc6_12ab', url = 
>> 'https://apdrc.soest.hawaii.edu/erddap/', ssl_verifyhost=0, ssl_verifypeer=0)
> 
> BTW - my clock and date are fine, the reason it works on some systems has to 
> do with the SSL library being used, whether openSSL or libreSSL.  And as I 
> said,  similar happened to R itself for a very short time.  I can't find the 
> references to the email exchange,  but Simon Urbanek gave a very nice 
> explanation of why this was happening.  I also wonder whether it really is 
> desirable to ignore an expired Cert in the Cert search path.  Not 
> particularly knowledgeable on this,  but my offhand feeling is that could 
> lead to problems.
> 
> Thanks again for the solution!
> 
> -Roy
> 
> 
>> On Jul 23, 2020, at 4:20 PM, Rasmus Liland  wrote:
>> 
>> On 2020-07-23 14:56 -0700, Roy Mendelssohn - NOAA Federal via R-help wrote:
>>> I am trying to get the following command to work:
>>> 
 sshInfo <- rerddap::info('hawaii_soest_f75b_adc6_12ab', url = 
 'https://apdrc.soest.hawaii.edu/erddap/') 
>>> 
>>> On a Mac at least (but I know for a 
>>> fact not necessarily on other OSes) I 
>>> get:
>>> 
 Error in curl::curl_fetch_memory(x$url$url, handle = x$url$handle) : 
 SSL certificate problem: certificate has expired
>>> 
>>> Parenthetically,  this also happened 
>>> with R itself awhile back  where an 
>>> intermediate cert on the search path 
>>> had expired,  not the cert of the 
>>> service itself,  and depending on 
>>> which implementation of ssl was used,  
>>> it either ignored it or threw an 
>>> error,  as  in this case.  Someone I 
>>> am working with on another OS can 
>>> indeed run the same command,  so if 
>>> your particular OS may not have an 
>>> issue
>> 
>> I can download the dataset without 
>> problems on my Linux thinkpad.  Perhaps 
>> you can provide some more info (but I do 
>> not know what ...) so I/others can 
>> reproduce this strange error ... 
>> 
>> Have you checked the time on the laptop 
>> being correct and not set to e.g. 
>> 1970-01-01 01:29?  In the past, I have 
>> found ssl errors are caused by the time 
>> being off on my laptop, as in the case 
>> of a flat cmos battery.
>> 
>>> Anyhow, for a problem a I am working 
>>> on I need to access this server with 
>>> that and related commands.  
>>> 'rerddap::info()' allows me to pass 
>>> curl options,  and normally with Curl 
>>> you can get around the expired 
>>> certificate using the  '-k' or 
>>> '--insecure' option.  When I look at:
>>> 
 curl::curl_options()
>>> 
>>> I do not see this option. I do not 
>>> understand all the options listed 
>>> there,  so maybe that option is in a 
>>> different form that I am missing. Or 
>>> is there another way around this still 
>>> using 'curl' .  Using another function 
>>> that does similar to 'curl'  is not an 
>>> option, because I need the 
>>> 'rerddap::info()' call which calls a 
>>> package called "crul" which ultimately 
>>> calls 'curl'.
>>> 
>>> Thanks,
>>> 
>>> -Roy
>>> 
>>> PS - And yes I informed the owner of 
>>> the site about the expired 
>>> certificate,  that was a couple of 
>>> weeks ago.
>> 
>> Perhaps setting
>> 
>>  options("ssl_verifyhost"=0, "ssl_verifypeer"=0) 
>> 
>> helps? [1]
>> 
>> Best,
>> Rasmus
>> 
>> [1] 
>> https://stackoverflow.com/questions/47715918/how-to-pass-the-curl-insecure-alternative-when-using-r
> 
> **
> "The contents of this message do not reflect any position of the U.S. 
> Government or NOAA."
> **
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
> 
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected" 
> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
> 

**
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is 

Re: [R] curl options?

2020-07-24 Thread Roy Mendelssohn - NOAA Federal via R-help
Thank you very much.  That indeed did work,  more specifically as (to include 
solution for the record):

> sshInfo <- rerddap::info('hawaii_soest_f75b_adc6_12ab', url = 
> 'https://apdrc.soest.hawaii.edu/erddap/', ssl_verifyhost=0, ssl_verifypeer=0)

BTW - my clock and date are fine, the reason it works on some systems has to do 
with the SSL library being used, whether openSSL or libreSSL.  And as I said,  
similar happened to R itself for a very short time.  I can't find the 
references to the email exchange,  but Simon Urbanek gave a very nice 
explanation of why this was happening.  I also wonder whether it really is 
desirable to ignore an expired Cert in the Cert search path.  Not particularly 
knowledgeable on this,  but my offhand feeling is that could lead to problems.

Thanks again for the solution!

-Roy


> On Jul 23, 2020, at 4:20 PM, Rasmus Liland  wrote:
> 
> On 2020-07-23 14:56 -0700, Roy Mendelssohn - NOAA Federal via R-help wrote:
>> I am trying to get the following command to work:
>> 
>>> sshInfo <- rerddap::info('hawaii_soest_f75b_adc6_12ab', url = 
>>> 'https://apdrc.soest.hawaii.edu/erddap/') 
>> 
>> On a Mac at least (but I know for a 
>> fact not necessarily on other OSes) I 
>> get:
>> 
>>> Error in curl::curl_fetch_memory(x$url$url, handle = x$url$handle) : 
>>>  SSL certificate problem: certificate has expired
>> 
>> Parenthetically,  this also happened 
>> with R itself awhile back  where an 
>> intermediate cert on the search path 
>> had expired,  not the cert of the 
>> service itself,  and depending on 
>> which implementation of ssl was used,  
>> it either ignored it or threw an 
>> error,  as  in this case.  Someone I 
>> am working with on another OS can 
>> indeed run the same command,  so if 
>> your particular OS may not have an 
>> issue
> 
> I can download the dataset without 
> problems on my Linux thinkpad.  Perhaps 
> you can provide some more info (but I do 
> not know what ...) so I/others can 
> reproduce this strange error ... 
> 
> Have you checked the time on the laptop 
> being correct and not set to e.g. 
> 1970-01-01 01:29?  In the past, I have 
> found ssl errors are caused by the time 
> being off on my laptop, as in the case 
> of a flat cmos battery.
> 
>> Anyhow, for a problem a I am working 
>> on I need to access this server with 
>> that and related commands.  
>> 'rerddap::info()' allows me to pass 
>> curl options,  and normally with Curl 
>> you can get around the expired 
>> certificate using the  '-k' or 
>> '--insecure' option.  When I look at:
>> 
>>> curl::curl_options()
>> 
>> I do not see this option. I do not 
>> understand all the options listed 
>> there,  so maybe that option is in a 
>> different form that I am missing. Or 
>> is there another way around this still 
>> using 'curl' .  Using another function 
>> that does similar to 'curl'  is not an 
>> option, because I need the 
>> 'rerddap::info()' call which calls a 
>> package called "crul" which ultimately 
>> calls 'curl'.
>> 
>> Thanks,
>> 
>> -Roy
>> 
>> PS - And yes I informed the owner of 
>> the site about the expired 
>> certificate,  that was a couple of 
>> weeks ago.
> 
> Perhaps setting
> 
>   options("ssl_verifyhost"=0, "ssl_verifypeer"=0) 
> 
> helps? [1]
> 
> Best,
> Rasmus
> 
> [1] 
> https://stackoverflow.com/questions/47715918/how-to-pass-the-curl-insecure-alternative-when-using-r

**
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread Bert Gunter
?grid.frame, etc. should be straightforward for this I would think.
But of course you have to resort to the underlying grid framework rather
than the ggplot2 interface.

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, Jul 24, 2020 at 12:11 PM H  wrote:

> On 07/24/2020 02:50 PM, H wrote:
> > On 07/24/2020 02:03 PM, Jeff Newmiller wrote:
> >> The set of people interested in helping when you supply a minimal
> reproducible example is rather larger than the set of people willing to
> read the documentation for you (hint) and guess what aspect of alignment
> you are having trouble with.
> >>
> >> On July 24, 2020 10:46:57 AM PDT, H  wrote:
> >>> On 07/24/2020 01:14 PM, John Kane wrote:
>  Well, I am not looking for help debugging my code but for
> >>> information to better understand arranging plots vertically. The code
> >>> above aligns them horizontally as expected.
>  Sigh, we know the code works but we do not know what the plots are
> >>> and we cannot play around with them to see if we can help you if we
> >>> have nothing to work with.
>  On Fri, 24 Jul 2020 at 12:12, H  >>> > wrote:
>  On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
>  > Hav a look at the packages cowplot and patchwork
>  >
>  >> On 24.07.2020, at 02:36, H  >>> > wrote:
>  >>
>  >> I am trying to arrange two plots vertically, ie plot 2 below
> >>> plot 1, where I want the plots to align columnwise but have a height
> >>> ratio of eg 3:1.
>  >>
>  >> My attempts so far after consulting various webpages is that
> >>> the following code aligns them columnwise correctly but I have, so far,
> >>> failed in setting the relative heights...
>  >>
>  >> g2<-ggplotGrob(s)
>  >> g3<-ggplotGrob(v)
>  >> g<-rbind(g2, g3, size = "first")
>  >> g$widths<-unit.pmax(g2$widths, g3$widths)
>  >>
>  >> what would the appropriate statement for the relative heights
> >>> to add here be?
>  >>
>  >> grid.newpage()
>  >> grid.draw(g)
>  >>
>  >> Thank you!
>  >>
>  >> __
>  >> 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.
>  So this is not possible without using one of those two packages?
> >>> I got the impression I should be able to use grid.arrange to do so but
> >>> was not able to get it to work without disturbing the width alignment
> >>> above...
>  __
>  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.
>  --
>  John Kane
>  Kingston ON Canada
> >>> No need to play around with anything. I am simply looking for
> >>> assistance on how to use eg arrangeGrob to not only align two plots
> >>> columnwise but also adjust their heights relative to each other rather
> >>> than 1:1.
> >>>
> >>> Can arrangeGrob() be used for that?
> >>>
> >>>
> >>> [[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.
> >
> > Look at
> https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html
> where there are two mpg charts, one above the other. What would I need to
> add to:
> >
> > |library(gtable) g2 <-ggplotGrob(p2) g3 <-ggplotGrob(p3) g <-rbind(g2,
> g3, size = "first") g$widths <-unit.pmax(g2$widths, g3$widths)
> grid.newpage() grid.draw(g) |
> >
> > |to make the second chart 1/2 the size of the top one?|
> >
> > ||
> >
> The following code aligns the two plot areas of the two charts perfectly
> but they are the same height whereas I want to make the bottom one 1/2 as
> tall as the top one:
>
> g2<-ggplotGrob(s)
> g3<-ggplotGrob(v)
> g<-rbind(g2, g3, size = "first")
> g$widths<-unit.pmax(g2$widths, g3$widths)
> grid.newpage()
> grid.draw(g)
>
>
> [[alternative HTML version deleted]]
>
> __
> 

Re: [R] A Question about MLE in R

2020-07-24 Thread Andrew Robinson
Hi Ravi,

that's an interesting claim and N-M.  Can you provide any reading matter to 
support it?

Cheers,

Andrew

--
Andrew Robinson
Director, CEBRA and Professor of Biosecurity,
School/s of BioSciences and Mathematics & Statistics
University of Melbourne, VIC 3010 Australia
Tel: (+61) 0403 138 955
Email: a...@unimelb.edu.au
Website: https://researchers.ms.unimelb.edu.au/~apro@unimelb/

I acknowledge the Traditional Owners of the land I inhabit, and pay my respects 
to their Elders.
On Jul 24, 2020, 10:54 PM +1000, Ravi Varadhan , wrote:
I agree with John that SANN should be removed from optim.


More importantly, the default choice of optimizer in optim should be changed 
from "Nelder-Mead" to "BFGS." Nelder-Mead is a bad choice for the most commonly 
encountered optimization problems in statistics. I really do not see a good 
reason for not changing the default in optim.


Best regards,

Ravi

[[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 Question about MLE in R

2020-07-24 Thread Andrew Robinson
Hi John,

I wonder if you can suggest some reading material on that topic?  A cursory 
search of the net doesn't uncover anything obvious.

Andrew

--
Andrew Robinson
Director, CEBRA and Professor of Biosecurity,
School/s of BioSciences and Mathematics & Statistics
University of Melbourne, VIC 3010 Australia
Tel: (+61) 0403 138 955
Email: a...@unimelb.edu.au
Website: https://researchers.ms.unimelb.edu.au/~apro@unimelb/

I acknowledge the Traditional Owners of the land I inhabit, and pay my respects 
to their Elders.
On Jul 22, 2020, 10:49 PM +1000, J C Nash , wrote:
SANN is almost NEVER the tool to use.

I've given up trying to get it removed from optim(), and will soon give up
on telling folk not to use it.

JN

On 2020-07-22 3:06 a.m., Zixuan Qi wrote:
Hi,

I encounter a problem. I use optim() function in R to estimate likelihood
function and the method is SANN in the optim function.
out <-
optim(parm,logLik,method='SANN',hessian=T,control=list(maxit=500))

However, I find that each time I run the program, I will get different
values of parameters. My initial values are same, but the number of
iterations has reached the maximum limit. I expanded the number of
iterations to 5 million, but it��s still wrong.

I want to know what I should do. Is anyone willing to help me? Thanks so
much!

Best,
Cisy

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


[[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread H
On 07/24/2020 02:50 PM, H wrote:
> On 07/24/2020 02:03 PM, Jeff Newmiller wrote:
>> The set of people interested in helping when you supply a minimal 
>> reproducible example is rather larger than the set of people willing to read 
>> the documentation for you (hint) and guess what aspect of alignment you are 
>> having trouble with.
>>
>> On July 24, 2020 10:46:57 AM PDT, H  wrote:
>>> On 07/24/2020 01:14 PM, John Kane wrote:
 Well, I am not looking for help debugging my code but for
>>> information to better understand arranging plots vertically. The code
>>> above aligns them horizontally as expected.
 Sigh, we know the code works but we do not know what the plots are  
>>> and we cannot play around with them to see if we can help you if we
>>> have nothing to work with.
 On Fri, 24 Jul 2020 at 12:12, H >> > wrote:
 On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
 > Hav a look at the packages cowplot and patchwork
 >
 >> On 24.07.2020, at 02:36, H >> > wrote:
 >>
 >> I am trying to arrange two plots vertically, ie plot 2 below
>>> plot 1, where I want the plots to align columnwise but have a height
>>> ratio of eg 3:1.
 >>
 >> My attempts so far after consulting various webpages is that
>>> the following code aligns them columnwise correctly but I have, so far,
>>> failed in setting the relative heights...
 >>
 >> g2<-ggplotGrob(s)
 >> g3<-ggplotGrob(v)
 >> g<-rbind(g2, g3, size = "first")
 >> g$widths<-unit.pmax(g2$widths, g3$widths)
 >>
 >> what would the appropriate statement for the relative heights
>>> to add here be?
 >>
 >> grid.newpage()
 >> grid.draw(g)
 >>
 >> Thank you!
 >>
 >> __
 >> 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.
 So this is not possible without using one of those two packages?
>>> I got the impression I should be able to use grid.arrange to do so but
>>> was not able to get it to work without disturbing the width alignment
>>> above...
 __
 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.
 -- 
 John Kane
 Kingston ON Canada
>>> No need to play around with anything. I am simply looking for
>>> assistance on how to use eg arrangeGrob to not only align two plots
>>> columnwise but also adjust their heights relative to each other rather
>>> than 1:1.
>>>
>>> Can arrangeGrob() be used for that?
>>>
>>>
>>> [[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.
>
> Look at https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html 
> where there are two mpg charts, one above the other. What would I need to add 
> to:
>
> |library(gtable) g2 <-ggplotGrob(p2) g3 <-ggplotGrob(p3) g <-rbind(g2, g3, 
> size = "first") g$widths <-unit.pmax(g2$widths, g3$widths) grid.newpage() 
> grid.draw(g) |
>
> |to make the second chart 1/2 the size of the top one?|
>
> ||
>
The following code aligns the two plot areas of the two charts perfectly but 
they are the same height whereas I want to make the bottom one 1/2 as tall as 
the top one:

g2<-ggplotGrob(s)
g3<-ggplotGrob(v)
g<-rbind(g2, g3, size = "first")
g$widths<-unit.pmax(g2$widths, g3$widths)
grid.newpage()
grid.draw(g)


[[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread Felipe Carrillo via R-help
What about cowplot?
https://cran.r-project.org/web/packages/cowplot/vignettes/introduction.html

On Friday, July 24, 2020, 11:51:17 AM PDT, H  wrote: 
 
 
 On 07/24/2020 02:03 PM, Jeff Newmiller wrote:
> The set of people interested in helping when you supply a minimal 
> reproducible example is rather larger than the set of people willing to read 
> the documentation for you (hint) and guess what aspect of alignment you are 
> having trouble with.
>
> On July 24, 2020 10:46:57 AM PDT, H  wrote:
>> On 07/24/2020 01:14 PM, John Kane wrote:
>>> Well, I am not looking for help debugging my code but for
>> information to better understand arranging plots vertically. The code
>> above aligns them horizontally as expected.
>>> Sigh, we know the code works but we do not know what the plots are  
>> and we cannot play around with them to see if we can help you if we
>> have nothing to work with.
>>> On Fri, 24 Jul 2020 at 12:12, H > > wrote:
>>>    On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
>>>    > Hav a look at the packages cowplot and patchwork
>>>    >
>>>    >> On 24.07.2020, at 02:36, H > > wrote:
>>>    >>
>>>    >> I am trying to arrange two plots vertically, ie plot 2 below
>> plot 1, where I want the plots to align columnwise but have a height
>> ratio of eg 3:1.
>>>    >>
>>>    >> My attempts so far after consulting various webpages is that
>> the following code aligns them columnwise correctly but I have, so far,
>> failed in setting the relative heights...
>>>    >>
>>>    >> g2<-ggplotGrob(s)
>>>    >> g3<-ggplotGrob(v)
>>>    >> g<-rbind(g2, g3, size = "first")
>>>    >> g$widths<-unit.pmax(g2$widths, g3$widths)
>>>    >>
>>>    >> what would the appropriate statement for the relative heights
>> to add here be?
>>>    >>
>>>    >> grid.newpage()
>>>    >> grid.draw(g)
>>>    >>
>>>    >> Thank you!
>>>    >>
>>>    >> __
>>>    >> 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.
>>>    So this is not possible without using one of those two packages?
>> I got the impression I should be able to use grid.arrange to do so but
>> was not able to get it to work without disturbing the width alignment
>> above...
>>>    __
>>>    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.
>>>
>>>
>>> -- 
>>> John Kane
>>> Kingston ON Canada
>> No need to play around with anything. I am simply looking for
>> assistance on how to use eg arrangeGrob to not only align two plots
>> columnwise but also adjust their heights relative to each other rather
>> than 1:1.
>>
>> Can arrangeGrob() be used for that?
>>
>>
>>     [[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.

Look at https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html 
where there are two mpg charts, one above the other. What would I need to add 
to:

|library(gtable) g2 <-ggplotGrob(p2) g3 <-ggplotGrob(p3) g <-rbind(g2, g3, size 
= "first") g$widths <-unit.pmax(g2$widths, g3$widths) grid.newpage() 
grid.draw(g) |

|to make the second chart 1/2 the size of the top one?|

||


    [[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread H
On 07/24/2020 02:03 PM, Jeff Newmiller wrote:
> The set of people interested in helping when you supply a minimal 
> reproducible example is rather larger than the set of people willing to read 
> the documentation for you (hint) and guess what aspect of alignment you are 
> having trouble with.
>
> On July 24, 2020 10:46:57 AM PDT, H  wrote:
>> On 07/24/2020 01:14 PM, John Kane wrote:
>>> Well, I am not looking for help debugging my code but for
>> information to better understand arranging plots vertically. The code
>> above aligns them horizontally as expected.
>>> Sigh, we know the code works but we do not know what the plots are  
>> and we cannot play around with them to see if we can help you if we
>> have nothing to work with.
>>> On Fri, 24 Jul 2020 at 12:12, H > > wrote:
>>> On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
>>> > Hav a look at the packages cowplot and patchwork
>>> >
>>> >> On 24.07.2020, at 02:36, H > > wrote:
>>> >>
>>> >> I am trying to arrange two plots vertically, ie plot 2 below
>> plot 1, where I want the plots to align columnwise but have a height
>> ratio of eg 3:1.
>>> >>
>>> >> My attempts so far after consulting various webpages is that
>> the following code aligns them columnwise correctly but I have, so far,
>> failed in setting the relative heights...
>>> >>
>>> >> g2<-ggplotGrob(s)
>>> >> g3<-ggplotGrob(v)
>>> >> g<-rbind(g2, g3, size = "first")
>>> >> g$widths<-unit.pmax(g2$widths, g3$widths)
>>> >>
>>> >> what would the appropriate statement for the relative heights
>> to add here be?
>>> >>
>>> >> grid.newpage()
>>> >> grid.draw(g)
>>> >>
>>> >> Thank you!
>>> >>
>>> >> __
>>> >> 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.
>>> So this is not possible without using one of those two packages?
>> I got the impression I should be able to use grid.arrange to do so but
>> was not able to get it to work without disturbing the width alignment
>> above...
>>> __
>>> 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.
>>>
>>>
>>> -- 
>>> John Kane
>>> Kingston ON Canada
>> No need to play around with anything. I am simply looking for
>> assistance on how to use eg arrangeGrob to not only align two plots
>> columnwise but also adjust their heights relative to each other rather
>> than 1:1.
>>
>> Can arrangeGrob() be used for that?
>>
>>
>>  [[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.

Look at https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html 
where there are two mpg charts, one above the other. What would I need to add 
to:

|library(gtable) g2 <-ggplotGrob(p2) g3 <-ggplotGrob(p3) g <-rbind(g2, g3, size 
= "first") g$widths <-unit.pmax(g2$widths, g3$widths) grid.newpage() 
grid.draw(g) |

|to make the second chart 1/2 the size of the top one?|

||


[[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread Jeff Newmiller
The set of people interested in helping when you supply a minimal reproducible 
example is rather larger than the set of people willing to read the 
documentation for you (hint) and guess what aspect of alignment you are having 
trouble with.

On July 24, 2020 10:46:57 AM PDT, H  wrote:
>On 07/24/2020 01:14 PM, John Kane wrote:
>> Well, I am not looking for help debugging my code but for
>information to better understand arranging plots vertically. The code
>above aligns them horizontally as expected.
>>
>> Sigh, we know the code works but we do not know what the plots are  
>and we cannot play around with them to see if we can help you if we
>have nothing to work with.
>>
>> On Fri, 24 Jul 2020 at 12:12, H > wrote:
>>
>> On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
>> > Hav a look at the packages cowplot and patchwork
>> >
>> >> On 24.07.2020, at 02:36, H > wrote:
>> >>
>> >> I am trying to arrange two plots vertically, ie plot 2 below
>plot 1, where I want the plots to align columnwise but have a height
>ratio of eg 3:1.
>> >>
>> >> My attempts so far after consulting various webpages is that
>the following code aligns them columnwise correctly but I have, so far,
>failed in setting the relative heights...
>> >>
>> >> g2<-ggplotGrob(s)
>> >> g3<-ggplotGrob(v)
>> >> g<-rbind(g2, g3, size = "first")
>> >> g$widths<-unit.pmax(g2$widths, g3$widths)
>> >>
>> >> what would the appropriate statement for the relative heights
>to add here be?
>> >>
>> >> grid.newpage()
>> >> grid.draw(g)
>> >>
>> >> Thank you!
>> >>
>> >> __
>> >> 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.
>>
>> So this is not possible without using one of those two packages?
>I got the impression I should be able to use grid.arrange to do so but
>was not able to get it to work without disturbing the width alignment
>above...
>>
>> __
>> 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.
>>
>>
>>
>> -- 
>> John Kane
>> Kingston ON Canada
>
>No need to play around with anything. I am simply looking for
>assistance on how to use eg arrangeGrob to not only align two plots
>columnwise but also adjust their heights relative to each other rather
>than 1:1.
>
>Can arrangeGrob() be used for that?
>
>
>   [[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.

-- 
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: [R] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread H
On 07/24/2020 01:14 PM, John Kane wrote:
> Well, I am not looking for help debugging my code but for information to 
> better understand arranging plots vertically. The code above aligns them 
> horizontally as expected.
>
> Sigh, we know the code works but we do not know what the plots are   and we 
> cannot play around with them to see if we can help you if we have nothing to 
> work with.
>
> On Fri, 24 Jul 2020 at 12:12, H  > wrote:
>
> On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
> > Hav a look at the packages cowplot and patchwork
> >
> >> On 24.07.2020, at 02:36, H  > wrote:
> >>
> >> I am trying to arrange two plots vertically, ie plot 2 below plot 1, 
> where I want the plots to align columnwise but have a height ratio of eg 3:1.
> >>
> >> My attempts so far after consulting various webpages is that the 
> following code aligns them columnwise correctly but I have, so far, failed in 
> setting the relative heights...
> >>
> >> g2<-ggplotGrob(s)
> >> g3<-ggplotGrob(v)
> >> g<-rbind(g2, g3, size = "first")
> >> g$widths<-unit.pmax(g2$widths, g3$widths)
> >>
> >> what would the appropriate statement for the relative heights to add 
> here be?
> >>
> >> grid.newpage()
> >> grid.draw(g)
> >>
> >> Thank you!
> >>
> >> __
> >> 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.
>
> So this is not possible without using one of those two packages? I got 
> the impression I should be able to use grid.arrange to do so but was not able 
> to get it to work without disturbing the width alignment above...
>
> __
> 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.
>
>
>
> -- 
> John Kane
> Kingston ON Canada

No need to play around with anything. I am simply looking for assistance on how 
to use eg arrangeGrob to not only align two plots columnwise but also adjust 
their heights relative to each other rather than 1:1.

Can arrangeGrob() be used for that?


[[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread John Kane
Well, I am not looking for help debugging my code but for information to
better understand arranging plots vertically. The code above aligns them
horizontally as expected.

Sigh, we know the code works but we do not know what the plots are   and we
cannot play around with them to see if we can help you if we have nothing
to work with.

On Fri, 24 Jul 2020 at 12:12, H  wrote:

> On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
> > Hav a look at the packages cowplot and patchwork
> >
> >> On 24.07.2020, at 02:36, H  wrote:
> >>
> >> I am trying to arrange two plots vertically, ie plot 2 below plot 1,
> where I want the plots to align columnwise but have a height ratio of eg
> 3:1.
> >>
> >> My attempts so far after consulting various webpages is that the
> following code aligns them columnwise correctly but I have, so far, failed
> in setting the relative heights...
> >>
> >> g2<-ggplotGrob(s)
> >> g3<-ggplotGrob(v)
> >> g<-rbind(g2, g3, size = "first")
> >> g$widths<-unit.pmax(g2$widths, g3$widths)
> >>
> >> what would the appropriate statement for the relative heights to add
> here be?
> >>
> >> grid.newpage()
> >> grid.draw(g)
> >>
> >> Thank you!
> >>
> >> __
> >> 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.
>
> So this is not possible without using one of those two packages? I got the
> impression I should be able to use grid.arrange to do so but was not able
> to get it to work without disturbing the width alignment above...
>
> __
> 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.
>


-- 
John Kane
Kingston ON Canada

[[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread H
On 07/24/2020 05:29 AM, Erich Subscriptions wrote:
> Hav a look at the packages cowplot and patchwork
>
>> On 24.07.2020, at 02:36, H  wrote:
>>
>> I am trying to arrange two plots vertically, ie plot 2 below plot 1, where I 
>> want the plots to align columnwise but have a height ratio of eg 3:1.
>>
>> My attempts so far after consulting various webpages is that the following 
>> code aligns them columnwise correctly but I have, so far, failed in setting 
>> the relative heights...
>>
>> g2<-ggplotGrob(s)
>> g3<-ggplotGrob(v)
>> g<-rbind(g2, g3, size = "first")
>> g$widths<-unit.pmax(g2$widths, g3$widths)
>>
>> what would the appropriate statement for the relative heights to add here be?
>>
>> grid.newpage()
>> grid.draw(g)
>>
>> Thank you!
>>
>> __
>> 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.

So this is not possible without using one of those two packages? I got the 
impression I should be able to use grid.arrange to do so but was not able to 
get it to work without disturbing the width alignment above...

__
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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread H
On 07/24/2020 10:16 AM, John Kane wrote:
> We reallly need to see more code (a minimum working example and some data.
>
> For some suggestions on how to do this see
>
>  http://adv-r.had.co.nz/Reproducibility.html
>
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>
> On Fri, 24 Jul 2020 at 01:16, H  > wrote:
>
> I am trying to arrange two plots vertically, ie plot 2 below plot 1, 
> where I want the plots to align columnwise but have a height ratio of eg 3:1.
>
> My attempts so far after consulting various webpages is that the 
> following code aligns them columnwise correctly but I have, so far, failed in 
> setting the relative heights...
>
> g2<-ggplotGrob(s)
> g3<-ggplotGrob(v)
> g<-rbind(g2, g3, size = "first")
> g$widths<-unit.pmax(g2$widths, g3$widths)
>
> what would the appropriate statement for the relative heights to add here 
> be?
>
> grid.newpage()
> grid.draw(g)
>
> Thank you!
>
> __
> 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.
>
>
>
> -- 
> John Kane
> Kingston ON Canada

Well, I am not looking for help debugging my code but for information to better 
understand arranging plots vertically. The code above aligns them horizontally 
as expected.


[[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] [External] Re: help with web scraping

2020-07-24 Thread Spencer Graves
Dear Rasmus:


On 2020-07-24 09:16, Rasmus Liland wrote:
> On 2020-07-24 08:20 -0500, luke-tier...@uiowa.edu wrote:
>> On Fri, 24 Jul 2020, Spencer Graves wrote:
>>> On 2020-07-23 17:46, William Michels wrote:
 On Thu, Jul 23, 2020 at 2:55 PM Spencer Graves
  wrote:
> Hello, All:
>
> I've failed with multiple
> attempts to scrape the table of
> candidates from the website of
> the Missouri Secretary of
> State:
>
> https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975
 Hi Spencer,

 I tried the code below on an older
 R-installation, and it works fine.
 Not a full solution, but it's a
 start:

> library(RCurl)
 Loading required package: bitops
> url <- 
> "https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
> M_sos <- getURL(url)
>>> Hi Bill et al.:
>>>
>>> That broke the dam:� It gave me a
>>> character vector of length 1
>>> consisting of 218 KB.� I fed that to
>>> XML::readHTMLTable and
>>> purrr::map_chr, both of which
>>> returned lists of 337 data.frames.
>>> The former retained names for all
>>> the tables, absent from the latter.
>>> The columns of the former are all
>>> character;� that's not true for the
>>> latter.
>>>
>>> Sadly, it's not quite what I want:
>>> It's one table for each office-party
>>> combination, but it's lost the
>>> office designation. However, I'm
>>> confident I can figure out how to
>>> hack that.
>> Maybe try something like this:
>>
>> url <- 
>> "https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
>> h <- xml2::read_html(url)
>> tbl <- rvest::html_table(h)
> Dear Spencer,
>
> I unified the party tables after the
> first summary table like this:
>
>   url <- 
> "https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
>   M_sos <- RCurl::getURL(url)
>   saveRDS(object=M_sos, file="dcp.rds")
>   dat <- XML::readHTMLTable(M_sos)
>   idx <- 2:length(dat)
>   cn <- unique(unlist(lapply(dat[idx], colnames)))


 � This is useful for this application.

>   dat <- do.call(rbind,
> sapply(idx, function(i, dat, cn) {
>   x <- dat[[i]]
>   x[,cn[!(cn %in% colnames(x))]] <- NA
>   x <- x[,cn]
>   x$Party <- names(dat)[i]
>   return(list(x))
> }, dat=dat, cn=cn))
>   dat[,"Date Filed"] <-
> as.Date(x=dat[,"Date Filed"],
> format="%m/%d/%Y")


 � This misses something extremely important for this application:� 
The political office.� That's buried in the HTML or whatever it is.� I'm 
using something like the following to find that:


str(LtGov <- gregexpr('Lieutenant Governor', M_sos)[[1]])


 � After I figure this out, I will use something like your code to 
combine it all into separate tables for each office, and then probably 
combine those into one table for the offices I'm interested in.� For my 
present purposes, I don't want all the offices in Missouri, only the 
executive positions and those representing parts of the Kansas City 
metro area in the Missouri legislature.


 � Thanks again,
 � Spencer Graves

>   write.table(dat, file="dcp.tsv", sep="\t",
>   row.names=FALSE,
>   quote=TRUE, na="N/A")
>
> Best,
> Rasmus
>
> __
> 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] Windows, R version 4.0.2, read.csv() - -Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'hw1_data': No such file or

2020-07-24 Thread Jeff Newmiller
Per the Posting Guide, homework help is off-topic on this mailing list, since 
educational institutions are supposed to have support tailored to your 
educational pragram.

Regardless of policy, it is very difficult to address very basic questions such 
as yours via written communication only... for your sake you should find 
interactive support through screen sharing or at least audio channels from 
someone already familiar with your assignment.

On July 23, 2020 4:34:26 PM PDT, Mounica Miriyala 
 wrote:
>HI,
>I am currently taking my week 1 quiz 1. The quiz has  1 to 20 questions
>in
>which 11 to 20 should be dealt with dataset given by the coursera. But
>I am
>not able to open due to the mentioned error above. When I give dir() it
>shows the exact file that has the dataset to be used in the quiz1 but
>when
>i try to read the file in R it throwing the error -"*Error in
>file(file, "rt") : cannot open the connection*
>
>
>*In addition: Warning message:In file(file, "rt") :  cannot open file
>'hw1_data': No such file or directory*
>"
>Please help! I tried the google for the error and tried different ways
>but
>still gets the same error message. I hope is will get this done in the
>second attempt for my quiz1.
>
>Regards,
>
>Mounica Miriyala.
>
>   [[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.

-- 
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: [R] mice package won't install

2020-07-24 Thread J C Nash
Apologies in advance if this is a red herring, but I've had a number of issues
with installing latest (4.0.2) version of R and related packages. Maybe my
experience will be helpful to you.

Note that you don't give your OS etc., which also my mean my suggestions are
moot.

I run Linux, mostly Mint. Recently I upgraded to LM 20. And then upgraded
R from 3.5.x to 4.0.x. When updating packages, I found lots of errors where
a dependency was stated to be pre-version 4 and to reinstall. But even
after a re-install, I got the same message. This occurred on 3 machines in
slightly different manifestations, likely because the machines are different
ages and there may be more or less "old" material lurking in folders that
should have been removed a long time ago. My suspicion is that the wrong
libraries were being accessed.

My solution was to
- remove --purge r-base-dev r-recommended
- delete directories /usr/lib/R, /usr/local/lib/R and ~/R
- reinstall (noting that the software sources needed to point to debian focal 
and cran40).
- install packages I needed

This may be a bit drastic, but R and Linux make the task relatively 
undemanding. It also
gives a cleaned up R ecosystem, as the ongoing addition of bits and pieces 
makes for
quite a load of packages, some of which are almost certain to be unused but may 
cause
trouble.

Good luck,

John Nash

On 2020-07-23 12:44 p.m., David Krackhardt wrote:
> When I try to install the "mice" package, it tells me I can't without a
> current version of Rtools.  When I try to install Rtools, it tells me the
> current version is actually Rtools40.  When I try to install Rtools40, it
> tells me that Rtools40 is not available for R version 3.6.3, which is the
> newest version of R (and the one I have).
> 
> All I want is the "mice" library.  What do I do?
> 
> -David
>  
> 
> David Krackhardt, Professor of Organizations
> Heinz College of Public Policy and Management, and
>  The Tepper School of Business
> 2215 Hamburg Hall
> Carnegie Mellon University
> Pittsburgh, PA 15213
> website: www.andrew.cmu.edu/~krack
>  (Erdos#=2)
> 
> 
> 
>   [[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] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread John Kane
We reallly need to see more code (a minimum working example and some data.

For some suggestions on how to do this see

 http://adv-r.had.co.nz/Reproducibility.html

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

On Fri, 24 Jul 2020 at 01:16, H  wrote:

> I am trying to arrange two plots vertically, ie plot 2 below plot 1, where
> I want the plots to align columnwise but have a height ratio of eg 3:1.
>
> My attempts so far after consulting various webpages is that the following
> code aligns them columnwise correctly but I have, so far, failed in setting
> the relative heights...
>
> g2<-ggplotGrob(s)
> g3<-ggplotGrob(v)
> g<-rbind(g2, g3, size = "first")
> g$widths<-unit.pmax(g2$widths, g3$widths)
>
> what would the appropriate statement for the relative heights to add here
> be?
>
> grid.newpage()
> grid.draw(g)
>
> Thank you!
>
> __
> 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.
>


-- 
John Kane
Kingston ON Canada

[[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] [External] Re: help with web scraping

2020-07-24 Thread Rasmus Liland
On 2020-07-24 08:20 -0500, luke-tier...@uiowa.edu wrote:
> On Fri, 24 Jul 2020, Spencer Graves wrote:
> > On 2020-07-23 17:46, William Michels wrote:
> > > On Thu, Jul 23, 2020 at 2:55 PM Spencer Graves
> > >  wrote:
> > > > Hello, All:
> > > > 
> > > > I've failed with multiple 
> > > > attempts to scrape the table of 
> > > > candidates from the website of 
> > > > the Missouri Secretary of 
> > > > State:
> > > > 
> > > > https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975
> > > 
> > > Hi Spencer,
> > > 
> > > I tried the code below on an older 
> > > R-installation, and it works fine.  
> > > Not a full solution, but it's a 
> > > start:
> > > 
> > > > library(RCurl)
> > > Loading required package: bitops
> > > > url <- 
> > > > "https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
> > > > M_sos <- getURL(url)
> > 
> > Hi Bill et al.:
> > 
> > That broke the dam:  It gave me a 
> > character vector of length 1 
> > consisting of 218 KB.  I fed that to 
> > XML::readHTMLTable and 
> > purrr::map_chr, both of which 
> > returned lists of 337 data.frames. 
> > The former retained names for all 
> > the tables, absent from the latter.  
> > The columns of the former are all 
> > character;  that's not true for the 
> > latter.
> > 
> > Sadly, it's not quite what I want:  
> > It's one table for each office-party 
> > combination, but it's lost the 
> > office designation. However, I'm 
> > confident I can figure out how to 
> > hack that.
> 
> Maybe try something like this:
> 
> url <- 
> "https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
> h <- xml2::read_html(url)
> tbl <- rvest::html_table(h)

Dear Spencer,

I unified the party tables after the 
first summary table like this:

url <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
M_sos <- RCurl::getURL(url)
saveRDS(object=M_sos, file="dcp.rds")
dat <- XML::readHTMLTable(M_sos)
idx <- 2:length(dat)
cn <- unique(unlist(lapply(dat[idx], colnames)))
dat <- do.call(rbind,
  sapply(idx, function(i, dat, cn) {
x <- dat[[i]]
x[,cn[!(cn %in% colnames(x))]] <- NA
x <- x[,cn]
x$Party <- names(dat)[i]
return(list(x))
  }, dat=dat, cn=cn))
dat[,"Date Filed"] <-
  as.Date(x=dat[,"Date Filed"],
  format="%m/%d/%Y")
write.table(dat, file="dcp.tsv", sep="\t",
row.names=FALSE,
quote=TRUE, na="N/A") 

Best,
Rasmus


signature.asc
Description: PGP signature
__
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] [External] Re: help with web scraping

2020-07-24 Thread Spencer Graves




On 2020-07-24 08:20, luke-tier...@uiowa.edu wrote:

Maybe try something like this:

url <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;

h <- xml2::read_html(url)



Error in open.connection(x, "rb") : HTTP error 404.


  Thanks for the suggestion, but this failed for me on the platform 
described in "sessionInfo" below.




tbl <- rvest::html_table(h)



  As I previously noted, RCurl::getURL returned a single character 
string of roughly 218 KB, from which I've so far gotten most but not all 
of what I want.  Unfortunately, when I fed that character vector to 
rvest::html_table, I got:



Error in UseMethod("html_table") :
  no applicable method for 'html_table' applied to an object of class 
"character"



  I don't know for sure yet, but I believe I'll be able to get what 
I want from the single character string using, e.g., gregexpr and other 
functions.



  Thanks again,
  Spencer Graves



Best,

luke

On Fri, 24 Jul 2020, Spencer Graves wrote:


Hi Bill et al.:


  That broke the dam:  It gave me a character vector of length 1 
consisting of 218 KB.  I fed that to XML::readHTMLTable and 
purrr::map_chr, both of which returned lists of 337 data.frames. The 
former retained names for all the tables, absent from the latter.  
The columns of the former are all character;  that's not true for the 
latter.



  Sadly, it's not quite what I want:  It's one table for each 
office-party combination, but it's lost the office designation. 
However, I'm confident I can figure out how to hack that.



  Thanks,
  Spencer Graves


On 2020-07-23 17:46, William Michels wrote:

Hi Spencer,

I tried the code below on an older R-installation, and it works fine.
Not a full solution, but it's a start:


library(RCurl)

Loading required package: bitops
url <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;

M_sos <- getURL(url)
print(M_sos)

[1] "\r\n\r\n\r\n\r\n\r\n\tSOS, Missouri - Elections:
Offices Filed in Candidate Filing\r\n wrote:

Hello, All:


    I've failed with multiple attempts to scrape the table of
candidates from the website of the Missouri Secretary of State:


https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975 




    I've tried base::url, base::readLines, xml2::read_html, and
XML::readHTMLTable; see summary below.


    Suggestions?
    Thanks,
    Spencer Graves


sosURL <-
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975; 



str(baseURL <- base::url(sosURL))
# this might give me something, but I don't know what

sosRead <- base::readLines(sosURL) # 404 Not Found
sosRb <- base::readLines(baseURL) # 404 Not Found

sosXml2 <- xml2::read_html(sosURL) # HTTP error 404.

sosXML <- XML::readHTMLTable(sosURL)
# List of 0;  does not seem to be XML

sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 


LAPACK:
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib 



locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets
[6] methods   base

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2    curl_4.3
[4] xml2_1.3.2 XML_3.99-0.3

__
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] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-24 Thread Ritwik Mohapatra
Hi All,

These are the two codes i have used so far:-
ggplot(df3_machine_region,aes(Region,Machine.Name)) +
  geom_count()
!![2nd Plot|690x375](upload://gTyYUXe6lPJXCdyvqRBtUZ8zsyL.png) [1st
Plot|690x375](upload://bb0ux9WheqM4ViyYf3Gki6TKtlG.png)
ggplot(df3_machine_region,aes(Region,Machine.Name)) +
  geom_jitter(aes(colour=Region))

I have to present the plot to my stakeholders,so thats why its required in
a readable and legible way.

There would be approximately 10k+ values(max) for machine and region
combination.

I have attached the output plots for your reference.Please find below a
snapshot of data for your reference.

|Machine.Name|Region|
|0460-EPBS1.sga-res.com|Europe|
|04821-EABS1.sga-res.com|Europe|
|10429-EDABS1.sga-res.com|Europe|
|1042619-ESWEBS1.sga-res.com|Europe|
|ABE-L-98769.europe.shell.com|Americas|
|AB-L-98769.europe.shell.com|APAC|
|AB-L-98769.europe.shell.com|Europe|
|ABE-L-98769.europe.shell.com (2)|Americas|
|ABE-L-98769.europe.shell.com (2)|Europe|
|ABE-L-98840.europe.shell.com|Americas|
|AB-L-98840.europe.shell.com|APAC|
|ABE-L-98840.europe.shell.com|Europe|
|AB-L-98854.europe.shell.com|Americas|
|ABE-L-98854.europe.shell.com|Europe|
|ABE-L-98862.europe.shell.com|Americas|

Regards,
Ritwik

On Fri, Jul 24, 2020 at 6:05 PM Martin Maechler 
wrote:

> > Ritwik Mohapatra
> > on Thu, 23 Jul 2020 23:41:57 +0530 writes:
>
> > How to create a readable and legible plot in R with 10k+ values.I
> have a
> > dataframe with 17298 records.There are two columns:Machine
> Name(Character)
> > and Region(Character).So i want to create a readable plot with
> region in x
> > axis and machine name in y axis.How do i do that using ggplot or any
> other
> > way.Please help.
>
> Good answers to this question will depend very much on how many
> 'Machine' and 'Region' levels there are.
>
> (and this is a case where in my opinion it'd be *MUCH* more
>  useful to have 'factor' instead of 'character'.. if only just
>  so
>  str()
> or   summary()
>
> would give useful/relevant information.
>
> --
> One possibility for a somewhat cute plot is a  "good ole"
> sunflower plot (base graphics, but the idea must be easily
> transferable to grid-based graphics such as ggplot2):
>
>   help(sunflowerplot)
>
>
> Martin Maechler
> ETH Zurich
>
__
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] [External] Re: help with web scraping

2020-07-24 Thread luke-tierney

Maybe try something like this:

url <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
h <- xml2::read_html(url)
tbl <- rvest::html_table(h)

Best,

luke

On Fri, 24 Jul 2020, Spencer Graves wrote:


Hi Bill et al.:


  That broke the dam:  It gave me a character vector of length 1 
consisting of 218 KB.  I fed that to XML::readHTMLTable and purrr::map_chr, 
both of which returned lists of 337 data.frames. The former retained names 
for all the tables, absent from the latter.  The columns of the former are 
all character;  that's not true for the latter.



  Sadly, it's not quite what I want:  It's one table for each 
office-party combination, but it's lost the office designation. However, I'm 
confident I can figure out how to hack that.



  Thanks,
  Spencer Graves


On 2020-07-23 17:46, William Michels wrote:

Hi Spencer,

I tried the code below on an older R-installation, and it works fine.
Not a full solution, but it's a start:


library(RCurl)

Loading required package: bitops
url <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;

M_sos <- getURL(url)
print(M_sos)

[1] "\r\n\r\n\r\n\r\n\r\n\tSOS, Missouri - Elections:
Offices Filed in Candidate Filing\r\n wrote:

Hello, All:


I've failed with multiple attempts to scrape the table of
candidates from the website of the Missouri Secretary of State:


https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975


I've tried base::url, base::readLines, xml2::read_html, and
XML::readHTMLTable; see summary below.


Suggestions?
Thanks,
Spencer Graves


sosURL <-
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;

str(baseURL <- base::url(sosURL))
# this might give me something, but I don't know what

sosRead <- base::readLines(sosURL) # 404 Not Found
sosRb <- base::readLines(baseURL) # 404 Not Found

sosXml2 <- xml2::read_html(sosURL) # HTTP error 404.

sosXML <- XML::readHTMLTable(sosURL)
# List of 0;  does not seem to be XML

sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK:
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets
[6] methods   base

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2curl_4.3
[4] xml2_1.3.2 XML_3.99-0.3

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



--
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa  Phone: 319-335-3386
Department of Statistics andFax:   319-335-3017
   Actuarial Science
241 Schaeffer Hall  email:   luke-tier...@uiowa.edu
Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu
__
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] help with web scraping

2020-07-24 Thread Spencer Graves

Hi Bill et al.:


  That broke the dam:  It gave me a character vector of length 1 
consisting of 218 KB.  I fed that to XML::readHTMLTable and 
purrr::map_chr, both of which returned lists of 337 data.frames. The 
former retained names for all the tables, absent from the latter.  The 
columns of the former are all character;  that's not true for the latter.



  Sadly, it's not quite what I want:  It's one table for each 
office-party combination, but it's lost the office designation. However, 
I'm confident I can figure out how to hack that.



  Thanks,
  Spencer Graves


On 2020-07-23 17:46, William Michels wrote:

Hi Spencer,

I tried the code below on an older R-installation, and it works fine.
Not a full solution, but it's a start:


library(RCurl)

Loading required package: bitops

url <- 
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;
M_sos <- getURL(url)
print(M_sos)

[1] "\r\n\r\n\r\n\r\n\r\n\tSOS, Missouri - Elections:
Offices Filed in Candidate Filing\r\n wrote:

Hello, All:


I've failed with multiple attempts to scrape the table of
candidates from the website of the Missouri Secretary of State:


https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975


I've tried base::url, base::readLines, xml2::read_html, and
XML::readHTMLTable; see summary below.


Suggestions?
Thanks,
Spencer Graves


sosURL <-
"https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975;

str(baseURL <- base::url(sosURL))
# this might give me something, but I don't know what

sosRead <- base::readLines(sosURL) # 404 Not Found
sosRb <- base::readLines(baseURL) # 404 Not Found

sosXml2 <- xml2::read_html(sosURL) # HTTP error 404.

sosXML <- XML::readHTMLTable(sosURL)
# List of 0;  does not seem to be XML

sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK:
/Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets
[6] methods   base

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2curl_4.3
[4] xml2_1.3.2 XML_3.99-0.3

__
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] Windows, R version 4.0.2, read.csv() - -Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'hw1_data': No such file or

2020-07-24 Thread Eric Berger
What happens when you give the command
list.files(".","hw1_data")
?

On Fri, Jul 24, 2020 at 3:53 PM Mounica Miriyala <
mounicamiriyala0...@gmail.com> wrote:

> HI,
> I am currently taking my week 1 quiz 1. The quiz has  1 to 20 questions in
> which 11 to 20 should be dealt with dataset given by the coursera. But I am
> not able to open due to the mentioned error above. When I give dir() it
> shows the exact file that has the dataset to be used in the quiz1 but when
> i try to read the file in R it throwing the error -"*Error in
> file(file, "rt") : cannot open the connection*
>
>
> *In addition: Warning message:In file(file, "rt") :  cannot open file
> 'hw1_data': No such file or directory*
> "
> Please help! I tried the google for the error and tried different ways but
> still gets the same error message. I hope is will get this done in the
> second attempt for my quiz1.
>
> Regards,
>
> Mounica Miriyala.
>
> [[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.


[R] Windows, R version 4.0.2, read.csv() - -Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'hw1_data': No such file or dire

2020-07-24 Thread Mounica Miriyala
HI,
I am currently taking my week 1 quiz 1. The quiz has  1 to 20 questions in
which 11 to 20 should be dealt with dataset given by the coursera. But I am
not able to open due to the mentioned error above. When I give dir() it
shows the exact file that has the dataset to be used in the quiz1 but when
i try to read the file in R it throwing the error -"*Error in
file(file, "rt") : cannot open the connection*


*In addition: Warning message:In file(file, "rt") :  cannot open file
'hw1_data': No such file or directory*
"
Please help! I tried the google for the error and tried different ways but
still gets the same error message. I hope is will get this done in the
second attempt for my quiz1.

Regards,

Mounica Miriyala.

[[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 Question about MLE in R

2020-07-24 Thread Ravi Varadhan
I agree with John that SANN should be removed from optim.


More importantly, the default choice of optimizer in optim should be changed 
from "Nelder-Mead" to "BFGS."   Nelder-Mead is a bad choice for the most 
commonly encountered optimization problems in statistics.  I really do not see 
a good reason for not changing the default in optim.


Best regards,

Ravi

[[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] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-24 Thread Martin Maechler
> Ritwik Mohapatra 
> on Thu, 23 Jul 2020 23:41:57 +0530 writes:

> How to create a readable and legible plot in R with 10k+ values.I have a
> dataframe with 17298 records.There are two columns:Machine Name(Character)
> and Region(Character).So i want to create a readable plot with region in x
> axis and machine name in y axis.How do i do that using ggplot or any other
> way.Please help.

Good answers to this question will depend very much on how many
'Machine' and 'Region' levels there are.

(and this is a case where in my opinion it'd be *MUCH* more
 useful to have 'factor' instead of 'character'.. if only just
 so
 str()
or   summary()

would give useful/relevant information.

--
One possibility for a somewhat cute plot is a  "good ole"
sunflower plot (base graphics, but the idea must be easily
transferable to grid-based graphics such as ggplot2):

  help(sunflowerplot)


Martin Maechler
ETH Zurich

__
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] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-24 Thread Duncan Murdoch

On 23/07/2020 2:11 p.m., Ritwik Mohapatra wrote:

How to create a readable and legible plot in R with 10k+ values.I have a
dataframe with 17298 records.There are two columns:Machine Name(Character)
and Region(Character).So i want to create a readable plot with region in x
axis and machine name in y axis.How do i do that using ggplot or any other
way.Please help.


Can you point to the URL of a plot online that is similar to what you 
want?  I can't imagine a way to show 17298 character records in a graph 
in any useful way.


Duncan Murdoch

__
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] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-24 Thread Ritwik Mohapatra
How to create a readable and legible plot in R with 10k+ values.I have a
dataframe with 17298 records.There are two columns:Machine Name(Character)
and Region(Character).So i want to create a readable plot with region in x
axis and machine name in y axis.How do i do that using ggplot or any other
way.Please help.

[[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] Error in Rose Method (class balancing)

2020-07-24 Thread Neha gupta
O, I am very sorry for that, I have now included

output of dput is: structure(list(unique_id = c("L116", "L117", "L496",
"L9719",
"L9720", "L9721", "L9722", "L9723", "L10200", "L10201", "L10202",
"L10203", "L10204", "L10205", "L10206", "L10705", "L10706", "L10707",
"L10708", "L10709", "L10710", "L10711", "L10712", "L10713", "L10714",
"L10715", "L10716", "L10717", "L10718", "L13486"), McCC = c(6,
40, 115, 12, 14, 1, 56, 17, 1, 22, 24, 3, 59, 67, 11, 30, 1,
16, 1, 18, 4, 4, 1, 44, 1, 18, 40, 54, 1, 23), CLOC = c(0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), LLOC = c(52, 276, 663, 73, 82, 28, 318,
167, 50, 110, 98, 22, 374, 532, 39, 266, 67, 198, 37, 84, 63,
68, 4, 372, 58, 97, 290, 318, 8, 90), `Number of previous fixes` = c(1,
2, 6, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 1, 0, 0, 0, 1, 0, 0), `Number of previous modifications` = c(19,
58, 195, 50, 22, 11, 43, 47, 25, 14, 24, 10, 53, 97, 13, 58,
22, 94, 23, 51, 34, 18, 19, 75, 47, 28, 79, 96, 4, 10), `Number of
committers` = c(3,
3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 3, 2, 2,
1, 2, 2, 2, 2, 3, 1, 1), `Number of developer commits` = c(1843,
1843, 1843, 1300, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
1843, 1843, 1843, 1843, 1843, 1843, 1843), `Bug class` = structure(c(2L,
2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("true",
"false"), class = "factor")), row.names = c(NA, 30L), class = "data.frame")

library(caret)
library(farff)
library(DMwR)
library(pROC)
library(pls)

setwd("C:/Users/PC/Documents")
d=readARFF("bughunter.arff")
dput( head( d, 30 ) )

index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)

tr <- d[index, ]

ts <- d[-index, ]

boot3 <- trainControl(method = "repeatedcv", number=10,
repeats=10,classProbs = TRUE,verboseIter = FALSE,

summaryFunction = twoClassSummary, sampling = "rose")

set.seed(30218)

ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
= c("center", "scale", "nzv"), trControl = boot3)

getTrainPerf(ct)

On Thu, Jul 23, 2020 at 11:50 PM Jeff Newmiller 
wrote:

> All you did was include the dput command in your example. We need the
> output of dput, not the command itself.
>
> On July 23, 2020 2:43:31 PM PDT, Neha gupta 
> wrote:
> >David, I understand that the file will not be in your directory but I
> >have
> >provided the data using dput? Didn't I? Previously members of this
> >group
> >have used dput to provide the detail about their data. Seriously, I
> >have no
> >idea how else I can provide a reproducible example.
> >
> >
> >
> ><
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon
> >
> >Virus-free.
> >www.avast.com
> ><
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link
> >
> ><#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> >On Thu, Jul 23, 2020 at 10:47 PM David Winsemius
> >
> >wrote:
> >
> >>
> >> On 7/23/20 9:34 AM, Neha gupta wrote:
> >>
> >>
> >> Hello David, file not found should be the path problem I guess. I
> >just
> >> forgot the pROC library, which I included here. These are all the
> >libraries
> >> I am using.
> >>
> >> library(caret)
> >> library(farff)
> >> library(DMwR)
> >> library(pROC)
> >> library(pls)
> >>
> >> setwd("C:/Users/PC/Documents")
> >> d=readARFF("bughunter.arff")
> >>
> >>
> >> I suppose *you* might have such a file in that directory, but do you
> >> assume that *we* will
> >>
> >> A reproducible example will allow others to run your code. Seems
> >fairly
> >> clear that we are not there yet.
> >>
> >> --
> >>
> >> David.
> >>
> >> dput( head( d, 30 ) )
> >>
> >> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >>
> >> tr <- d[index, ]
> >>
> >> ts <- d[-index, ]
> >>
> >> boot3 <- trainControl(method = "repeatedcv", number=10,
> >> repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >>
> >> summaryFunction = twoClassSummary, sampling = "rose")
> >>
> >> set.seed(30218)
> >>
> >> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
> >"AUC", preProc
> >> = c("center", "scale", "nzv"), trControl = boot3)
> >>
> >> getTrainPerf(ct)
> >>
> >>
> >>
> >>
> ><
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=icon
> >
> >Virus-free.
> >> www.avast.com
> >>
> ><
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail_term=link
> >
> >>
> >> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta 
> >> wrote:
> >>
> >>>
> >>> Hello David, thanks for your reply. I have added the information.
> >>>
> >>> library(caret)
> >>> library(farff)
> >>> library(DMwR)
> >>>
> >>> d=readARFF("bughunter.arff")
> >>> dput( head( d, 30 ) )
> >>>
> >>> index <- createDataPartition(d$`Bug class`, p = .70,list = 

Re: [R] mice package won't install

2020-07-24 Thread Ivan Krylov
On Thu, 23 Jul 2020 12:44:57 -0400
David Krackhardt  wrote:

> When I try to install Rtools, it tells me the current version is
> actually Rtools40.  When I try to install Rtools40, it tells me that
> Rtools40 is not available for R version 3.6.3, which is the newest
> version of R (and the one I have).

For R 3.6.3, install the previous version of Rtools (see the
compatibility matrix at [*]).

The latest version of R as of now is R 4.0.2 [**], not 3.6.3.

I wonder why doesn't it install the binary package from [***] despite
it being available there.

-- 
Best regards,
Ivan

[*] https://cran.r-project.org/bin/windows/Rtools/history.html

[**] https://cran.r-project.org/bin/windows/base/R-4.0.2-win.exe

[***] https://cran.r-project.org/bin/windows/contrib/3.6/

__
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] mice package won't install

2020-07-24 Thread David Krackhardt
When I try to install the "mice" package, it tells me I can't without a
current version of Rtools.  When I try to install Rtools, it tells me the
current version is actually Rtools40.  When I try to install Rtools40, it
tells me that Rtools40 is not available for R version 3.6.3, which is the
newest version of R (and the one I have).

All I want is the "mice" library.  What do I do?

-David
 

David Krackhardt, Professor of Organizations
Heinz College of Public Policy and Management, and
 The Tepper School of Business
2215 Hamburg Hall
Carnegie Mellon University
Pittsburgh, PA 15213
website: www.andrew.cmu.edu/~krack
 (Erdos#=2)



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