Re: [R] stats:: spline's method could not be monoH.FC

2020-04-30 Thread Abby Spurdle
I agree, the documentation gives the impression that stats::spline
would allow "monoH.FC".

My guess is that stats::spline doesn't allow it because the function
is designed to return a list with x and y components. This doesn't
suit monotonic cubic Hermite splines because the function would also
need to return the slopes. Furthermore, additional functions may (or
may not) be required depending on what you want to do with x, y and
slope vectors.

Note that my package kubik, provides a range of functions for working
with cubic Hermite splines.






On Fri, May 1, 2020 at 4:39 AM Samuel Granjeaud IR/Inserm
 wrote:
>
> Hi,
>
> I have just noticed that the argument method of the spline function of
> the stats package does not allow to specify monoH.FC although the
> documentation tells it should be possible.
>
> I know how to program a workaround. This post intends to alert the
> maintainers.
>
> Stay safe,
> Samuel
> [[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] Rtools required

2020-04-30 Thread Jeff Newmiller
Minimize the number of referenced contributed packages, and inform your 
students that they can (should?) opt to not install from source when prompted.

In fact, this could be a use case where using the checkpoint package could help 
you manage version conflicts ... once you find a time point for which all of 
the packages you want them to use seem to play well together, then they can 
invoke the checkpoint and be on the same page with you.

Of course, you will have to make other sacrifices, like using an older version 
of R (I don't think the MRAN historical package archive is keeping up) and not 
having access to some cool stuff from recent advances in package features, but 
there aren't many options that can keep 15000+ packages all working and 
bugfixed in sync.


On April 29, 2020 8:00:43 PM PDT, Steven  wrote:
>Good point, but I am bothered by the non-discrimatory warning message
>to 
>all package installation attempts. My students install mostly binary 
>files, and I just hate to have them install Rtools. For one, they have 
>not had to do so until after RStudio-1.1.463. The fact that using this 
>older RStudio  can avoid the annoying warning message speaks volume.
>
>On 2020/4/30 上午 10:02, Bert Gunter wrote:
>> Wouldn't packages that have to be built from source on installation
>> require Rtools?
>>
>> 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 Wed, Apr 29, 2020 at 6:48 PM Steven  wrote:
>>> Thanks to all - very helpful. I search from c:\ and now find file
>>> .Renviron located in C:\Users\USER\Documents. That does it.
>>>
>>> I would like to pose an additional question, since it would also
>fall
>>> under the same subject line. This is an RStudio question but since I
>am
>>> using the free version the RStudio folks would not help me.
>>>
>>> My students simply need to install packages and are not building any
>>> packages so they have no reason to install Rtools.
>>>
>>> When they install (not build) packages (from CRAN or file archive)
>they
>>> received the same warning message saying
>>>
>>> "Rtools required to build a package".
>>>
>>> This is nonsense of course as they are, as I said, simply
>installing. I
>>> tell them to user an older RStudio version, specifically 1.1.463
>that's
>>> free of that warning. Any idea?
>>>
>>> Steven Yen
>>>
>>> On 2020/4/30 上午 06:30, Fox, John wrote:
 Dear Steven,

 It's possible that Windows will hide .Renviron, but it's generally
>a good idea, in my opinion, in Folder Options > View to click "Show
>hidden files" and uncheck "hide extensions". Then .Renviron should show
>up (once you've created it).

 Best,
John

> -Original Message-
> From: Bert Gunter 
> Sent: Wednesday, April 29, 2020 5:50 PM
> To: Steven 
> Cc: Fox, John ; R-help Mailing List  project.org>
> Subject: Re: [R] Rtools required
>
> Type
> ?.Renviron
> ?R.home
> ?"environment variables"
>
> at the R prompt to get what I think should be the info you need
>(or at
> least useful info).
>
>
> 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 Wed, Apr 29, 2020 at 2:37 PM Steven  wrote:
>> Thanks John. Where is file .Renviron located? It must be a hidden
>file.
>> I cannot find it.
>>
>> On 2020/4/28 下午 08:29, Fox, John wrote:
>>> Dear Steven,
>>>
>>> Did you follow the instruction on the Rtools webpage to add
>>>
>>> PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"
>>>
>>> to your .Renviron file?
>>>
>>> I hope this helps,
>>> John
>>>
>>>  -
>>>  John Fox, Professor Emeritus
>>>  McMaster University
>>>  Hamilton, Ontario, Canada
>>>  Web: http::/socserv.mcmaster.ca/jfox
>>>
 On Apr 28, 2020, at 4:38 AM, Steven  wrote:

 Dear All

 I updated to R-4.0.0. and also installed the latest Rtools 4.0
>(to
 now the new default folder c:\rtools40). While compiling a
>package
 (binary) I received the follow marning message saying Rtools is
 required. Any clues? Thanks.

 Steven Yen

 WARNING: Rtools is required to build R packages but is not
 currently installed. Please download and install the
>appropriate
 version of Rtools before proceeding:
 https://cran.rstudio.com/bin/windows/Rtools/


[[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,
>see
 

Re: [R] repository for ubuntu/linux mint for R 4.0.0

2020-04-30 Thread Ista Zahn
On Wed, Apr 29, 2020 at 8:33 PM Rasmus Liland  wrote:
>
> On 2020-04-29 19:55 -0400, ProfJCNash wrote:
> > In updating (an older computer with) Linux Mint 18.3 I tried to add
> > the repository
> >
> > deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/
> >
> > as per the "Download R for Linux" instructions. This gave an error
> > that there was no Release.key file.
> >
> > After some investigation, I found that
> >
> > deb https://cran.r-project.org/bin/linux/ubuntu xenial-cran40/
> >
> > i.e., CRAN not CLOUD. With this change, I could install R 4.0.
> >
> > Is this a known glitch?
>
> Dear JN,
>
> perhaps it is a glitch ... does anyone run mirmon[1] on the R
> mirrors to see which ones are old?

https://cran.r-project.org/mirmon_report.html

>
> If you open those two addresses in a browser, you see that the
> xenial-cran40 folder is only present in cran case ...  These are
> two different servers, which can also be seen by running curl:
>
> rasmus@twentyfive ~ % curl -I 
> https://cloud.r-project.org/bin/linux/ubuntu/
> HTTP/2 200
> content-type: text/html;charset=ISO-8859-1
> date: Thu, 30 Apr 2020 00:05:13 GMT
> server: Apache/2.4.39 (Unix)
> cache-control: max-age=1800
> expires: Thu, 30 Apr 2020 00:35:13 GMT
> x-cache: Miss from cloudfront
> ...
>
> rasmus@twentyfive ~ % curl -I 
> https://cran.r-project.org/bin/linux/ubuntu/
> HTTP/1.1 200 OK
> Date: Thu, 30 Apr 2020 00:05:23 GMT
> Server: Apache
> Content-Type: text/html;charset=UTF-8
>
> It is wise to point your package manager to a mirror[2] close to you
> instead of a cdn, e.g. [3] or something ...
>
> Best,
> Rasmus
>
> [1] https://spacehopper.org/mirmon/
> [2] https://cran.r-project.org/mirrors.html
> [3] https://mirror.las.iastate.edu/CRAN/bin/linux/ubuntu/
>
> __
> 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] Rtools required

2020-04-30 Thread Duncan Murdoch
I think you probably wrote to the wrong place at RStudio.  You won't get 
help from their help desk without a paid license for the software, but 
they run community forums (similar in aim to this mailing list) where 
community members are often pretty helpful.


In any case, this is the wrong place to ask for help on RStudio.

Duncan Murdoch

On 29/04/2020 9:48 p.m., Steven wrote:

Thanks to all - very helpful. I search from c:\ and now find file
.Renviron located in C:\Users\USER\Documents. That does it.

I would like to pose an additional question, since it would also fall
under the same subject line. This is an RStudio question but since I am
using the free version the RStudio folks would not help me.

My students simply need to install packages and are not building any
packages so they have no reason to install Rtools.

When they install (not build) packages (from CRAN or file archive) they
received the same warning message saying

"Rtools required to build a package".

This is nonsense of course as they are, as I said, simply installing. I
tell them to user an older RStudio version, specifically 1.1.463 that's
free of that warning. Any idea?

Steven Yen

On 2020/4/30 上午 06:30, Fox, John wrote:

Dear Steven,

It's possible that Windows will hide .Renviron, but it's generally a good idea, in my opinion, in 
Folder Options > View to click "Show hidden files" and uncheck "hide 
extensions". Then .Renviron should show up (once you've created it).

Best,
   John


-Original Message-
From: Bert Gunter 
Sent: Wednesday, April 29, 2020 5:50 PM
To: Steven 
Cc: Fox, John ; R-help Mailing List 
Subject: Re: [R] Rtools required

Type
?.Renviron
?R.home
?"environment variables"

at the R prompt to get what I think should be the info you need (or at
least useful info).


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 Wed, Apr 29, 2020 at 2:37 PM Steven  wrote:

Thanks John. Where is file .Renviron located? It must be a hidden file.
I cannot find it.

On 2020/4/28 下午 08:29, Fox, John wrote:

Dear Steven,

Did you follow the instruction on the Rtools webpage to add

PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"

to your .Renviron file?

I hope this helps,
John

 -
 John Fox, Professor Emeritus
 McMaster University
 Hamilton, Ontario, Canada
 Web: http::/socserv.mcmaster.ca/jfox


On Apr 28, 2020, at 4:38 AM, Steven  wrote:

Dear All

I updated to R-4.0.0. and also installed the latest Rtools 4.0 (to
now the new default folder c:\rtools40). While compiling a package
(binary) I received the follow marning message saying Rtools is
required. Any clues? Thanks.

Steven Yen

WARNING: Rtools is required to build R packages but is not
currently installed. Please download and install the appropriate
version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/


   [[alternative HTML version deleted]]

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

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


__
R-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] Rtools required

2020-04-30 Thread Steven
Thanks to all - very helpful. I search from c:\ and now find file 
.Renviron located in C:\Users\USER\Documents. That does it.


I would like to pose an additional question, since it would also fall 
under the same subject line. This is an RStudio question but since I am 
using the free version the RStudio folks would not help me.


My students simply need to install packages and are not building any 
packages so they have no reason to install Rtools.


When they install (not build) packages (from CRAN or file archive) they 
received the same warning message saying


"Rtools required to build a package".

This is nonsense of course as they are, as I said, simply installing. I 
tell them to user an older RStudio version, specifically 1.1.463 that's 
free of that warning. Any idea?


Steven Yen

On 2020/4/30 上午 06:30, Fox, John wrote:

Dear Steven,

It's possible that Windows will hide .Renviron, but it's generally a good idea, in my opinion, in 
Folder Options > View to click "Show hidden files" and uncheck "hide 
extensions". Then .Renviron should show up (once you've created it).

Best,
  John


-Original Message-
From: Bert Gunter 
Sent: Wednesday, April 29, 2020 5:50 PM
To: Steven 
Cc: Fox, John ; R-help Mailing List 
Subject: Re: [R] Rtools required

Type
?.Renviron
?R.home
?"environment variables"

at the R prompt to get what I think should be the info you need (or at
least useful info).


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 Wed, Apr 29, 2020 at 2:37 PM Steven  wrote:

Thanks John. Where is file .Renviron located? It must be a hidden file.
I cannot find it.

On 2020/4/28 下午 08:29, Fox, John wrote:

Dear Steven,

Did you follow the instruction on the Rtools webpage to add

   PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"

to your .Renviron file?

I hope this helps,
   John

-
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: http::/socserv.mcmaster.ca/jfox


On Apr 28, 2020, at 4:38 AM, Steven  wrote:

Dear All

I updated to R-4.0.0. and also installed the latest Rtools 4.0 (to
now the new default folder c:\rtools40). While compiling a package
(binary) I received the follow marning message saying Rtools is
required. Any clues? Thanks.

Steven Yen

WARNING: Rtools is required to build R packages but is not
currently installed. Please download and install the appropriate
version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/


  [[alternative HTML version deleted]]

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

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


__
R-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] Rtools required

2020-04-30 Thread Steven
Good point, but I am bothered by the non-discrimatory warning message to 
all package installation attempts. My students install mostly binary 
files, and I just hate to have them install Rtools. For one, they have 
not had to do so until after RStudio-1.1.463. The fact that using this 
older RStudio  can avoid the annoying warning message speaks volume.


On 2020/4/30 上午 10:02, Bert Gunter wrote:

Wouldn't packages that have to be built from source on installation
require Rtools?

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 Wed, Apr 29, 2020 at 6:48 PM Steven  wrote:

Thanks to all - very helpful. I search from c:\ and now find file
.Renviron located in C:\Users\USER\Documents. That does it.

I would like to pose an additional question, since it would also fall
under the same subject line. This is an RStudio question but since I am
using the free version the RStudio folks would not help me.

My students simply need to install packages and are not building any
packages so they have no reason to install Rtools.

When they install (not build) packages (from CRAN or file archive) they
received the same warning message saying

"Rtools required to build a package".

This is nonsense of course as they are, as I said, simply installing. I
tell them to user an older RStudio version, specifically 1.1.463 that's
free of that warning. Any idea?

Steven Yen

On 2020/4/30 上午 06:30, Fox, John wrote:

Dear Steven,

It's possible that Windows will hide .Renviron, but it's generally a good idea, in my opinion, in 
Folder Options > View to click "Show hidden files" and uncheck "hide 
extensions". Then .Renviron should show up (once you've created it).

Best,
   John


-Original Message-
From: Bert Gunter 
Sent: Wednesday, April 29, 2020 5:50 PM
To: Steven 
Cc: Fox, John ; R-help Mailing List 
Subject: Re: [R] Rtools required

Type
?.Renviron
?R.home
?"environment variables"

at the R prompt to get what I think should be the info you need (or at
least useful info).


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 Wed, Apr 29, 2020 at 2:37 PM Steven  wrote:

Thanks John. Where is file .Renviron located? It must be a hidden file.
I cannot find it.

On 2020/4/28 下午 08:29, Fox, John wrote:

Dear Steven,

Did you follow the instruction on the Rtools webpage to add

PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"

to your .Renviron file?

I hope this helps,
John

 -
 John Fox, Professor Emeritus
 McMaster University
 Hamilton, Ontario, Canada
 Web: http::/socserv.mcmaster.ca/jfox


On Apr 28, 2020, at 4:38 AM, Steven  wrote:

Dear All

I updated to R-4.0.0. and also installed the latest Rtools 4.0 (to
now the new default folder c:\rtools40). While compiling a package
(binary) I received the follow marning message saying Rtools is
required. Any clues? Thanks.

Steven Yen

WARNING: Rtools is required to build R packages but is not
currently installed. Please download and install the appropriate
version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/


   [[alternative HTML version deleted]]

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

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


__
R-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] stats:: spline's method could not be monoH.FC

2020-04-30 Thread Samuel Granjeaud IR/Inserm
Hi,

I have just noticed that the argument method of the spline function of 
the stats package does not allow to specify monoH.FC although the 
documentation tells it should be possible.

I know how to program a workaround. This post intends to alert the 
maintainers.

Stay safe,
Samuel
[[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] FW: problem with markov random field smooths in mgcv

2020-04-30 Thread Wilcox, Chris (O, Hobart)
Thanks very much Simon, that is super helpful.

Best,

Chris

On 25/3/20, 9:47 am, "Simon Wood"  wrote:

Hi Chris,

It's kind of a documentation glitch, a node is not supposed to be listed 
as its own neighbour (it causes the diagonal entries in the penalty 
matrix to be over-written by the wrong value). i.e. the neighbour list 
should be.

  NB <- list()
 NB$'East Timor' <- c(2,15)
 NB$Australia <- c(1,15)
 NB$'Sri Lanka' <-c(12,16)
 NB$Bangladesh <-c(12,13,16)
 NB$Philippines <- c(6,11,14,15,17)
 NB$Taiwan <- c(5,11)
 NB$Thailand <- c(8,10,12,13,14,15)
 NB$Vietnam <- c(7,10,11,14,15)
 NB$`South Korea` <- c(11)
 NB$Cambodia <- c(7,8)
 NB$China <- c(5,6,8,9,14)
 NB$India <- c(3,4,7,13,15,16)
 NB$Myanmar <- c(4,7,12,16)
 NB$Malaysia <- c(5,7,8,11,15)
 NB$Indonesia <- c(1,2,5,7,8,12,14)
 NB$HighSeas2 <- c(3,4,12,13)
 NB$HighSeas1 <- c(5)

I've fixed the help page and had the smooth constructor ignore 
auto-neighbours for the next release.

best,
Simon

   On 18/03/2020 07:44, Wilcox, Chris (O, Hobart) wrote:
> Hi all,
>  
>  I am trying to fit a model with a markov random field smooth in 
mgcv.  I am having some trouble with getting it to run, and in particular I am 
getting the message
>  
>  Error in initial.sp(w * x, S, off) : S[[1]] matrix is not +ve 
definite.
>  
>  After reading everything I could find on mrf, it sounds like there 
was a bug that was brought up with Simon Wood in 2012, due to differences 
between windows and linux, with the linus machine stopping due to this error, 
while windows was not.  I have not been able to find much else on it.  Any 
suggestions would be much appreciated.
>  
>  There is reproducible code below.
>  
>  Thanks
>  
>  Chris
>  
>  
>  library(mgcv)
>  
>  #create data
>  Country <- 
as.factor(c("Australia","Australia","Australia","Australia","Australia","Australia","Bangladesh","Bangladesh","Bangladesh",
>  
"Bangladesh","Bangladesh","Bangladesh","Cambodia","Cambodia","Cambodia","Cambodia","Cambodia","Cambodia",
>  "China","China","China","China","China","China","East Timor","East 
Timor","East Timor",
>  "East Timor","East Timor","East 
Timor","HighSeas1","HighSeas1","HighSeas1","HighSeas1","HighSeas1","HighSeas1",
>  
"HighSeas2","HighSeas2","HighSeas2","HighSeas2","HighSeas2","HighSeas2","China","China","China","China","China","China",
>  
"India","India","India","India","India","India","Indonesia","Indonesia","Indonesia","Indonesia","Indonesia","Indonesia",
>  
"Malaysia","Malaysia","Malaysia","Malaysia","Malaysia","Malaysia","Myanmar","Myanmar","Myanmar","Myanmar","Myanmar",
>  
"Myanmar","Philippines","Philippines","Philippines","Philippines","Philippines","Philippines","South
 Korea","South Korea",
>  "South Korea","South Korea","South Korea","South 
Korea","China","China","China","China","China","China",
>  "Sri Lanka","Sri Lanka","Sri Lanka","Sri Lanka","Sri Lanka","Sri 
Lanka","Taiwan","Taiwan","Taiwan","Taiwan",
>  
"Taiwan","Taiwan","Thailand","Thailand","Thailand","Thailand","Thailand","Thailand","Vietnam","Vietnam","Vietnam","Vietnam",
>  "Vietnam","Vietnam"))
>  
>  Count <- 
c(0,0,3,5,1,5,0,0,0,0,0,1,0,0,0,0,0,3,0,0,2,1,0,6,0,0,0,1,0,0,0,1,0,0,0,0
>  
,0,0,20,0,1,0,0,0,0,0,0,2,0,0,6,3,3,10,1,1,18,11,8,11,0,1,2,2,1,14,0,0,0,1,0,0
>  
,0,0,4,3,9,16,0,0,3,0,0,1,0,0,1,0,0,0,0,0,33,18,8,16,0,0,0,0,0,2,0,1,14,6,8,2
>  ,0,0,0,0,1,1)
>  
>  Data <- data.frame(Count,Country)
>  
>  #create neighbour matrix
>  NB <- list()
>  NB$'East Timor' <- c(1,2,15)
>  NB$Australia <- c(1,2,15)
>  NB$'Sri Lanka' <-c(3,12,16)
>  NB$Bangladesh <-c(4,12,13,16)
>  NB$Philippines <- c(5,6,11,14,15,17)
>  NB$Taiwan <- c(5,6,11)
>  NB$Thailand <- c(7,8,10,12,13,14,15)
>  NB$Vietnam <- c(7,8,10,11,14,15)
>  NB$`South Korea` <- c(9,11)
>  NB$Cambodia <- c(7,8,10)
>  NB$China <- c(5,6,8,9,11,14)
>  NB$India <- c(3,4,7,12,13,15,16)
>  NB$Myanmar <- c(4,7,12,13,16)
>  NB$Malaysia <- c(5,7,8,11,14,15)
>  NB$Indonesia <- c(1,2,5,7,8,12,14,15)
>  NB$HighSeas2 <- c(3,4,12,13,16)
>  NB$HighSeas1 <- c(5,17)
>  
>  #check levels and names match
>  all.equal(sort(names(NB)), sort(levels(Data$Country)))
>  
>  #try fitting GAM
>  m1 <- gam(Data$Count ~ s(Data$Country, bs = 'mrf', xt = list(nb = 
NB)))
>  
>  
>
> __
> 

[R-es] Instalar paquetes no disponibles para la versión actual

2020-04-30 Thread Manuel Mendoza
Buenas tardes. Tenía la versión 3.6.0 de R. Quería instalar el paquete
edarf, pero decía que no estaba disponible para esa versión. Actualicé R a
la versión 4.0.0, que creo que es la última, pero al tratar de reinstalar
forestFloor, me dice que no está disponible para la versión 4.0.0. He
abierto R 3.6.0 directamente, cliqueo install.packages("forestfloor") y
ahora me dice que no está disponible para esa versión.
A ver si me podéis echar una mano,
Gracias,
Manuel

[[alternative HTML version deleted]]

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


Re: [R] repository for ubuntu/linux mint for R 4.0.0

2020-04-30 Thread J C Nash
Given there's confirmation of some issue with the repositories,
I'm wondering where it should be reported for fixing. It looks like
the repo has been set up but not copied/moved to the appropriate
server or location, i.e., cloud rather than cran. My guess is that
there are some users struggling and thinking that they have made an
error. The msg on my machine concerned the Release.key file, but
the reality is a missing repo. Once I recognized that, it didn't
take too long to get R4.0 running.

JN


On 2020-04-29 8:22 p.m., Rasmus Liland wrote:
> On 2020-04-29 19:55 -0400, ProfJCNash wrote:
>> In updating (an older computer with) Linux Mint 18.3 I tried to add
>> the repository
>>
>> deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/
>>
>> as per the "Download R for Linux" instructions. This gave an error
>> that there was no Release.key file.
>>
>> After some investigation, I found that
>>
>> deb https://cran.r-project.org/bin/linux/ubuntu xenial-cran40/
>>
>> i.e., CRAN not CLOUD. With this change, I could install R 4.0.
>>
>> Is this a known glitch?
> 
> Dear JN,
> 
> perhaps it is a glitch ... does anyone run mirmon[1] on the R 
> mirrors to see which ones are old?
> 
> If you open those two addresses in a browser, you see that the 
> xenial-cran40 folder is only present in cran case ...  These are 
> two different servers, which can also be seen by running curl:
> 
>   rasmus@twentyfive ~ % curl -I 
> https://cloud.r-project.org/bin/linux/ubuntu/
>   HTTP/2 200 
>   content-type: text/html;charset=ISO-8859-1
>   date: Thu, 30 Apr 2020 00:05:13 GMT
>   server: Apache/2.4.39 (Unix)
>   cache-control: max-age=1800
>   expires: Thu, 30 Apr 2020 00:35:13 GMT
>   x-cache: Miss from cloudfront
>   ...
>   
>   rasmus@twentyfive ~ % curl -I 
> https://cran.r-project.org/bin/linux/ubuntu/
>   HTTP/1.1 200 OK
>   Date: Thu, 30 Apr 2020 00:05:23 GMT
>   Server: Apache
>   Content-Type: text/html;charset=UTF-8
> 
> It is wise to point your package manager to a mirror[2] close to you 
> instead of a cdn, e.g. [3] or something ... 
> 
> Best,
> Rasmus
> 
> [1] https://spacehopper.org/mirmon/
> [2] https://cran.r-project.org/mirrors.html
> [3] https://mirror.las.iastate.edu/CRAN/bin/linux/ubuntu/
>

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


Re: [R-es] [Posible SPAM] Re: Stopwords: Topic modelling con LDA

2020-04-30 Thread miriam . alzate
De acuerdo, muchas gracias!
El Jue, 30 de Abril de 2020, 14:45, Carlos Ortega escribió:
> Hola Miriam,
>
> No he visto que se use un filtro por defecto para el valor de tf-idf.
>
> En tu caso, tendrás que ver cúal es ese punto de corte que te revela
> señal,
> justo de los términos que te interesan.
> Mira la distribución de palabras y su valor de tf-idf y selecciona tu
> corte.
>
> Gracias,
> Carlos.
> www.qualityexcellence.es
>
>
> El mié., 29 abr. 2020 a las 14:00,  escribió:
>
>> Hola,
>>
>> Acabo de calcular tf-idf y me surge una duda. ¿Habría un valor de idf o
>> tf-idf que se considerara como umbral para establecer que una palabra es
>> muy común o no? Los valores de idf en mis datos van entre 0 y 3.78 y los
>> de tf-idf ente 0 y 0.07.
>>
>> Un saludo
>>
>> El Mar, 28 de Abril de 2020, 12:53, Carlos Ortega escribió:
>> > Hola,
>> > Yo de primeras los quitaría para qué otros topics aparecen.
>> >
>> > Y también aplicaría tf-idf a tus comentarios. Con tf-idf seguro que
>> > desaparecen como relevantes esas palabras comunes, será otra forma de
>> > confirmar que es buena la decisión de hacer el análisis eliminandolas.
>> >
>> > Saludos,
>> > Carlos Ortega
>> >
>> https://protection.puc.rediris.es/fmlurlsvc/?fewReq=:B:JVI2PTg1Nip6MT0iPCplaDE8PTY8PSp/ZWtibXh5fmkxNW1qPG49bm09PzluaDtpPzk9aG5uPj89bm0/bj06bjpvOWk7PDtuaSp4MT05NDQ8Oz0+Pz4qfWVoMTw/X01+fFVmPD47OTg0ITw/X01+fFVgPD47OTg0Kn5vfHgxYWV+ZW1hIm1gdm14aUx5Ym16bX5+bSJpfypvMTU8=http%3a%2f%2fwww.qualityecellence.es
>> >
>> > El mar., 28 abr. 2020 a las 11:44, 
>> escribió:
>> >
>> >> Buenos días,
>> >>
>> >> Estoy realizando un análisis de topic models con el método LDA. En
>> >> principio, he quitado del análisis las palabras "stopwords"
>> universales.
>> >> A
>> >> la hora de ver los topics y sus palabras más frecuentes encuentro que
>> >> son
>> >> muy similares y hay palabras que aparecen en todos los topics. Los
>> >> textos
>> >> que estoy analizando son opiniones de consumidores sobre una
>> categoría
>> >> concreta de cosméticos, por lo que la temática es muy concreta y
>> puede
>> >> ser
>> >> que en todas las opiniones se hable de cosas similares.
>> >>
>> >> Mi pregunta es,  incluiríais estas palabras que me aparecen en todos
>> los
>> >> topics o casi todos como stopwords?  Hay alguna forma de refinar más
>> el
>> >> análisis y que haya más diferencias entre topics?
>> >>
>> >> Este es el código que estoy usando:
>> >>
>> >> Reviews_dtm <-text_df12star %>%
>> >>   unnest_tokens(word, text) %>%
>> >>   anti_join(stop_words)%>%
>> >>   count(Brand, word) %>%
>> >>   cast_dtm(Brand, word, n)
>> >>
>> >>
>> >> Reviews_lda <- LDA(Reviews12_dtm, k = 15, control = list(seed =
>> 2016))
>> >>
>> >> Un saludo
>> >>
>> >> Miriam
>> >>
>> >> ___
>> >> R-help-es mailing list
>> >> R-help-es@r-project.org
>> >> https://stat.ethz.ch/mailman/listinfo/r-help-es
>> >>
>> >
>> >
>> > --
>> > Saludos,
>> > Carlos Ortega
>> > www.qualityexcellence.es
>> >
>> >
>>
>>
>>
>
> --
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>

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


Re: [R] ggplot get rid of unused/empty facets

2020-04-30 Thread PIKAL Petr
Yes, thank you Ivan.

I used slightly different approach but with similar idea. I just wondered,
if there is some clever hidden easy command or parameter inside ggplot
environment which could drop panels without data.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of Ivan Calandra
> Sent: Thursday, April 30, 2020 12:28 PM
> To: r-help@r-project.org
> Subject: Re: [R] ggplot get rid of unused/empty facets
> 
> Dear Petr,
> 
> This is not a ggplot2 solution, but you could just remove the NA rows and
> drop the levels of vzorek:
> met2 <- met[complete.cases(met), ]
> met2$vzorek <- droplevels(met2$vzorek)
> 
> But I guess you already thought about that...!
> 
> Ivan
> 
> --
> Dr. Ivan Calandra
> TraCEr, laboratory for Traceology and Controlled Experiments MONREPOS
> Archaeological Research Centre and Museum for Human Behavioural
> Evolution Schloss Monrepos
> 56567 Neuwied, Germany
> +49 (0) 2631 9772-243
> https://www.researchgate.net/profile/Ivan_Calandra
> 
> On 30/04/2020 12:13, PIKAL Petr wrote:
> > Dear all
> >
> > I seek some help how to remove unused facets in ggplot
> >
> > Here is my code
> > p <- ggplot(met, aes(x=datum, y=lsp))
> > p+geom_point(size=5)+geom_line()+facet_grid(.~vzorek)
> >
> > As you can see, there are some empty facets. Is there any reasonably
> > simple way how to automatically get rid of empty facets and adjust
> > width of remaining facets?
> >
> > I could programmatically remove empty levels of vzorek before invoking
> > ggplot but before are start with such approach I would like to check
> > if there is some solution within ggplot.
> >
> > Here are some toy data.
> >
> > met <- structure(list(datum = structure(c(18282, 18282, 18282, 18290,
> > 18290, 18290, 18296, 18296, 18296, 18304, 18304, 18304, 18311, 18311,
> > 18311, 18317, 18317, 18317, 18317, 18324, 18324, 18324, 18332, 18332,
> > 18332, 18340, 18340, 18340, 18345, 18345, 18345, 18352, 18352, 18369,
> > 18369, 18369, 18375, 18375, 18375), class = "Date"),
> > vzorek = structure(c(9L, 8L, 2L, 5L, 9L, 6L, 1L, 7L, 8L,
> > 9L, 5L, 1L, 2L, 7L, 8L, 5L, 2L, 1L, 7L, 9L, 7L, 5L, 4L, 2L,
> > 1L, 3L, 8L, 5L, 9L, 2L, 1L, 7L, 8L, 9L, 8L, 2L, 1L, 7L, 5L
> > ), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", "i"
> > ), class = "factor"), lsp = c(55.3, 54.68, 53.15, 54.55,
> > 55.17, NA, NA, NA, 54.79, 55.27, 54.44, NA, 53.31, NA, 54.52,
> > 54.35, 53.88, NA, NA, 55.21, NA, 54.39, NA, 52.95, NA, NA,
> > 54.56, 54.39, 55, 53.2, NA, NA, 54.54, NA, 54.57, 53.31,
> > NA, NA, NA), asp = c(-1.63, -1.47, -1.19, -1.35, -1.62, NA,
> > NA, NA, -1.46, -1.65, -1.4, NA, -1.2, NA, -1.5, -1.36, -1.21,
> > NA, NA, -1.64, NA, -1.36, NA, -1.21, NA, NA, -1.5, -1.42,
> > -1.68, -1.2, NA, NA, -1.47, NA, -1.47, -1.22, NA, NA, NA),
> > bsp = c(-7.19, -5.65, -7.22, -5.31, -7.12, NA, NA, NA, -5.65,
> > -7.14, -5.34, NA, -7.16, NA, -5.68, -5.3, -7.14, NA, NA,
> > -7.14, NA, -5.34, NA, -7.17, NA, NA, -5.65, -5.34, -7.25,
> > -7.19, NA, NA, -5.65, NA, -5.66, -7.14, NA, NA, NA)), row.names =
> > c(NA, -39L), class = "data.frame") Cheers Petr
> >
> >
> > __
> > 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] deciphering help for `attach`

2020-04-30 Thread PIKAL Petr
Hallo

Sorry for confusion. John explained in technical language what I was trying to 
explain in plain one. One cannot simply change values in original data frame or 
call them, however they could be used in functions.

Consider this

attach(cars)
speed <- speed*2
speed
 [1]  8  8 14 14 16 18 20 20 20 22 22 24 24 24 24 26 26 26 26 28 28 28 28 30 30
[26] 30 32 32 34 34 34 36 36 36 36 38 38 38 40 40 40 40 40 44 46 48 48 48 48 50
plot(speed, dist)
fit <- lm(dist~speed, data=cars)
abline(fit)
fit1 <- lm(dist~speed)
abline(fit1, col = 2)

And if you attach something which has speed and dist variable inside, the 
things could be even more confusing.

mydata <- data.frame(speed="Blue", dist="Black")
attach(mydata)
The following object is masked _by_ .GlobalEnv:

speed

The following objects are masked from cars:

dist, speed

> search()
 [1] ".GlobalEnv""mydata""cars" 
 [4] "package:stats" "package:datasets"  "package:fun"  
 [7] "package:utils" "package:grDevices" "package:graphics" 
[10] "package:methods"   "Autoloads" "package:base" 

So although mydata are attached its speed variable is accessible only by 
referencing to mydata, but now dist from mydata is used in lm, if cars data 
frame is not specified.

> fit <- lm(dist~speed)
Error in model.frame.default(formula = dist ~ speed, drop.unused.levels = TRUE) 
: 
  variable lengths differ (found for 'speed')

> speed
 [1]  8  8 14 14 16 18 20 20 20 22 22 24 24 24 24 26 26 26 26 28 28 28 28 30 30
[26] 30 32 32 34 34 34 36 36 36 36 38 38 38 40 40 40 40 40 44 46 48 48 48 48 50
> dist
[1] "Black"

I used attach myself a lot about 20 years ago but due to unexpected (by myself) 
behaviour I do not use it now. Of course nobody will prevent you to use or 
teach attach, but you has to acknowledge that attach is doing what it is doing 
and not what you or your students expect it is doing. And for me, environments 
are still something I did not familiarise with.

Cheers
Petr

> -Original Message-
> From: Edward McNeil 
> Sent: Monday, April 27, 2020 3:26 PM
> To: PIKAL Petr 
> Cc: r-help@r-project.org
> Subject: RE: [R] deciphering help for `attach`
> 
> Dear Petr,
> Thanks for your quick reply. Much appreciated. However, you haven't really
> answered either of my questions, although I don't quite understand your
> reference to La Gioconda.
> 
> In any case, despite your strong recommendation not to use `attach`, I am
> going to keep using it, as I have done successfully for the past 16 years, and
> keep teaching it, until it either kills me or disappears from R. 
> Unfortunately I
> have to teach R to students and I don't like it when they ask me "tricky"
> questions to which I have no answer. ;)
> --
> Edward McNeil
> 
> On Mon, April 27, 2020 8:00 pm, PIKAL Petr wrote:
> Hi.
> 
> I strongly recommend not to use attach. I agree that mentioned statements
> are rather contradictory and probably others could give you more insightful
> answer. You could consider that by attaching some data, you create
> something like a copy of original data in your system with a feature that you
> can use column names directly. If you change something in the data after
> attachment, you change only attached version and not an original.
> 
> It is similar as if you take a picture of Gioconda an use some creativity to 
> add
> a moustache to this picture. In any circumstances moustache does not
> propagate to the original Louvre painting. Do not perform any tricks,
> preferably do not perform attach.
> 
> Cheers
> Petr
> 
> > -Original Message-
> > From: R-help  On Behalf Of Edward McNeil
> > Sent: Monday, April 27, 2020 2:07 PM
> > To: r-help@r-project.org
> > Subject: [R] deciphering help for `attach`
> >
> > Hi,
> > I have two related questions.
> >
> > 1. In the help page for `attach` under "Details" it says in paragraph 3:
> > "By default the database is attached ..."
> >
> > But then paragraph 4 starts: "The database is not actually attached."
> >
> > Could somebody explain this contradiction? Is the data(base) attached
> > or not?
> >
> > 2. What is meant by the 5th paragraph: "One useful ‘trick’ is to use
> > what = NULL (or equivalently a length-zero list) to create a new
> > environment on the search path into which objects can be assigned by
> `assign` ... "?
> >
> > I don't understand what this "trick" is or why a "trick" needs to be
> > performed here.
> >
> > Thanks
> > --
> > Edward McNeil
> >
> > __
> > 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 

Re: [R-es] [Posible SPAM] Re: Stopwords: Topic modelling con LDA

2020-04-30 Thread Carlos Ortega
Hola Miriam,

No he visto que se use un filtro por defecto para el valor de tf-idf.

En tu caso, tendrás que ver cúal es ese punto de corte que te revela señal,
justo de los términos que te interesan.
Mira la distribución de palabras y su valor de tf-idf y selecciona tu corte.

Gracias,
Carlos.
www.qualityexcellence.es


El mié., 29 abr. 2020 a las 14:00,  escribió:

> Hola,
>
> Acabo de calcular tf-idf y me surge una duda. ¿Habría un valor de idf o
> tf-idf que se considerara como umbral para establecer que una palabra es
> muy común o no? Los valores de idf en mis datos van entre 0 y 3.78 y los
> de tf-idf ente 0 y 0.07.
>
> Un saludo
>
> El Mar, 28 de Abril de 2020, 12:53, Carlos Ortega escribió:
> > Hola,
> > Yo de primeras los quitaría para qué otros topics aparecen.
> >
> > Y también aplicaría tf-idf a tus comentarios. Con tf-idf seguro que
> > desaparecen como relevantes esas palabras comunes, será otra forma de
> > confirmar que es buena la decisión de hacer el análisis eliminandolas.
> >
> > Saludos,
> > Carlos Ortega
> >
> https://protection.puc.rediris.es/fmlurlsvc/?fewReq=:B:JVI2PTg1Nip6MT0iPCplaDE8PTY8PSp/ZWtibXh5fmkxNW1qPG49bm09PzluaDtpPzk9aG5uPj89bm0/bj06bjpvOWk7PDtuaSp4MT05NDQ8Oz0+Pz4qfWVoMTw/X01+fFVmPD47OTg0ITw/X01+fFVgPD47OTg0Kn5vfHgxYWV+ZW1hIm1gdm14aUx5Ym16bX5+bSJpfypvMTU8=http%3a%2f%2fwww.qualityecellence.es
> >
> > El mar., 28 abr. 2020 a las 11:44,  escribió:
> >
> >> Buenos días,
> >>
> >> Estoy realizando un análisis de topic models con el método LDA. En
> >> principio, he quitado del análisis las palabras "stopwords" universales.
> >> A
> >> la hora de ver los topics y sus palabras más frecuentes encuentro que
> >> son
> >> muy similares y hay palabras que aparecen en todos los topics. Los
> >> textos
> >> que estoy analizando son opiniones de consumidores sobre una categoría
> >> concreta de cosméticos, por lo que la temática es muy concreta y puede
> >> ser
> >> que en todas las opiniones se hable de cosas similares.
> >>
> >> Mi pregunta es,  incluiríais estas palabras que me aparecen en todos los
> >> topics o casi todos como stopwords?  Hay alguna forma de refinar más el
> >> análisis y que haya más diferencias entre topics?
> >>
> >> Este es el código que estoy usando:
> >>
> >> Reviews_dtm <-text_df12star %>%
> >>   unnest_tokens(word, text) %>%
> >>   anti_join(stop_words)%>%
> >>   count(Brand, word) %>%
> >>   cast_dtm(Brand, word, n)
> >>
> >>
> >> Reviews_lda <- LDA(Reviews12_dtm, k = 15, control = list(seed = 2016))
> >>
> >> Un saludo
> >>
> >> Miriam
> >>
> >> ___
> >> R-help-es mailing list
> >> R-help-es@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-help-es
> >>
> >
> >
> > --
> > Saludos,
> > Carlos Ortega
> > www.qualityexcellence.es
> >
> >
>
>
>

-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

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


Re: [R] ggplot get rid of unused/empty facets

2020-04-30 Thread Ivan Calandra
Dear Petr,

This is not a ggplot2 solution, but you could just remove the NA rows
and drop the levels of vzorek:
met2 <- met[complete.cases(met), ]
met2$vzorek <- droplevels(met2$vzorek)

But I guess you already thought about that...!

Ivan

--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra

On 30/04/2020 12:13, PIKAL Petr wrote:
> Dear all
>
> I seek some help how to remove unused facets in ggplot
>
> Here is my code
> p <- ggplot(met, aes(x=datum, y=lsp))
> p+geom_point(size=5)+geom_line()+facet_grid(.~vzorek)
>
> As you can see, there are some empty facets. Is there any reasonably simple
> way how to automatically get rid of empty facets and adjust width of
> remaining facets?
>
> I could programmatically remove empty levels of vzorek before invoking
> ggplot but before are start with such approach I would like to check if
> there is some solution within ggplot.
>
> Here are some toy data.
>
> met <- structure(list(datum = structure(c(18282, 18282, 18282, 18290, 
> 18290, 18290, 18296, 18296, 18296, 18304, 18304, 18304, 18311, 
> 18311, 18311, 18317, 18317, 18317, 18317, 18324, 18324, 18324, 
> 18332, 18332, 18332, 18340, 18340, 18340, 18345, 18345, 18345, 
> 18352, 18352, 18369, 18369, 18369, 18375, 18375, 18375), class = "Date"), 
> vzorek = structure(c(9L, 8L, 2L, 5L, 9L, 6L, 1L, 7L, 8L, 
> 9L, 5L, 1L, 2L, 7L, 8L, 5L, 2L, 1L, 7L, 9L, 7L, 5L, 4L, 2L, 
> 1L, 3L, 8L, 5L, 9L, 2L, 1L, 7L, 8L, 9L, 8L, 2L, 1L, 7L, 5L
> ), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", "i"
> ), class = "factor"), lsp = c(55.3, 54.68, 53.15, 54.55, 
> 55.17, NA, NA, NA, 54.79, 55.27, 54.44, NA, 53.31, NA, 54.52, 
> 54.35, 53.88, NA, NA, 55.21, NA, 54.39, NA, 52.95, NA, NA, 
> 54.56, 54.39, 55, 53.2, NA, NA, 54.54, NA, 54.57, 53.31, 
> NA, NA, NA), asp = c(-1.63, -1.47, -1.19, -1.35, -1.62, NA, 
> NA, NA, -1.46, -1.65, -1.4, NA, -1.2, NA, -1.5, -1.36, -1.21, 
> NA, NA, -1.64, NA, -1.36, NA, -1.21, NA, NA, -1.5, -1.42, 
> -1.68, -1.2, NA, NA, -1.47, NA, -1.47, -1.22, NA, NA, NA), 
> bsp = c(-7.19, -5.65, -7.22, -5.31, -7.12, NA, NA, NA, -5.65, 
> -7.14, -5.34, NA, -7.16, NA, -5.68, -5.3, -7.14, NA, NA, 
> -7.14, NA, -5.34, NA, -7.17, NA, NA, -5.65, -5.34, -7.25, 
> -7.19, NA, NA, -5.65, NA, -5.66, -7.14, NA, NA, NA)), row.names = c(NA, 
> -39L), class = "data.frame")
> Cheers
> Petr
>
>
> __
> 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] ggplot get rid of unused/empty facets

2020-04-30 Thread PIKAL Petr
Dear all

I seek some help how to remove unused facets in ggplot

Here is my code
p <- ggplot(met, aes(x=datum, y=lsp))
p+geom_point(size=5)+geom_line()+facet_grid(.~vzorek)

As you can see, there are some empty facets. Is there any reasonably simple
way how to automatically get rid of empty facets and adjust width of
remaining facets?

I could programmatically remove empty levels of vzorek before invoking
ggplot but before are start with such approach I would like to check if
there is some solution within ggplot.

Here are some toy data.

met <- structure(list(datum = structure(c(18282, 18282, 18282, 18290, 
18290, 18290, 18296, 18296, 18296, 18304, 18304, 18304, 18311, 
18311, 18311, 18317, 18317, 18317, 18317, 18324, 18324, 18324, 
18332, 18332, 18332, 18340, 18340, 18340, 18345, 18345, 18345, 
18352, 18352, 18369, 18369, 18369, 18375, 18375, 18375), class = "Date"), 
vzorek = structure(c(9L, 8L, 2L, 5L, 9L, 6L, 1L, 7L, 8L, 
9L, 5L, 1L, 2L, 7L, 8L, 5L, 2L, 1L, 7L, 9L, 7L, 5L, 4L, 2L, 
1L, 3L, 8L, 5L, 9L, 2L, 1L, 7L, 8L, 9L, 8L, 2L, 1L, 7L, 5L
), .Label = c("a", "b", "c", "d", "e", "f", "g", "h", "i"
), class = "factor"), lsp = c(55.3, 54.68, 53.15, 54.55, 
55.17, NA, NA, NA, 54.79, 55.27, 54.44, NA, 53.31, NA, 54.52, 
54.35, 53.88, NA, NA, 55.21, NA, 54.39, NA, 52.95, NA, NA, 
54.56, 54.39, 55, 53.2, NA, NA, 54.54, NA, 54.57, 53.31, 
NA, NA, NA), asp = c(-1.63, -1.47, -1.19, -1.35, -1.62, NA, 
NA, NA, -1.46, -1.65, -1.4, NA, -1.2, NA, -1.5, -1.36, -1.21, 
NA, NA, -1.64, NA, -1.36, NA, -1.21, NA, NA, -1.5, -1.42, 
-1.68, -1.2, NA, NA, -1.47, NA, -1.47, -1.22, NA, NA, NA), 
bsp = c(-7.19, -5.65, -7.22, -5.31, -7.12, NA, NA, NA, -5.65, 
-7.14, -5.34, NA, -7.16, NA, -5.68, -5.3, -7.14, NA, NA, 
-7.14, NA, -5.34, NA, -7.17, NA, NA, -5.65, -5.34, -7.25, 
-7.19, NA, NA, -5.65, NA, -5.66, -7.14, NA, NA, NA)), row.names = c(NA, 
-39L), class = "data.frame")
>

Cheers
Petr

__
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] Rtools required

2020-04-30 Thread Jeroen Ooms
On Wed, Apr 29, 2020 at 11:37 PM Steven  wrote:
>
> Hello John,
>
> Perhaps you can help me. I am an idiot. I visited the Rtools web page
> and learn to run the following lines in R: Still I am getting the same
> warning message.
>
>  > writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con =
> "~/.Renviron")
>  > Sys.which("make")
>make
> "C:\\rtools40\\usr\\bin\\make.exe"

That looks OK. Did you restart rstudio?

How exactly are getting this error? Are you using install.packages()
in R? Or using the pkgbuild package?

Also are you running the latest version of rstudio? I think old
versions may have had difficulty finding rtools40.

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