Re: [R] about Rstudio

2017-05-29 Thread Bogdan Tanasa
thank you Jeff. I shall re-install R using the recommendations from the
page you've sent.

initially, I wanted to set up the ./configure manually, in the following
way :

./configure --enable-R-shlib --prefix=/home/bogdan/R

On Mon, May 29, 2017 at 6:04 PM, Jeff Newmiller 
wrote:

> Did you follow the instructions at https://cran.r-project.org/
> bin/linux/ubuntu/README.html?
> --
> Sent from my phone. Please excuse my brevity.
>
> On May 29, 2017 2:07:27 PM PDT, Bogdan Tanasa  wrote:
> >Hi Bert, thank you for your email. yes, of course, i did the google
> >searches before posting, although the results did not help too much. At
> >the
> >end, I've copied the R executable from the installation folder to
> >/usr/local/lib/R/lib, and apparently it worked ...
> >
> >On Mon, May 29, 2017 at 2:04 PM, Bert Gunter 
> >wrote:
> >
> >> 1, SHouldn't you be posting this on the R Studio support site, not
> >here?
> >>
> >> 2. I googled on :
> >>
> >>  "R lib path(/usr/local/lib/R/lib) not found" Ubuntu
> >>
> >> and got what looked like relevant hits.
> >>
> >> So I'd say it's time for you to do some homework...
> >>
> >> -- Bert
> >>
> >>
> >> 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 Mon, May 29, 2017 at 1:53 PM, Bogdan Tanasa 
> >wrote:
> >> > Dear all,
> >> >
> >> > please could you help with an advice : I have installed Rstudio on
> >my
> >> > Ubuntu PC, and when I initiate the application, it says :
> >> >
> >> >  "R lib path(/usr/local/lib/R/lib) not found"
> >> >
> >> > on my computer, at the path "/usr/local/lib/R/lib" there are the
> >folders
> >> :
> >> > bin
> >> > etc
> >> > site-library
> >> >
> >> > R is installed in another folder that is "/home/bogdan/R".
> >> >
> >> > how could I fix the error please ? many thanks,
> >> >
> >> > --bogdan
> >> >
> >> > [[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.
>

[[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] about Rstudio

2017-05-29 Thread Jeff Newmiller
Did you follow the instructions at 
https://cran.r-project.org/bin/linux/ubuntu/README.html?
-- 
Sent from my phone. Please excuse my brevity.

On May 29, 2017 2:07:27 PM PDT, Bogdan Tanasa  wrote:
>Hi Bert, thank you for your email. yes, of course, i did the google
>searches before posting, although the results did not help too much. At
>the
>end, I've copied the R executable from the installation folder to
>/usr/local/lib/R/lib, and apparently it worked ...
>
>On Mon, May 29, 2017 at 2:04 PM, Bert Gunter 
>wrote:
>
>> 1, SHouldn't you be posting this on the R Studio support site, not
>here?
>>
>> 2. I googled on :
>>
>>  "R lib path(/usr/local/lib/R/lib) not found" Ubuntu
>>
>> and got what looked like relevant hits.
>>
>> So I'd say it's time for you to do some homework...
>>
>> -- Bert
>>
>>
>> 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 Mon, May 29, 2017 at 1:53 PM, Bogdan Tanasa 
>wrote:
>> > Dear all,
>> >
>> > please could you help with an advice : I have installed Rstudio on
>my
>> > Ubuntu PC, and when I initiate the application, it says :
>> >
>> >  "R lib path(/usr/local/lib/R/lib) not found"
>> >
>> > on my computer, at the path "/usr/local/lib/R/lib" there are the
>folders
>> :
>> > bin
>> > etc
>> > site-library
>> >
>> > R is installed in another folder that is "/home/bogdan/R".
>> >
>> > how could I fix the error please ? many thanks,
>> >
>> > --bogdan
>> >
>> > [[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-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] about Rstudio

2017-05-29 Thread Bert Gunter
On Mon, May 29, 2017 at 2:07 PM, Bogdan Tanasa  wrote:
> Hi Bert, thank you for your email. yes, of course, i did the google searches
> before posting, although the results did not help too much.

Then you should have said this in your post as well as **why** "the
results did not help too much."

-- Bert



At the end, I've
> copied the R executable from the installation folder to
> /usr/local/lib/R/lib, and apparently it worked ...
>
> On Mon, May 29, 2017 at 2:04 PM, Bert Gunter  wrote:
>>
>> 1, SHouldn't you be posting this on the R Studio support site, not here?
>>
>> 2. I googled on :
>>
>>  "R lib path(/usr/local/lib/R/lib) not found" Ubuntu
>>
>> and got what looked like relevant hits.
>>
>> So I'd say it's time for you to do some homework...
>>
>> -- Bert
>>
>>
>> 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 Mon, May 29, 2017 at 1:53 PM, Bogdan Tanasa  wrote:
>> > Dear all,
>> >
>> > please could you help with an advice : I have installed Rstudio on my
>> > Ubuntu PC, and when I initiate the application, it says :
>> >
>> >  "R lib path(/usr/local/lib/R/lib) not found"
>> >
>> > on my computer, at the path "/usr/local/lib/R/lib" there are the folders
>> > :
>> > bin
>> > etc
>> > site-library
>> >
>> > R is installed in another folder that is "/home/bogdan/R".
>> >
>> > how could I fix the error please ? many thanks,
>> >
>> > --bogdan
>> >
>> > [[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] about Rstudio

2017-05-29 Thread Ismail SEZEN
You need to search a bit harder. At least give 60 minutes yourself. Check date 
of resultant pages hence be sure that you don’t follow an outdated instruction. 
 Hence, you can learn how to search in time.

Please, read;
https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R

I strictly suggest you install R from Ubuntu repo. Do not try to 
compile/install to another custom location unless if you have very good reason. 
Try to follow generic installation steps at first.

> On 30 May 2017, at 00:07, Bogdan Tanasa  wrote:
> 
> Hi Bert, thank you for your email. yes, of course, i did the google
> searches before posting, although the results did not help too much. At the
> end, I've copied the R executable from the installation folder to
> /usr/local/lib/R/lib, and apparently it worked …

Copying an executable might not be a elegant solution. You might have issues in 
the future.


> 
> On Mon, May 29, 2017 at 2:04 PM, Bert Gunter  wrote:
> 
>> 1, SHouldn't you be posting this on the R Studio support site, not here?
>> 
>> 2. I googled on :
>> 
>> "R lib path(/usr/local/lib/R/lib) not found" Ubuntu
>> 
>> and got what looked like relevant hits.
>> 
>> So I'd say it's time for you to do some homework...
>> 
>> -- Bert
>> 
>> 
>> 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 Mon, May 29, 2017 at 1:53 PM, Bogdan Tanasa  wrote:
>>> Dear all,
>>> 
>>> please could you help with an advice : I have installed Rstudio on my
>>> Ubuntu PC, and when I initiate the application, it says :
>>> 
>>> "R lib path(/usr/local/lib/R/lib) not found"
>>> 
>>> on my computer, at the path "/usr/local/lib/R/lib" there are the folders
>> :
>>> bin
>>> etc
>>> site-library
>>> 
>>> R is installed in another folder that is "/home/bogdan/R".
>>> 
>>> how could I fix the error please ? many thanks,
>>> 
>>> --bogdan
>>> 
>>>[[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-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] creat contingency tables with fixed row and column margins

2017-05-29 Thread Robert Baer

getAnywhere(fisher.test) probably has some clues


On 5/27/2017 2:49 PM, li li wrote:

Hi all,
   Is there an R function that can be used to enumerate all the contingency
tables with fixed row and column margins. For example, can we list all 3 by
3 tables with row margins 3,6,6 and column margins 5,5,5.
Thanks very much!
Hanna

[[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] about Rstudio

2017-05-29 Thread Bogdan Tanasa
Hi Bert, thank you for your email. yes, of course, i did the google
searches before posting, although the results did not help too much. At the
end, I've copied the R executable from the installation folder to
/usr/local/lib/R/lib, and apparently it worked ...

On Mon, May 29, 2017 at 2:04 PM, Bert Gunter  wrote:

> 1, SHouldn't you be posting this on the R Studio support site, not here?
>
> 2. I googled on :
>
>  "R lib path(/usr/local/lib/R/lib) not found" Ubuntu
>
> and got what looked like relevant hits.
>
> So I'd say it's time for you to do some homework...
>
> -- Bert
>
>
> 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 Mon, May 29, 2017 at 1:53 PM, Bogdan Tanasa  wrote:
> > Dear all,
> >
> > please could you help with an advice : I have installed Rstudio on my
> > Ubuntu PC, and when I initiate the application, it says :
> >
> >  "R lib path(/usr/local/lib/R/lib) not found"
> >
> > on my computer, at the path "/usr/local/lib/R/lib" there are the folders
> :
> > bin
> > etc
> > site-library
> >
> > R is installed in another folder that is "/home/bogdan/R".
> >
> > how could I fix the error please ? many thanks,
> >
> > --bogdan
> >
> > [[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] about Rstudio

2017-05-29 Thread Bert Gunter
1, SHouldn't you be posting this on the R Studio support site, not here?

2. I googled on :

 "R lib path(/usr/local/lib/R/lib) not found" Ubuntu

and got what looked like relevant hits.

So I'd say it's time for you to do some homework...

-- Bert


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 Mon, May 29, 2017 at 1:53 PM, Bogdan Tanasa  wrote:
> Dear all,
>
> please could you help with an advice : I have installed Rstudio on my
> Ubuntu PC, and when I initiate the application, it says :
>
>  "R lib path(/usr/local/lib/R/lib) not found"
>
> on my computer, at the path "/usr/local/lib/R/lib" there are the folders :
> bin
> etc
> site-library
>
> R is installed in another folder that is "/home/bogdan/R".
>
> how could I fix the error please ? many thanks,
>
> --bogdan
>
> [[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] about Rstudio

2017-05-29 Thread Bogdan Tanasa
Dear all,

please could you help with an advice : I have installed Rstudio on my
Ubuntu PC, and when I initiate the application, it says :

 "R lib path(/usr/local/lib/R/lib) not found"

on my computer, at the path "/usr/local/lib/R/lib" there are the folders :
bin
etc
site-library

R is installed in another folder that is "/home/bogdan/R".

how could I fix the error please ? many thanks,

--bogdan

[[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] get the value of a biplane

2017-05-29 Thread David Winsemius

> On May 29, 2017, at 1:16 PM, Duncan Murdoch  wrote:
> 
> On 29/05/2017 3:15 PM, Jeff Newmiller wrote:
>> Well, then I will hedge by saying that IN MY OPINION it is an error, because 
>> when it isn't exported the arguments not specified in the generic cannot be 
>> visible for argument completion in editors.
> 
> But that's not true.  If you want the arguments , use
> 
> args(getS3method("predict", class(x)))
> 
> where x is your bs() object.  RStudio appears to make use of something like 
> this.  R.app on MacOS and Rgui on Windows does something different, I think 
> not as effectively.

I think R.app uses rcompgen {utils}. Fortunately a deficit in my aging memory 
was filled in because typing `?completion` brought up the correct help page. I 
was not so lucky in trying to find reference to that function in the R for 
MacOS FAQ.

-- 
David.
> I don't know about other editors.
> 
> (BTW, I think the getS3method function has a bug:  if you change the x object 
> to have class c("foobar", class(x)), it *does* fail, even though predict(x, 
> ...)  will still work.)
> 
> The predict.lm function specifies new data with the newdata argument, while 
> the predict.bs function specifies it with the newx argument. Invoking with 
> the generic is supposed be useful when trying out a variety of models, but 
> being unable to generically specify a data frame (due to the inconsistent 
> naming) blows that strategy to pieces anyway so you might as well be able to 
> call the functions explicitly.
>> 
> 
> In RStudio, if you set x <- bs(1:10), then type
> 
> predict(x,
> 
> and hit TAB, you are offered "object", "newx" and "..." as choices.  On the 
> other editors I mentioned you appear to get a list of argument names for all 
> possible methods regardless of the class of x.
> 
> 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.

David Winsemius
Alameda, CA, USA

__
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] Disable weight re-scaling in GLMNET

2017-05-29 Thread Maggie Makar
Hi all, 
Wondering if there is a way to disable observation weight re-scaling (such
that it adds to N of observations) in glmnet without having to delve into
the fortran code/ minimal edits to fortran code?
Thanks 
Maggie 






[[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] R-help Digest, Vol 171, Issue 20

2017-05-29 Thread David Winsemius

> On May 28, 2017, at 11:53 PM, Brigitte Mangin  wrote:
> 
> Thanks Ron,
> 
> In fact, I want to make a model choice using different fixed structures and 
> using the results of:
> Gurka MJ (2006) Selecting the best linear mixed model under reml. The 
> American Statistician 60(1):19{26,
> the best criterium uses the reml likelihood.
> 
> I asked the ASREML-r developpers and they answered that their results were 
> checked against GENSTAT.
> 
> I think it is not really a good think for the R community to compute a REML 
> likelihood that is probably not the REML likelihood.

Is it your understanding that REML values should be different somehow than 
other likelihoods with respect to the fact that you should only be comparing 
_differences_ in model likelihoods calculated on the same data? The value of a 
likelihood is only specified up to a constant (as Thierry Onkelinx already 
pointed out.)

I can get different deviances (-2*log(likelihood) in glm poisson models by just 
grouping data elements and modeling counts. But varying models will have the 
same differences in deviance regardless of grouping or not.

Looking at this copy of that citation It appears to me that differences 
(comparing full to reduced) in various criteria for models is what is under 
discussion:

http://users.jyu.fi/~hemipu/itms/Gurka%202006,%20TAS,%20REML.pdf

You should show some results rather than letting this discussion remain so 
vague.

-- 
David.


> 
> Brigitte
> 
> 
> 
> Brigitte Mangin, INRA, LIPM, CS 52627, 31326 CASTANET-TOLOSAN
> tel: 33 + (0)5 61 28 54 58
> 
> 
> De : Crump, Ron 
> Envoyé : mardi 23 mai 2017 10:29
> À : r-help@r-project.org; Brigitte Mangin
> Objet : Re: R-help Digest, Vol 171, Issue 20
> 
> Hi Brigitte,
> 
>> Did somebody know why asreml does not provide the same REML loglikehood
>> as coxme, lme4 or lmne.
> 
> I don't know the answer to this, but I'd guess it is either to do with the
> use of the average information REML algorithm or asreml-r is for some
> reason ending up with a different subset of the data.
> 
>> If it was just a constant value between the two models (with or without
>> the fixed effect) it would not be important. But it is not.
>> I checked that the variance component estimators were equal.
> 
> I'm still not clear that it is important (if the data subset analysed is
> the same). You would only use the REML likelihoods to compare models with
> different random effects and the same fixed effect structure (is there
> another use for the REML likelihood other than that?), so then it is
> really a question of whether for a given pair of random effect models and
> the same data the likelihood ratio test statistic  changes across analysis
> methods. Unless for some reason you are comparing two random effect models
> fitted with different routines (one of which is asreml-r).
> 
> Ron.
> 
> 
> __
> 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.

David Winsemius
Alameda, CA, USA

__
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] get the value of a biplane

2017-05-29 Thread Duncan Murdoch

On 29/05/2017 3:15 PM, Jeff Newmiller wrote:

Well, then I will hedge by saying that IN MY OPINION it is an error, because 
when it isn't exported the arguments not specified in the generic cannot be 
visible for argument completion in editors.


But that's not true.  If you want the arguments , use

args(getS3method("predict", class(x)))

where x is your bs() object.  RStudio appears to make use of something 
like this.  R.app on MacOS and Rgui on Windows does something different, 
I think not as effectively. I don't know about other editors.


(BTW, I think the getS3method function has a bug:  if you change the x 
object to have class c("foobar", class(x)), it *does* fail, even though 
predict(x, ...)  will still work.)


 The predict.lm function specifies new data with the newdata argument, 
while the predict.bs function specifies it with the newx argument. 
Invoking with the generic is supposed be useful when trying out a 
variety of models, but being unable to generically specify a data frame 
(due to the inconsistent naming) blows that strategy to pieces anyway so 
you might as well be able to call the functions explicitly.




In RStudio, if you set x <- bs(1:10), then type

predict(x,

and hit TAB, you are offered "object", "newx" and "..." as choices.  On 
the other editors I mentioned you appear to get a list of argument names 
for all possible methods regardless of the class of x.


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.


Re: [R] get the value of a biplane

2017-05-29 Thread Jeff Newmiller
Well, then I will hedge by saying that IN MY OPINION it is an error, because 
when it isn't exported the arguments not specified in the generic cannot be 
visible for argument completion in editors.  The predict.lm function specifies 
new data with the newdata argument, while the predict.bs function specifies it 
with the newx argument. Invoking with the generic is supposed be useful when 
trying out a variety of models, but being unable to generically specify a data 
frame (due to the inconsistent naming) blows that strategy to pieces anyway so 
you might as well be able to call the functions explicitly.
-- 
Sent from my phone. Please excuse my brevity.

On May 29, 2017 2:43:22 AM PDT, Duncan Murdoch  wrote:
>
>On May 28, 2017 1:53:29 PM PDT, Rui Barradas 
>wrote:
>>  > predict.bs(SCurve, xnew = 40:45)
>> Error in predict.bs(SCurve, xnew = 40:45) :
>>could not find function "predict.bs"
>
>You should call it using the generic, i.e.
>
>predict(SCurve, xnew = 40:45)
>
>
>On 29/05/2017 2:35 AM, Jeff Newmiller wrote:
>> Looks like it is not exported from the package namespace... a
>packaging error.
>>
>
>It's not an error to rely on the generic to get to a method.
>
>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.


Re: [R] R-help Digest, Vol 171, Issue 20

2017-05-29 Thread Brigitte Mangin
Thanks Ron,

In fact, I want to make a model choice using different fixed structures and 
using the results of:
Gurka MJ (2006) Selecting the best linear mixed model under reml. The American 
Statistician 60(1):19{26,
the best criterium uses the reml likelihood.

I asked the ASREML-r developpers and they answered that their results were 
checked against GENSTAT.

I think it is not really a good think for the R community to compute a REML 
likelihood that is probably not the REML likelihood.

Brigitte



Brigitte Mangin, INRA, LIPM, CS 52627, 31326 CASTANET-TOLOSAN
tel: 33 + (0)5 61 28 54 58


De : Crump, Ron 
Envoyé : mardi 23 mai 2017 10:29
À : r-help@r-project.org; Brigitte Mangin
Objet : Re: R-help Digest, Vol 171, Issue 20

Hi Brigitte,

>Did somebody know why asreml does not provide the same REML loglikehood
>as coxme, lme4 or lmne.

I don't know the answer to this, but I'd guess it is either to do with the
use of the average information REML algorithm or asreml-r is for some
reason ending up with a different subset of the data.

>If it was just a constant value between the two models (with or without
>the fixed effect) it would not be important. But it is not.
>I checked that the variance component estimators were equal.

I'm still not clear that it is important (if the data subset analysed is
the same). You would only use the REML likelihoods to compare models with
different random effects and the same fixed effect structure (is there
another use for the REML likelihood other than that?), so then it is
really a question of whether for a given pair of random effect models and
the same data the likelihood ratio test statistic  changes across analysis
methods. Unless for some reason you are comparing two random effect models
fitted with different routines (one of which is asreml-r).

Ron.


__
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] Need help for Netbeans R plugin development

2017-05-29 Thread Robert Baer

rJava and Rserve might be architectures of interest.


On 5/28/2017 1:12 PM, Peter Cheung wrote:

Hi
My name is Peter, developing R plugin for netbeans, it is entirely in Java. 
What is the best way to interact Java with R and how can I hook some R 
functions such as plot()? so everytime plot() is called and i can capture the 
generated graph.
thanks
from Peter
__
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] R - datatable formatting with javascript

2017-05-29 Thread Krzysiek Gniady
Can anybody help with this problem?

2017-05-22 11:32 GMT+02:00 Krzysiek Gniady :

> I'm trying to format datatable in R using DT package. I have code like
> this:
>
> library(data.table)
> library(DT)
> data<-data.table(rbind(c(1,2,3),c(4,5,6)))
> colnames(data)<- c('A','B','c')
>
> datatable(data, rownames=F,
>   colnames=c('A','B','C'),
>   class='stripe cell-border hover',
>   options=list(
> pageLength=100,
> dom='ltp',
> initComplete = JS("
>   function(settings, json) {
>   $(this.api().table().body()).css({
>   'background-color': 'red',
>   'outline-color': 'red',
>   'margin':'100px',
>   'color': 'violet',
>   'text-align': 'center',
>   'font-family': 'Courier New',
>   'border-radius': '25px'
>   });
>   $(this.api().table().header()).css({
>   'background-color': '#000',
>   'color': '#fff',
>   'outline-color': 'red',
>   'margin':'100px',
>   'text-align': 'center',
>   'font-family': 'Courier New',
>   'border-radius': '25px'
>   });
>   }
>   ")
> ),
>   caption = htmltools::tags$caption(
> style = 'caption-side: top; text-align: center; color:black;
> font-size:200% ;','Table'),
>   filter=list(position = 'top')
>   )
>
> And I have problem with javascript in function JS(). It modifies
> background color (but only in header), font color and style. But commands
> to align text or round corners don't work.
>
> Why does it work like that? And how can I modify code to format this other
> things?
>
>
> Regards,
>
> Jeddite
>

[[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] get the value of a biplane

2017-05-29 Thread Rui Barradas

Hello,

Em 29-05-2017 10:43, Duncan Murdoch escreveu:


On May 28, 2017 1:53:29 PM PDT, Rui Barradas  wrote:

 > predict.bs(SCurve, xnew = 40:45)
Error in predict.bs(SCurve, xnew = 40:45) :
   could not find function "predict.bs"


You should call it using the generic, i.e.

predict(SCurve, xnew = 40:45)


Thanks, I should have tested that. Just did and it (obviously) worked, 
giving the same result as splines:::predict.bs(...).


Rui Barradas



On 29/05/2017 2:35 AM, Jeff Newmiller wrote:

Looks like it is not exported from the package namespace... a
packaging error.



It's not an error to rely on the generic to get to a method.

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.


Re: [R] get the value of a biplane

2017-05-29 Thread Duncan Murdoch


On May 28, 2017 1:53:29 PM PDT, Rui Barradas  wrote:

 > predict.bs(SCurve, xnew = 40:45)
Error in predict.bs(SCurve, xnew = 40:45) :
   could not find function "predict.bs"


You should call it using the generic, i.e.

predict(SCurve, xnew = 40:45)


On 29/05/2017 2:35 AM, Jeff Newmiller wrote:

Looks like it is not exported from the package namespace... a packaging error.



It's not an error to rely on the generic to get to a method.

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.


Re: [R] Spacing Between Elements in Lattice Legend

2017-05-29 Thread Lorenzo Isella




Hello,
It was a matter of introducing a height parameter.
This code at the end provides me exactly with what I need.
Cheers

Lorenzo

#à

barchart(
 number ~ country ,
   groups = as.factor(year),
   data = df_tot,
  origin = 0,
   aspect = "fill",
   par.settings = c(ggplot2like(col = c("blue", "red"))),
   axis = axis.grid,
   xlab = list("Number of Beneficiaries", cex = 1.2),
   ylab = list("Country", cex = 1.2),
   main = list(NULL),
   between = list(x = 1),
  scales = list(cex = 1),
   auto.key = list(
   title = "Year",
   height = 0.8,
   columns = 1,
   space = "right",
   padding.text =3
 )
 )
 





On Sun, May 28, 2017 at 03:11:36PM -0700, Bert Gunter wrote:

1. Always cc the list, which I have done here (unless you want to say
something that truly should be private).

2. Ahh... I see. I don't believe you can do it using auto.key, which
feeds it's list to the simpleKey() function: the price you pay for
keeping it simple is that you lack fine control over details such as
the rectangle height, which is (I believe) what you want. If you
replace the auto.key=  list via the following key= list, I think you
get what you want by controlling rectangle height to your taste: e.g.

key =   list(title = "Year",
  text = list(c("2015","2016")),
  rectangles = list(height=.5,
  col= c("blue","red")),
  columns=1,space="right",padding.text=3)


If this is *NOT* what you want, do cc the list in any reply.


Oh, and incidentally, your code mistakenly had the "main" argument replicated.


Cheers,
Bert


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 Sun, May 28, 2017 at 1:06 PM, Lorenzo Isella
 wrote:

Thanks for the suggestion, but it is not what I want.
I do not want to have a separation of the rectangles in the main plot,
but only in the legend generated by my example.
Any idea about how to achieve that?

Lorenzo


On Sun, May 28, 2017 at 09:41:10AM -0700, Bert Gunter wrote:


See the "border" and "lwd" arguments in ?panel.barchart (checking the
panel function help for your display is always a good idea for such
questions).

Adding:

border = "lightgray", lwd=1,

to your call would seem to give what you want. (modify appropriately
to meet your aesthetic preferences).

Cheers,
Bert
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 Sun, May 28, 2017 at 8:26 AM, Lorenzo Isella
 wrote:


Dear All,
Please consider the short code at the end of the email.
It generates a barchart where everything is as I want, apart from some
minor tuning of the legend.
I can control the spacing between the text in the two rows of the
legend, but how do I force some separation between the red and the
blue rectangles in the legend?
Any suggestion is welcome.
Cheers

Lorenzo

###

library(lattice)
library(latticeExtra)


df_tot<-structure(list(country = structure(c(13L, 1L, 3L, 21L, 12L, 6L,
22L, 14L, 19L, 20L, 4L, 16L, 9L, 11L, 18L, 17L, 7L, 8L, 2L, 15L,
10L, 5L, 13L, 1L, 23L, 21L, 12L, 6L, 22L, 14L, 19L, 20L, 4L,
16L, 9L, 11L, 24L, 18L, 25L, 28L, 26L, 17L, 7L, 8L, 2L, 27L,
15L, 10L), .Label = c("BE", "PT", "CZ", "EL", "TR", "EE", "NO",
"PL", "IE", "SI", "IL", "DK", "AT", "FI", "SE", "HU", "NL", "IT",
"FR", "UK", "DE", "ES", "CY", "IS", "LT", "MT", "RS", "LV"), class =
"factor"),
   number = c(12L, 1L, 2L, 42L, 11L, 4L, 78L, 12L, 35L, 41L,
   2L, 21L, 8L, 9L, 25L, 24L, 4L, 4L, 1L, 12L, 8L, 3L, 5L, 1L,
1L, 32L, 16L, 3L, 75L, 20L, 16L, 29L, 3L, 9L, 10L, 5L, 1L,
33L, 1L, 2L, 1L, 6L, 7L, 2L, 3L, 1L, 11L, 3L), year =
c(2015,
2015, 2015, 2015, 2015, 2015, 2015, 2015, 2015,
2015, 2015,
2015, 2015, 2015, 2015, 2015, 2015, 2015,
2015, 2015, 2015,
2015, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016,
2016, 2016)), .Names =
c("country",
"number", "year"), row.names =
c(NA, -48L), class = "data.frame")


p1 <- barchart(number ~ country ,
 groups= 

Re: [R] get the value of a biplane

2017-05-29 Thread Jeff Newmiller
Looks like it is not exported from the package namespace... a packaging error. 
-- 
Sent from my phone. Please excuse my brevity.

On May 28, 2017 1:53:29 PM PDT, Rui Barradas  wrote:
>Hello,
>
>Can anyone explain why this error?
>
> > library(splines)
> >
> > knots <- c(6, 12, 22, 30, 35)
> > x <- c(0.0, .25, 1.0, 2.0, 3.0)
>> SCurve <- bs(x = x, knots = knots, intercept = FALSE, Boundary.knots 
>= c(0,3.5))
> > class(SCurve)
>[1] "bs" "basis"  "matrix"
> >
> > ?predict.bs
> > predict.bs(SCurve, xnew = 40:45)
>Error in predict.bs(SCurve, xnew = 40:45) :
>   could not find function "predict.bs"
>
>Note that splines:::predict.bs(SCurve, xnew = 40:45) works.
>
> > sessionInfo()
>R version 3.4.0 (2017-04-21)
>Platform: x86_64-w64-mingw32/x64 (64-bit)
>Running under: Windows 7 x64 (build 7601) Service Pack 1
>
>Matrix products: default
>
>locale:
>[1] LC_COLLATE=Portuguese_Portugal.1252 
>LC_CTYPE=Portuguese_Portugal.1252
>[3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C 
>
>[5] LC_TIME=Portuguese_Portugal.1252
>
>attached base packages:
>[1] splines   stats graphics  grDevices utils datasets  methods
>[8] base
>
>loaded via a namespace (and not attached):
>[1] compiler_3.4.0 tools_3.4.0
>
>
>Rui Barradas
>
>
>Em 28-05-2017 17:37, Rui Barradas escreveu:
>> Hello,
>>
>> Since function splines::bs returns an object of class bs in order to
>> read the help page for function predict you need
>>
>> ?predict.bs
>>
>> The syntax would be
>>
>> ## S3 method for class 'bs'
>> predict(object, newx, ...)
>>
>> Please read that help page and maybe you'll get the answer you need.
>>
>> Hope this helps,
>>
>> Rui Barradas
>>
>> Em 28-05-2017 15:51, Glenn Schultz escreveu:
>>> If is specify a spline basis as follows
>>>
>>> knots <- c(6, 12, 22, 30, 35)
>>> x <- c(0.0, .25, 1.0, 2.0, 3.0)
>>> SCurve <- bs(x = x, knots = knots, intercept = FALSE, Boundary.knots
>=
>>> c(0,3.5))
>>>
>>> I would like to now get the spline value for new values of x. 
>However,
>>> when I use predict the new basis is returned and I would like to get
>the
>>> value.  Nothing has worked so far and ?predict plus examples only
>show
>>> prediction from linear models.  Is there a way to extract the value
>from
>>> a defined spline?
>>>
>>> Best Regards,
>>> Glenn
>>> __
>>> 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] get the value of a biplane

2017-05-29 Thread Rui Barradas

Hello,

Can anyone explain why this error?

> library(splines)
>
> knots <- c(6, 12, 22, 30, 35)
> x <- c(0.0, .25, 1.0, 2.0, 3.0)
> SCurve <- bs(x = x, knots = knots, intercept = FALSE, Boundary.knots 
= c(0,3.5))

> class(SCurve)
[1] "bs" "basis"  "matrix"
>
> ?predict.bs
> predict.bs(SCurve, xnew = 40:45)
Error in predict.bs(SCurve, xnew = 40:45) :
  could not find function "predict.bs"

Note that splines:::predict.bs(SCurve, xnew = 40:45) works.

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Portugal.1252 
LC_CTYPE=Portuguese_Portugal.1252
[3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C 


[5] LC_TIME=Portuguese_Portugal.1252

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

loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0


Rui Barradas


Em 28-05-2017 17:37, Rui Barradas escreveu:

Hello,

Since function splines::bs returns an object of class bs in order to
read the help page for function predict you need

?predict.bs

The syntax would be

## S3 method for class 'bs'
predict(object, newx, ...)

Please read that help page and maybe you'll get the answer you need.

Hope this helps,

Rui Barradas

Em 28-05-2017 15:51, Glenn Schultz escreveu:

If is specify a spline basis as follows

knots <- c(6, 12, 22, 30, 35)
x <- c(0.0, .25, 1.0, 2.0, 3.0)
SCurve <- bs(x = x, knots = knots, intercept = FALSE, Boundary.knots =
c(0,3.5))

I would like to now get the spline value for new values of x.  However,
when I use predict the new basis is returned and I would like to get the
value.  Nothing has worked so far and ?predict plus examples only show
prediction from linear models.  Is there a way to extract the value from
a defined spline?

Best Regards,
Glenn
__
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] rollapply() produces NAs

2017-05-29 Thread Sepp via R-help
This is the function in plain text because it looked messy before:

VaRfun <- function(x, lambda = 0.94) {

#create data.frame and order returns such that the lates return is the first
  df <- data.frame(weight = c(1:length(x)), return = rev(x))
  K <- nrow(df)
  constant <- (1-lambda)/(1-lambda^(K))
#assign weights to the returns  
  for(i in 1:nrow(df)) {
df$weight[i] <- lambda^(i-1) * constant
}
#order returns in an ascending order
  df <- df[order(df$return),]

#add the cumulative sum of the weights
  df$cum.weight <- cumsum(df$weight)

#calculate value at risk
  VaR <- -tail((df$return[df$cum.weight <= .05]), 1)
  signif(VaR, digits = 3)
}

It works for a single vector of returns but if I try to use it with 
rollapply(), such as

rollapply(r, width = list(-500, -1), FUN = VaRfun),

it outputs a vector of NAs and I don't know why.


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