Re: [R] Fitting Mixture distributions

2016-09-13 Thread Aanchal Sharma
Yes, I mentioned it wrong , I increased the value. This did not help
either. what helped is removing some samples which had zero (close to zero)
values. So its working fine for this error.

But there is another problem.
For one of the genes it says throws following error:

iteration = 1  log-lik diff = NaN  log-lik = NaN
Error in while (diff > epsilon && iter < maxit) { :
  missing value where TRUE/FALSE needed

Seems like EM is not able to calculate log-lik value (NaN) at the first
iteration itself. any idea why that can happen?
It works fine for the other genes in the loop. Tried looking for difference
in the inputs, but could not come up with anything striking.
Thanks for consistent inputs.

On Mon, Sep 12, 2016 at 8:18 PM, Bert Gunter  wrote:

> Do you mean "increase the convergence value." Decreasing it should
> make it harder to converge (I believe, depending on exactly how
> "convergence vaue" is defined,  so doublecheck.)
>
> -- 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, Sep 12, 2016 at 4:40 PM, Aanchal Sharma
>  wrote:
> > Thanks for the reply.
> >
> > I have another related issue with Gamma mixture model. here is the
> > description:
> >
> > I am trying to fit a 2 component gamma mixture model to my data (residual
> > values obtained after running Generalized Linear Model), using following
> > command (part of the code):
> >
> >  expr_mix_gamma <- gammamixEM(expr_glm_residuals, lambda = c(0.75,0.25),
> k =
> > 2, epsilon = 1e-08, maxit = 1000, maxrestarts=20, verb = TRUE)
> >
> > The code runs for multiple gene files (in loop). it runs fine for some
> files
> > whereas for others it throws following error:
> >
> > Error in gammamixEM(expr_glm_residuals, lambda = c(0.75, 0.25), k =
> 2,
> > : Try different number of components?
> >
> > I tried increasing iterations and decreasing the convergence value, but
> that
> > doesn't seem to work. Is there anything else that I can try?
> > Thanks
> >
> >
> > On Thu, Sep 8, 2016 at 8:38 AM, Martin Maechler <
> maech...@stat.math.ethz.ch>
> > wrote:
> >>
> >> > Bert Gunter 
> >> > on Wed, 7 Sep 2016 23:47:40 -0700 writes:
> >>
> >> > "please suggest what can I do to resolve this
> >> > issue."
> >>
> >> > Fitting normal mixtures can be difficult, and sometime the
> >> > optimization algorithm (EM) will get stuck with very slow
> >> convergence.
> >> > Presumably there are options in the package to either increase the
> >> max
> >> > number of steps before giving up or make the convergence criteria
> >> less
> >> > sensitive. The former will increase the run time and the latter
> will
> >> > reduce the optimality (possibly leaving you farther from the true
> >> > optimum). So you should look into changing these as you think
> >> > appropriate.
> >>
> >> I'm jumping in late, without having read everything preceding.
> >>
> >> One of the last messages seemed to indicate that you are looking
> >> at mixtures of *one*-dimensional gaussians.
> >>
> >> If this is the case, I strongly recommend looking at (my) CRAN
> >> package 'nor1mix' (the "1" is for "*one*-dimensional).
> >>
> >> For a while now that small package is providing an alternative
> >> to the EM, namely direct MLE, simply using optim() where the
> >> likelihood uses a somewhat smart parametrization.
> >>
> >> Of course, *as the EM*, this also depends on the starting value,
> >> but my (limited) experience has been that
> >>   nor1mix::norMixMLE()
> >> works considerably faster and more reliable than the EM (which I
> >> also provide asnor1mix::norMixEM() .
> >>
> >> Apropos 'starting value': The help page shows how to use
> >> kmeans() for "somewhat" reliable starts; alternatively, I'd
> >> recommend using cluster::pam() to get a start there.
> >>
> >> I'm glad to hear about experiences using these / comparing
> >> these with other approaches.
> >>
> >> Martin
> >>
> >>
> >> --
> >> Martin Maechler,
> >> ETH Zurich
> >>
> >>
> >> > On Wed, Sep 7, 2016 at 3:51 PM, Aanchal Sharma
> >> >  wrote:
> >> >> Hi Simon
> >> >>
> >> >> I am facing same problem as described above. i am trying to fit
> >> gaussian
> >> >> mixture model to my data using normalmixEM. I am running a
> Rscript
> >> which
> >> >> has this function running as part of it for about 17000 datasets
> >> (in loop).
> >> >> The script runs fine for some datasets, but it terminates when it
> >> >> encounters one dataset with the following error:
> >> >>
> >> >> Error in normalmixEM(expr_glm_residuals, lambda = c(0.75,
> 0.25), k
> >> = 2,  :
> >> >> Too many tries!
> >> >>
> >> >> (command used: expr_mix_gau <- normalmixEM(expr_glm_residuals,
> >> lambda =
> >>

Re: [R] Minimum Binding Box in 3D

2016-09-13 Thread David Winsemius

> On Sep 13, 2016, at 7:20 AM, Lorenzo Isella  wrote:
> 
> Dear All,
> I would like to know if anybody is aware of an R implementation of a
> minimal bounding box ( http://bit.ly/2cKaSgT ) algorithm in R for
> points in 3 dimensions.
> It looks like there is no shortage of implementations in 2 dimensions,
> e.g.
> 
> http://bit.ly/2cKaSh0
> http://bit.ly/2cKboLS
> 
> but I cannot find any implementation for the 3D case.

There should be no difficulty finding functions that derive a convex hull in 
three dimensions and the first answer to the first link above (on 
StackOverflow) describes an algorithm that lets you go from a polyhedron to a 
bounding box. 


> Many thanks
> 
> Lorenzo
> 
> __
> 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] Maximum # of DLLs reached, or, how to clean up after yourself?

2016-09-13 Thread Henrik Bengtsson
In R.utils (>= 2.4.0), which I hope to submitted to CRAN today or
tomorrow, you can simply call:

   R.utils::gcDLLs()

It will look at base::getLoadedDLLs() and its content and compare to
loadedNamespaces() and unregister any "stray" DLLs that remain after
corresponding packages have been unloaded.

Until the new version is on CRAN, you can install it via

source("http://callr.org/install#HenrikBengtsson/R.utils@develop;)

or alternatively just source() the source file:


source("https://raw.githubusercontent.com/HenrikBengtsson/R.utils/develop/R/gcDLLs.R;)


DISCUSSION:
(this might be better suited for R-devel; feel free to move it there)

As far as I understand the problem, running into this error / limit is
_not_ the fault of the user.  Instead, I'd argue that it is the
responsibility of package developers to make sure to unregister any
registered DLLs of theirs when the package is unloaded.  A developer
can do this by adding the following to their package:

.onUnload <- function(libpath) {
library.dynam.unload(utils::packageName(), libpath)
 }

That should be all - then the DLL will be unloaded as soon as the
package is unloaded.

I would like to suggest that 'R CMD check' would include a check that
asserts when a package is unloaded it does not leave any registered
DLLs behind, e.g.

* checking whether the namespace can be unloaded cleanly ... WARNING
  Unloading the namespace does not unload DLL
* checking loading without being on the library search path ... OK

For further details on my thoughts on this, see
https://github.com/HenrikBengtsson/Wishlist-for-R/issues/29.

Hope this helps

Henrik

On Tue, Sep 13, 2016 at 6:05 AM, Alexander Shenkin  wrote:
> Hello all,
>
> I have a number of analyses that call bunches of sub-scripts, and in the
> end, I get the "maximal number of DLLs reached" error.  This has been asked
> before (e.g.
> http://stackoverflow.com/questions/36974206/r-maximal-number-of-dlls-reached),
> and the general answer is, "just clean up after yourself".
>
> Assuming there are no plans to raise this 100-DLL limit in the near future,
> my question becomes, what is best practice for cleaning up (detaching)
> loaded packages in scripts, when those scripts are sometimes called from
> other scripts?  One can detach all packages at the end of a script that were
> loaded at the beginning of the script.  However, if a package is required in
> a calling script, one should really make sure it hadn't been loaded prior to
> sub-script invocation before detaching it.
>
> I could write a custom function that pushes and pops package names from a
> global list, in order to keep track, but maybe there's a better way out
> there...
>
> Thanks for any thoughts.
>
> Allie
>
> __
> 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] Drill down reports in R

2016-09-13 Thread Greg Snow
As has been mentioned, this really requires a GUI tool beyond just R.
Luckily there are many GUI tools that have been linked to R and if
Shiny (the shiniest of them) does not have something like this easily
available so far then you may want to look elsewhere in the meantime.

One option is the tcltk package which interfaces with the Tk GUI tools
(and the tcl language) which does have the pieces to build in the
expandable/drill down interface.  One implementation of this is the
TkListView function in the TeachingDemos package which can be used to
view list objects in this manner (it starts with the top level list
objects, then when you click on a + symbol it will open that piece and
show one level down).

One possibility would be to create all of your results in a list, then
view it with TkListView  (this will require all computations up front,
whether anyone looks at them or not).

Another option would be to start with TkListView and rewrite it to do
things more dynamically and with the output that you want to show.

There is also the shinyTree package on CRAN that allows a tree type
object in shiny that may do what you want (I don't know what all
options it allows and what it can display beyond what is in the
Readme).



On Tue, Sep 13, 2016 at 4:46 AM, Manohar Reddy  wrote:
> Hi,
>
>
>
>   How to generate “Drill down reports ”  (like please refer below url) in R
> using any package ? I did lot of research in google but I didn’t found
> suitable link .
>
>  Can anyone help how to do that in R ?
>
>
>
> url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/
>
>
>
> Thanks in Advance !
>
> Manu.
>
> [[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.



-- 
Gregory (Greg) L. Snow Ph.D.
538...@gmail.com

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

Re: [R] Drill down reports in R

2016-09-13 Thread Marc Schwartz

> On Sep 13, 2016, at 11:11 AM, Manohar Reddy  wrote:
> 
> Hi Jhon,
> 
>  
>  Thanks for responding my email ,actually my requirement is I have Orders and 
> related tables and now I need to generate a report something looks like below 
> whenever user click on “+” that report will be expanded .I know it is 
> possible in SSRS (SQl Server Reporting Services) but now my requirement is I 
> need to generate that kind of report in R.
> 
>  
>  If we look at screen shot (or PFA) almost 100244 order exists  8 times ,now 
> I want to generate the report whenever user clicks on order 100244 and it 
> needs to be expand and need to display the cost of all the products and what 
> are the products they were purchased on this orderID .
> 
>  
> Note: in backend I did using Group by (sql) but I don’t know how to present 
> in this report.
> 
>  
> 
> 
>  
> Hi Marc,
> 
>  
>Thanks,Currently I’m creating reports  using shinyapps only ,I have 
> checked out throghly with shinyapps but I didn’t find any solution,is there 
> any alternative way that I can use to genarate the drill down report.
> 
>  
>  Manu.
> 

Hi Manu,

As noted, the type of functionality that you are looking for would typically 
require a GUI that supports dynamic interactions and updating. That is why 
there are dedicated reporting tools, as I noted, that have evolved over the 
years, to serve that need in the typical business domains where it is used. 

Most of those tools typically interface with a live server database backend 
(e.g. Oracle, MySQL, etc.), a local database or spreadsheet file (e.g. MS 
Access or Excel via ODBC) or an intermediate "OLAP cube" construct, as the 
primary data repository to which dynamic queries are sent based upon user 
inputs from the GUI.

If Shiny does not have that in place already and you wanted to use Shiny, you 
would need to develop it on your own or have likely have to pay someone do it 
for you.

I am not aware of other possible R related GUIs that support that type of 
interaction, albeit, it is possible that somebody has done something that is 
not yet well publicized or may be for internal use only. 

There are a variety of supporting technologies (e.g. AJAX, Java, etc.) that 
could provide for that type of functionality, either stand alone or within a 
browser based environment, but it would not be "pure R" per se.

It may also be possible that one of the other commercial R vendors (e.g. 
Microsoft) have built something on top of a server version of R and you would 
need to contact them to see if that is the case.

Regards,

Marc

> 
> On Tue, Sep 13, 2016 at 8:33 PM, Marc Schwartz  > wrote:
> Hi,
> 
> Generally "drilldown" reports require a dynamic GUI that supports widgets 
> that generate the data queries behind the scenes in response to user 
> input/clicks and then updated the display dynamically with the additional 
> data/content.
> 
> This would be more typical of business oriented reporting/OLAP tools like 
> Cognos, Business Objects, Crystal Reports, etc.
> 
> The first thing that came to mind is RStudio's Shiny, which I do not use, but 
> their gallery seems to have some possibilities:
> 
>   http://shiny.rstudio.com/gallery/ 
> 
> Regards,
> 
> Marc Schwartz
> 
> 
> > On Sep 13, 2016, at 9:48 AM, John Kane  > > wrote:
> >
> > It is not really clear what you want but have a look at ?subset perhaps.
> >
> > John Kane
> > Kingston ON Canada
> >
> >
> >> -Original Message-
> >> From: manu.redd...@gmail.com 
> >> Sent: Tue, 13 Sep 2016 16:16:05 +0530
> >> To: r-help@r-project.org 
> >> Subject: [R] Drill down reports in R
> >>
> >> Hi,
> >>
> >>
> >>
> >>  How to generate “Drill down reports ”  (like please refer below url) in
> >> R
> >> using any package ? I did lot of research in google but I didn’t found
> >> suitable link .
> >>
> >> Can anyone help how to do that in R ?
> >>
> >>
> >>
> >> url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/ 
> >> 
> >>
> >>
> >>
> >> Thanks in Advance !
> >>
> >> Manu.
> 
> 
> 
> 
> -- 
> 
> 
> Thanks,
> Manohar Reddy P
> +91-9705302062.
> 


[[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] Drill down reports in R

2016-09-13 Thread Mark Sharp
Manu,

With pure R, you can simply write a link in the parent document to a child 
document you have created. Alternative, and likely better, solutions could be 
based on AJAX, but I do not think you are going to do that all within R.

Mark
> On Sep 13, 2016, at 11:11 AM, Manohar Reddy  wrote:
>
> Hi Jhon,
>
>
>
> Thanks for responding my email ,actually my requirement is I have Orders
> and related tables and now I need to generate a report something looks like
> below whenever user click on “+” that report will be expanded .I know it is
> possible in SSRS (SQl Server Reporting Services) but now my requirement is
> I need to generate that kind of report in R.
>
>
>
> If we look at screen shot (or PFA) almost 100244 order exists  8 times
> ,now I want to generate the report whenever user clicks on order 100244 and
> it needs to be expand and need to display the cost of all the products and
> what are the products they were purchased on this orderID .
>
>
>
> Note: in backend I did using Group by (sql) but I don’t know how to present
> in this report.
>
>
>
>
>
> Hi Marc,
>
>
>
>   Thanks,Currently I’m creating reports  using shinyapps only ,I have
> checked out throghly with shinyapps but I didn’t find any solution,is there
> any alternative way that I can use to genarate the drill down report.
>
>
>
> Manu.
>
> On Tue, Sep 13, 2016 at 8:33 PM, Marc Schwartz  wrote:
>
>> Hi,
>>
>> Generally "drilldown" reports require a dynamic GUI that supports widgets
>> that generate the data queries behind the scenes in response to user
>> input/clicks and then updated the display dynamically with the additional
>> data/content.
>>
>> This would be more typical of business oriented reporting/OLAP tools like
>> Cognos, Business Objects, Crystal Reports, etc.
>>
>> The first thing that came to mind is RStudio's Shiny, which I do not use,
>> but their gallery seems to have some possibilities:
>>
>>  http://shiny.rstudio.com/gallery/
>>
>> Regards,
>>
>> Marc Schwartz
>>
>>
>>> On Sep 13, 2016, at 9:48 AM, John Kane  wrote:
>>>
>>> It is not really clear what you want but have a look at ?subset perhaps.
>>>
>>> John Kane
>>> Kingston ON Canada
>>>
>>>
 -Original Message-
 From: manu.redd...@gmail.com
 Sent: Tue, 13 Sep 2016 16:16:05 +0530
 To: r-help@r-project.org
 Subject: [R] Drill down reports in R

 Hi,



 How to generate “Drill down reports ”  (like please refer below url) in
 R
 using any package ? I did lot of research in google but I didn’t found
 suitable link .

 Can anyone help how to do that in R ?



 url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/



 Thanks in Advance !

 Manu.
>>
>>
>
>
> --
>
>
> Thanks,
> Manohar Reddy P
> +91-9705302062.
> __
> 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.

CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments 
transmitted, may contain privileged and confidential information and is 
intended solely for the exclusive use of the individual or entity to whom it is 
addressed. If you are not the intended recipient, you are hereby notified that 
any review, dissemination, distribution or copying of this e-mail and/or 
attachments is strictly prohibited. If you have received this e-mail in error, 
please immediately notify the sender stating that this transmission was 
misdirected; return the e-mail to sender; destroy all paper copies and delete 
all electronic copies from your system without disclosing its contents.
__
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] Drill down reports in R

2016-09-13 Thread Manohar Reddy
Hi Jhon,



 Thanks for responding my email ,actually my requirement is I have Orders
and related tables and now I need to generate a report something looks like
below whenever user click on “+” that report will be expanded .I know it is
possible in SSRS (SQl Server Reporting Services) but now my requirement is
I need to generate that kind of report in R.



 If we look at screen shot (or PFA) almost 100244 order exists  8 times
,now I want to generate the report whenever user clicks on order 100244 and
it needs to be expand and need to display the cost of all the products and
what are the products they were purchased on this orderID .



Note: in backend I did using Group by (sql) but I don’t know how to present
in this report.





Hi Marc,



   Thanks,Currently I’m creating reports  using shinyapps only ,I have
checked out throghly with shinyapps but I didn’t find any solution,is there
any alternative way that I can use to genarate the drill down report.



 Manu.

On Tue, Sep 13, 2016 at 8:33 PM, Marc Schwartz  wrote:

> Hi,
>
> Generally "drilldown" reports require a dynamic GUI that supports widgets
> that generate the data queries behind the scenes in response to user
> input/clicks and then updated the display dynamically with the additional
> data/content.
>
> This would be more typical of business oriented reporting/OLAP tools like
> Cognos, Business Objects, Crystal Reports, etc.
>
> The first thing that came to mind is RStudio's Shiny, which I do not use,
> but their gallery seems to have some possibilities:
>
>   http://shiny.rstudio.com/gallery/
>
> Regards,
>
> Marc Schwartz
>
>
> > On Sep 13, 2016, at 9:48 AM, John Kane  wrote:
> >
> > It is not really clear what you want but have a look at ?subset perhaps.
> >
> > John Kane
> > Kingston ON Canada
> >
> >
> >> -Original Message-
> >> From: manu.redd...@gmail.com
> >> Sent: Tue, 13 Sep 2016 16:16:05 +0530
> >> To: r-help@r-project.org
> >> Subject: [R] Drill down reports in R
> >>
> >> Hi,
> >>
> >>
> >>
> >>  How to generate “Drill down reports ”  (like please refer below url) in
> >> R
> >> using any package ? I did lot of research in google but I didn’t found
> >> suitable link .
> >>
> >> Can anyone help how to do that in R ?
> >>
> >>
> >>
> >> url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/
> >>
> >>
> >>
> >> Thanks in Advance !
> >>
> >> Manu.
>
>


-- 


Thanks,
Manohar Reddy P
+91-9705302062.
__
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] Error with permutest on dbrda object in vegan

2016-09-13 Thread Cleo Tebby
Dear all,

I am using distance-based RDA in vegan 2.4-1 with direct decomposition
(no constant added, imaginary axes included) and trying to test axis
significance. Permutations seem to work with first=FALSE, but not
first=TRUE. The error message is "invalid comparison with complex
values".

Here is my code:

library(vegan)
data(pyrifos)
ditch <- gl(12, 1, length=132)
week <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24))
dose <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11))
res_rda_pyrifos_inv_BC<-dbrda(pyrifos~interaction(week,dose) +
Condition(week), distance = "bray")
ctrl_pyrifos <- how(plots = Plots(strata = ditch,type = "free"),
within = Within(type = "series"), nperm = 99)
permutest(res_rda_pyrifos_inv_BC,  permutations=ctrl_pyrifos, first=TRUE)

I get this message:

"Permutation test for dbrda

Plots: ditch, plot permutation: free
Permutation: series
Number of permutations: 

Call: dbrda(formula = pyrifos_inv_raw ~ interaction(week, dose) +
Condition(week), distance = "bray")
Error in x$F.perm >= x$F.0 - EPS : invalid comparison with complex values"

Any help would be appreciated!
Thanks,
Cleo Tebby

__
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] Minimum Binding Box in 3D

2016-09-13 Thread Lorenzo Isella

Dear All,
I would like to know if anybody is aware of an R implementation of a
minimal bounding box ( http://bit.ly/2cKaSgT ) algorithm in R for
points in 3 dimensions.
It looks like there is no shortage of implementations in 2 dimensions,
e.g.

http://bit.ly/2cKaSh0
http://bit.ly/2cKboLS

but I cannot find any implementation for the 3D case.
Many thanks

Lorenzo

__
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] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-13 Thread Jeff Newmiller
For this query I would rather recommend [1] as reference, though Marc's 
suggestion to switch mailing lists is best.

[1] https://cran.r-project.org/bin/linux/ubuntu/
-- 
Sent from my phone. Please excuse my brevity.

On September 13, 2016 6:44:29 AM PDT, Loris Bennett 
 wrote:
>Luigi Marongiu  writes:
>
>> Dear all,
>> I am working on Linux Ubuntu 16.04 and I have installed R 3.2. I need
>> to upgrade to R 3.3 and I tried several options available online with
>> no success. I downloaded the tar.gz file for R 3.3 and I would like
>to
>> ask how can I use this file in order to accomplish the upgrade.
>> Many thanks,
>> Luigi
>>
>
>Have you looked here:
>
>https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-R-under-Unix_002dalikes
>
>?
>
>Cheers,
>
>Loris
>
>-- 
>Dr. Loris Bennett (Mr.)
>ZEDAT, Freie Universität Berlin Email
>loris.benn...@fu-berlin.de
>
>__
>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] syntax to connect to linked SQL server using RODBC

2016-09-13 Thread Manohar Reddy
Hi Varun,

  Basically when we are pulling data from linked server through SSMS/some
other client tools we may need to use query like this format
* linkedservername.databasename.schemaname.tablename* and in this case your
query like this,

table1 <- as.data.table(sqlQuery(dbhandle, 'select * from
linkedservername.databasename.schemaname.tablename'))

Manu.

On Tue, Sep 13, 2016 at 8:29 PM, Jeff Newmiller 
wrote:

> This is not an R concept, and it may be highly specific to the SQL Server
> API rather than the ODBC API. You might try doing as the Posting Guide
> recommends and posting in the R-sig-db mailing list. I would also recommend
> that you figure out from Microsoft documentation what programming API your
> GUI software example is using to accomplish this rather than referring to
> that GUI program in your question.
> --
> Sent from my phone. Please excuse my brevity.
>
> On September 13, 2016 7:02:20 AM PDT, Varun Sinha <
> sinha.varun...@gmail.com> wrote:
> >Hi All,
> >
> >I would like to know how to connect to a "linked server" from R. I find
> >the
> >linked server under Server Objects > Linked Servers on SQL management
> >studio.
> >
> >Here is the current way I am using to connect to the server:
> >
> >dbhandle <- odbcDriverConnect('driver={SQL
> >Server};server=servername;database=databasename;trusted_connection=true')
> >
> >table1 <- as.data.table(sqlQuery(dbhandle, 'select a, b from table1'))
> >
> >Could you please let me know the syntax to do the same but with the
> >linked
> >server instead? I would like to connect to a database on the linked
> >server
> >and run the query to pull data.
> >
> >Thank you for your help.
> >
> >Best regards,
> >Varun
> >
> >   [[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.
>



-- 


Thanks,
Manohar Reddy P
+91-9705302062.

[[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] syntax to connect to linked SQL server using RODBC

2016-09-13 Thread Jeff Newmiller
This is not an R concept, and it may be highly specific to the SQL Server API 
rather than the ODBC API. You might try doing as the Posting Guide recommends 
and posting in the R-sig-db mailing list. I would also recommend that you 
figure out from Microsoft documentation what programming API your GUI software 
example is using to accomplish this rather than referring to that GUI program 
in your question.
-- 
Sent from my phone. Please excuse my brevity.

On September 13, 2016 7:02:20 AM PDT, Varun Sinha  
wrote:
>Hi All,
>
>I would like to know how to connect to a "linked server" from R. I find
>the
>linked server under Server Objects > Linked Servers on SQL management
>studio.
>
>Here is the current way I am using to connect to the server:
>
>dbhandle <- odbcDriverConnect('driver={SQL
>Server};server=servername;database=databasename;trusted_connection=true')
>
>table1 <- as.data.table(sqlQuery(dbhandle, 'select a, b from table1'))
>
>Could you please let me know the syntax to do the same but with the
>linked
>server instead? I would like to connect to a database on the linked
>server
>and run the query to pull data.
>
>Thank you for your help.
>
>Best regards,
>Varun
>
>   [[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] Drill down reports in R

2016-09-13 Thread Marc Schwartz
Hi,

Generally "drilldown" reports require a dynamic GUI that supports widgets that 
generate the data queries behind the scenes in response to user input/clicks 
and then updated the display dynamically with the additional data/content.

This would be more typical of business oriented reporting/OLAP tools like 
Cognos, Business Objects, Crystal Reports, etc.

The first thing that came to mind is RStudio's Shiny, which I do not use, but 
their gallery seems to have some possibilities:

  http://shiny.rstudio.com/gallery/

Regards,

Marc Schwartz


> On Sep 13, 2016, at 9:48 AM, John Kane  wrote:
> 
> It is not really clear what you want but have a look at ?subset perhaps.
> 
> John Kane
> Kingston ON Canada
> 
> 
>> -Original Message-
>> From: manu.redd...@gmail.com
>> Sent: Tue, 13 Sep 2016 16:16:05 +0530
>> To: r-help@r-project.org
>> Subject: [R] Drill down reports in R
>> 
>> Hi,
>> 
>> 
>> 
>>  How to generate “Drill down reports ”  (like please refer below url) in
>> R
>> using any package ? I did lot of research in google but I didn’t found
>> suitable link .
>> 
>> Can anyone help how to do that in R ?
>> 
>> 
>> 
>> url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/
>> 
>> 
>> 
>> Thanks in Advance !
>> 
>> Manu.

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

Re: [R] How to read a grib2 file

2016-09-13 Thread Debasish Pai Mazumder
Hi Mike,
Thanks again. I am using Mac OS

Here is the required info

> sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

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

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

other attached packages:
[1] rNOMADS_2.3.0 rvest_0.3.2   xml2_1.0.0rgdal_1.1-10  raster_2.5-8
sp_1.2-3

loaded via a namespace (and not attached):
[1] httr_1.1.0  magrittr_1.5R6_2.1.2rsconnect_0.4.3
tools_3.2.4
[6] Rcpp_0.12.4 grid_3.2.4  lattice_0.20-33

I am trying to read " tmax.01.2011040100.daily.grb2" from
http://nomads.ncdc.noaa.gov/modeldata/cfsv2_forecast_ts_9mon/2011/201104/20110401/2011040100/

with regards
-Deb


On Tue, Sep 13, 2016 at 5:26 AM, Michael Sumner  wrote:

> What is your computer system? What is the output of this?
>
> sessionInfo()
>
> If you point to a file I'll try it so I can tell you the minimum system
> requirements.
>
> Cheers, Mike
>
> On Tue, 13 Sep 2016, 08:56 Debasish Pai Mazumder 
> wrote:
>
>> Thanks for your suggestion. I have checked and I don't have JPEG2000 in
>> ggdalDrivers()). I am pretty new in R. I don't understand how to do I
>> implement JPEG2000 (JP2OpenJPEG driver) in gdalDrivers() so that I can
>> read grib2 files
>>
>> with regards
>> -Deb
>>
>> On Sat, Sep 10, 2016 at 2:33 AM, Michael Sumner 
>> wrote:
>>
>>>
>>>
>>> On Sat, 10 Sep 2016 at 07:12 Debasish Pai Mazumder 
>>> wrote:
>>>
 Hi
 I am trying to read a grib2 file in R.

 Here is my script

 library(rgdal)
 library(sp)
 library(rNOMADS)
 gribfile<-"tmax.01.2011040100.daily.grb2"
 grib <- readGDAL(gribfile)

 I am getting following error :

 dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.
 Is the JPEG2000 driver available?tmax.01.2011040100.daily.grb2 has GDAL
 driver GRIB
 and has 190 rows and 384 columns
 dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.
 Is the JPEG2000 driver available?dec_jpeg2000: Unable to open JPEG2000
 image within GRIB file.


>>> Hi there, please check if JPEG2000 is in the gdalDrivers() list, i.e.
>>>  in
>>>
>>> rgdal::gdalDrivers()$name
>>>
>>> You are looking for one starting with "JP2" as per the list next to the
>>> "JPEG2000" rows here:
>>>
>>> http://gdal.org/formats_list.html
>>>
>>> I have  JP2OpenJPEG on one system, but not (for example) on the Windows
>>> CRAN binary for rgdal, which is the only readily available Windows build
>>> for this package.
>>>
>>> I you don't have it, you might try on a system that has the JP2OpenJPEG 
>>> driver,
>>> or ask someone to try on your behalf. You'd want to find out if that will
>>> enable this read for you before investing time in the Linux configuration.
>>>
>>> It's not too hard to set up a Linux system for this, but does assume a
>>> bit of experience on your part. Some of the docker images in the
>>> rockerverse have this all sorted I believe, but it's been a while since I
>>> used them.
>>>
>>> https://hub.docker.com/u/rocker/
>>>
>>> Cheers, Mike.
>>>
>>>
>>>
>>>
 Cheers
 -Deb

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

>>> --
>>> Dr. Michael Sumner
>>> Software and Database Engineer
>>> Australian Antarctic Division
>>> 203 Channel Highway
>>> Kingston Tasmania 7050 Australia
>>>
>>>
>> --
> Dr. Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> 203 Channel Highway
> Kingston Tasmania 7050 Australia
>
>

[[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] Drill down reports in R

2016-09-13 Thread John Kane
It is not really clear what you want but have a look at ?subset perhaps.

John Kane
Kingston ON Canada


> -Original Message-
> From: manu.redd...@gmail.com
> Sent: Tue, 13 Sep 2016 16:16:05 +0530
> To: r-help@r-project.org
> Subject: [R] Drill down reports in R
> 
> Hi,
> 
> 
> 
>   How to generate “Drill down reports ”  (like please refer below url) in
> R
> using any package ? I did lot of research in google but I didn’t found
> suitable link .
> 
>  Can anyone help how to do that in R ?
> 
> 
> 
> url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/
> 
> 
> 
> Thanks in Advance !
> 
> Manu.
> 
>   [[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.


Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.

__
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] Is this kind of removing of elements from data.frame (in)efficient?

2016-09-13 Thread Jeff Newmiller
Your example is not reproducible [1], so the apparent error in it is 
distracting... perhaps you meant

kidmomhs <- kidmomhs[kidmomhs$kid_score != min(kidmomhs$kid_score),]

yes, this creates a copy, and because the object name is re-used on the left 
side the original memory gets returned to the memory pool the next time garbage 
collection occurs. 

While this may seem inefficient, this (functional) programming model is much 
less likely to lead to programming errors than in-place approaches. My advice 
is to refrain from premature optimization and get the algorithm right, then 
later you could rewrite using something like the data.table package if the 
standard functional model is too slow for a particular application.

In addition, I tend to find that not re-using the object name (not releasing 
the memory) aids debugging and traceability, which if you are looking to make 
reproducible research is often an advantage.

[1] see e.g. http://adv-r.had.co.nz/Reproducibility.html
-- 
Sent from my phone. Please excuse my brevity.

On September 13, 2016 12:37:18 AM PDT, mviljamaa  wrote:
>So I'm a beginner in R and I was testing the removal of elements from a
>
>data.frame.
>
>The way I remove the element(s) with the minimum value in kid_score 
>variable is to do:
>
>kidmomhs <- data[kidmomhs$kid_score != min(kidmomhs$kid_score),]
>
>So now kidmomhs is the same data, but without the row(s) with the 
>minimum value of kid_score.
>
>Judging by the syntax this looks as if R might be creating a copy of
>the 
>data array, just without the rows that were removed.
>
>The question however is, is this the most efficient way to remove 
>elements from data structures in R? And is the above inefficient? Does 
>the above create copies of almost the entire data structure?
>
>In other programming languages I've become accustomed to doing removal 
>of elements by changing them to NULL and then e.g. reordering the data 
>structure. Rather than having to take copies of almost the entire data 
>structure.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

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


[R-es] t-test y distribución de variables

2016-09-13 Thread JM Arbones

Hola,
Estoy analizando unos datos para una tesis doctoral.
Durante la investigación se han recogido distintas variables clínicas de 
dos grupos (n=30 y n=40). Me encuentro que las comparaciones de medias 
se han realizado mediante t-tests sin preocuparse de estudiar la 
distribución de las variables.  Al revisar si las variables se ajustan a 
la distribución normal, aunque los QQplots no tienen "mala pinta" las 
distribuciones de las variables se alejan de la normalidad 
(Shapiro-Wilks<0.01).
Aunque se podrían utilizar otros métodos (no parametricos, 
permutaciones, etc) para realizar las comparaciones, el doctorando se 
empeña en utilizar las pruebas t (imagino que por no rehacer todos los 
resultados).



Entiendo que el t-test es una prueba bastante robusta y puede tolerar 
desviaciones de la normalidad, también entiendo que el criterio para 
poder aplicar esta prueba es que la distribución de las medias (no de 
las variables) sea normal. Se me ha ocurrido que si  remuestreo (siendo 
d la variable de estudio)


 for (n in 1:500){
  i[n]=mean(sample(d,20))}

y justifico que la distribución de las medias sigue una distribución normal

shapiro.test(i)

podría decir que las pruebas t (utilizando la correccion de Welch por si 
acaso) se hacen "con todas las de la ley".


Me gustaria que los que sabeis de esto me dierais vuestra opinion con 
respecto a este apaño.


Un saludo y muchas gracias

Jose Miguel

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


Re: [R] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-13 Thread Tom D. Harray
Hello Luisfo,

thank you for the hint: Your suggestion

   arules::subset(rules, subset=lhs %pin% "")

gave 18 rules (out of 21) in my example, and not 3, what I have expected.

Surprisingly the negation of the subset condition

   arules::subset(x = rules, subset = !(lhs %pin% ""))

returns the 3 rules with empty lhs.


Hello Martin,

I add you to this thread, because the arules::subset() behaviour
appears to me to be a bug in arules. And I'd like to suggest to add an
explanation/example to arules::subset() help.


Cheers,

Dirk

On 13 September 2016 at 05:10, Luisfo  wrote:
> Dear Tom,
>
> I think this is the line you need
>   arules::subset(rules, subset=lhs %pin% "")
> I found the solution here:
> http://stackoverflow.com/questions/27926131/how-to-get-items-for-both-lhs-and-rhs-for-only-specific-columns-in-arules
>
> One more thing. For printing the rules, I needed the inspect() command you
> didn't provide.
>
> I hope this helps.
>
> Best,
>
> Luisfo Chiroque
> PhD Student | PhD Candidate
> IMDEA Networks Institute
> http://fourier.networks.imdea.org/people/~luis_nunez/
>
> On 09/12/2016 04:39 PM, Tom D. Harray wrote:
>
> Hello,
>
> subsets of association rules (with respect to support, confidence, lift, or
> items) can be obtained with the arules::subset() function; e.g.
>
>   rm(list = ls(all.names = TRUE))
>   library(arules)
>   set.seed(42)
>
>   x <- lapply(X = 1:500, FUN = function(i)
> sample(x = 1:10, size = sample(1:5, 1), replace = FALSE)
>   )
>   x <- as(x, 'transactions')
>
>   rules <- apriori(
> data = x,
> parameter = list(target = 'rules', minlen = 1, maxlen = 2,
>   support = 0.10, confidence = 0.32)
>   )
>   rules <- arules::sort(x = rules, decreasing = TRUE, by ='support')
>
> gives the rules
> 3  {}  => {1} 0.330   0.330  1.000
> 2  {}  => {3} 0.326   0.326  1.000
> 1  {}  => {2} 0.320   0.320  1.000
> 20 {3} => {1} 0.120   0.3680982  1.1154490
> 21 {1} => {3} 0.120   0.3636364  1.1154490
> 16 {4} => {3} 0.114   0.3677419  1.1280427
> (...)
>
> However, I cannot figure out (help/web) how to get the subset for the rules
> with empty left hand side (lhs) like subset(rules, lhs == ''). I  could run
> the
> apriori() function twice and adjust the min/maxlen parameters as a band
> aid fix.
>
>
> So my question is: How do I subset() association rules with empty lhs?
>
>
> Thanks and regards,
>
> Dirk
>
> __
> 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] More tube-like lines3D?

2016-09-13 Thread Atte Tenkanen

Thanks, time is no problem!

Atte

13.9.2016, 15.12, Duncan Murdoch kirjoitti:

On 13/09/2016 5:58 AM, Atte Tenkanen wrote:

Hi,

Is it possible to give 3d-like form for rgl lines3d-lines? Although I
increase lwd, lines still look like lines, not like tubes.

cylinder3d() should do that.  It puts a substantially larger burden on 
the graphics system, so if you draw too many of them, things will slow 
down noticeably.


Duncan Murdoch



--
Atte Tenkanen, FT MuM
Turun Martinseurakunnan kanttori
p. 040-3417125

__
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] syntax to connect to linked SQL server using RODBC

2016-09-13 Thread Varun Sinha
Hi All,

I would like to know how to connect to a "linked server" from R. I find the
linked server under Server Objects > Linked Servers on SQL management
studio.

Here is the current way I am using to connect to the server:

dbhandle <- odbcDriverConnect('driver={SQL
Server};server=servername;database=databasename;trusted_connection=true')

table1 <- as.data.table(sqlQuery(dbhandle, 'select a, b from table1'))

Could you please let me know the syntax to do the same but with the linked
server instead? I would like to connect to a database on the linked server
and run the query to pull data.

Thank you for your help.

Best regards,
Varun

[[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] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-13 Thread Marc Schwartz

> On Sep 13, 2016, at 8:00 AM, Luigi Marongiu  wrote:
> 
> Dear all,
> I am working on Linux Ubuntu 16.04 and I have installed R 3.2. I need
> to upgrade to R 3.3 and I tried several options available online with
> no success. I downloaded the tar.gz file for R 3.3 and I would like to
> ask how can I use this file in order to accomplish the upgrade.
> Many thanks,
> Luigi


There is a dedicated e-mail list for R on Debian and derivatives like Ubuntu:

  https://stat.ethz.ch/mailman/listinfo/r-sig-debian

You should subscribe to that list and then post your query there.

The answer to your question will depend, to a large extent, on how you 
installed R in the first place.

There are pre-compiled binaries available for R on Debian and derivatives, 
thanks to extensive efforts on the part of Dirk and others to maintain those 
repositories.

The R-SIG-Debian subscribers can help you, but be sure to indicate how you 
installed the version of R that you are currently using when you post there.

Regards,

Marc Schwartz

__
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] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-13 Thread Loris Bennett
Luigi Marongiu  writes:

> Dear all,
> I am working on Linux Ubuntu 16.04 and I have installed R 3.2. I need
> to upgrade to R 3.3 and I tried several options available online with
> no success. I downloaded the tar.gz file for R 3.3 and I would like to
> ask how can I use this file in order to accomplish the upgrade.
> Many thanks,
> Luigi
>

Have you looked here:

https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installing-R-under-Unix_002dalikes

?

Cheers,

Loris

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de

__
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] Maximum # of DLLs reached, or, how to clean up after yourself?

2016-09-13 Thread Alexander Shenkin

Hello all,

I have a number of analyses that call bunches of sub-scripts, and in the 
end, I get the "maximal number of DLLs reached" error.  This has been 
asked before (e.g. 
http://stackoverflow.com/questions/36974206/r-maximal-number-of-dlls-reached), 
and the general answer is, "just clean up after yourself".


Assuming there are no plans to raise this 100-DLL limit in the near 
future, my question becomes, what is best practice for cleaning up 
(detaching) loaded packages in scripts, when those scripts are sometimes 
called from other scripts?  One can detach all packages at the end of a 
script that were loaded at the beginning of the script.  However, if a 
package is required in a calling script, one should really make sure it 
hadn't been loaded prior to sub-script invocation before detaching it.


I could write a custom function that pushes and pops package names from 
a global list, in order to keep track, but maybe there's a better way 
out there...


Thanks for any thoughts.

Allie

__
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] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-13 Thread Luigi Marongiu
Dear all,
I am working on Linux Ubuntu 16.04 and I have installed R 3.2. I need
to upgrade to R 3.3 and I tried several options available online with
no success. I downloaded the tar.gz file for R 3.3 and I would like to
ask how can I use this file in order to accomplish the upgrade.
Many thanks,
Luigi

__
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] More tube-like lines3D?

2016-09-13 Thread Duncan Murdoch

On 13/09/2016 5:58 AM, Atte Tenkanen wrote:

Hi,

Is it possible to give 3d-like form for rgl lines3d-lines? Although I
increase lwd, lines still look like lines, not like tubes.

cylinder3d() should do that.  It puts a substantially larger burden on 
the graphics system, so if you draw too many of them, things will slow 
down noticeably.


Duncan Murdoch

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


[R] More tube-like lines3D?

2016-09-13 Thread Atte Tenkanen

Hi,

Is it possible to give 3d-like form for rgl lines3d-lines? Although I 
increase lwd, lines still look like lines, not like tubes.


--
Atte Tenkanen, FT MuM
Turun Martinseurakunnan kanttori
p. 040-3417125

__
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] Apply a multi-variable function to a vector

2016-09-13 Thread S Ellison
> I would like to define an arbitrary function of an arbitrary number of 
> variables,
> for example, for 2 variables:
> 
> func2 <- function(time, temp) time + temp
> 
> I'd like to keep variable names that have a meaning in the problem (time and
> temperature above).

Not quite enough information here.

If we called 
func2(30, 298, 23)

which has an arbitrary third argument, what would you like to happen to the 
third argument? And a fourth, fifth and so on? Something consistent for all 
arguments, or something different for each depending on its (arbitrary) name?


S Ellison





***
This email and any attachments are confidential. Any use...{{dropped:8}}

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


Re: [R] How to read a grib2 file

2016-09-13 Thread Michael Sumner
What is your computer system? What is the output of this?

sessionInfo()

If you point to a file I'll try it so I can tell you the minimum system
requirements.

Cheers, Mike

On Tue, 13 Sep 2016, 08:56 Debasish Pai Mazumder  wrote:

> Thanks for your suggestion. I have checked and I don't have JPEG2000 in
> ggdalDrivers()). I am pretty new in R. I don't understand how to do I
> implement JPEG2000 (JP2OpenJPEG driver) in gdalDrivers() so that I can
> read grib2 files
>
> with regards
> -Deb
>
> On Sat, Sep 10, 2016 at 2:33 AM, Michael Sumner 
> wrote:
>
>>
>>
>> On Sat, 10 Sep 2016 at 07:12 Debasish Pai Mazumder 
>> wrote:
>>
>>> Hi
>>> I am trying to read a grib2 file in R.
>>>
>>> Here is my script
>>>
>>> library(rgdal)
>>> library(sp)
>>> library(rNOMADS)
>>> gribfile<-"tmax.01.2011040100.daily.grb2"
>>> grib <- readGDAL(gribfile)
>>>
>>> I am getting following error :
>>>
>>> dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.
>>> Is the JPEG2000 driver available?tmax.01.2011040100.daily.grb2 has GDAL
>>> driver GRIB
>>> and has 190 rows and 384 columns
>>> dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.
>>> Is the JPEG2000 driver available?dec_jpeg2000: Unable to open JPEG2000
>>> image within GRIB file.
>>>
>>>
>> Hi there, please check if JPEG2000 is in the gdalDrivers() list, i.e.  in
>>
>> rgdal::gdalDrivers()$name
>>
>> You are looking for one starting with "JP2" as per the list next to the
>> "JPEG2000" rows here:
>>
>> http://gdal.org/formats_list.html
>>
>> I have  JP2OpenJPEG on one system, but not (for example) on the Windows
>> CRAN binary for rgdal, which is the only readily available Windows build
>> for this package.
>>
>> I you don't have it, you might try on a system that has the JP2OpenJPEG 
>> driver,
>> or ask someone to try on your behalf. You'd want to find out if that will
>> enable this read for you before investing time in the Linux configuration.
>>
>> It's not too hard to set up a Linux system for this, but does assume a
>> bit of experience on your part. Some of the docker images in the
>> rockerverse have this all sorted I believe, but it's been a while since I
>> used them.
>>
>> https://hub.docker.com/u/rocker/
>>
>> Cheers, Mike.
>>
>>
>>
>>
>>> Cheers
>>> -Deb
>>>
>>> [[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.
>>>
>> --
>> Dr. Michael Sumner
>> Software and Database Engineer
>> Australian Antarctic Division
>> 203 Channel Highway
>> Kingston Tasmania 7050 Australia
>>
>>
> --
Dr. Michael Sumner
Software and Database Engineer
Australian Antarctic Division
203 Channel Highway
Kingston Tasmania 7050 Australia

[[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] Drill down reports in R

2016-09-13 Thread Manohar Reddy
Hi,



  How to generate “Drill down reports ”  (like please refer below url) in R
using any package ? I did lot of research in google but I didn’t found
suitable link .

 Can anyone help how to do that in R ?



url :  http://bhushan.extreme-advice.com/drilldown-report-in-ssrs/



Thanks in Advance !

Manu.

[[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-es] Regresión Deming

2016-09-13 Thread Carlos Ortega
Hola,

Aquí cuentan cómo hacerlo en "R":

http://labrtorian.com/2015/09/14/deming-and-passing-bablok-regression-in-r/

Saludos,
Carlos Ortega
www.qualityexcellence.es

El 13 de septiembre de 2016, 12:05, Marcos Bermejo <
markbermej...@hotmail.com> escribió:

> Hola a todos,
>
>
> ¿Alguien sabría explicarme con detalle lo que es la regresión Deming?.
> Tengo que implementar dicha regresión en código C y código R.
>
>
> Muchas gracias de antemano.
>
>
> Un saludo,
>
>
> Marcos
>
> [[alternative HTML version deleted]]
>
>
> ___
> 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

[[alternative HTML version deleted]]

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


Re: [R-es] Borrar carácteres extraños /xax

2016-09-13 Thread Ruben Tobalina Ramirez
Buenos dias,

Muchas gracias Rubén, tocayo.

Ya me temía que la solución fuera esa. Estube mirando por los foros y vi
que todas las soluciones eran crear un diccionario de palabras que se
identificaran con los códigos de los emoji. Lo más fácil será crear un
archivo con los códigos y borrarlos con removeWords del paquete tm.

Un saludo!

El 12 de septiembre de 2016, 22:37, 
escribió:

>
>
> Estimado Rubén Tobalina Ramirez
>
>
>
> Puede ser un problema el tener como regla el buscar un parámetro, porque
> de pronto una palabra contiene justo esa secuencia de letras, por lo cuál
> yo buscaría las letras en forma que no queden dudas, me tomaría el trabajo
> de hacer o buscar un diccionario emojis a eliminar o traducir.
>
>
>
> *De: *Ruben Tobalina Ramirez 
> *Enviado: *viernes, 9 de septiembre de 2016 4:16
> *Para: *r-help-es 
> *Asunto: *[R-es] Borrar carácteres extraños /xax
>
>
>
> Buenos días,
>
>
>
> estoy realizando análisis de texto con Twitter y tengo un problema con unos
>
> carácteres que no logro quitar. Són cadenas de letras con forma similar a
>
> *xaexdfxdeaxoa*. Creo que surgen de la códificación de los emojis.
>
>
>
> Yo suelo utilizar, más o menos el siguiente codigo con gsub para limpiar
>
> texto, pero no me sirve
>
>
>
> # remove rt
>
> x = gsub("rt", "", x)
>
> # remove at
>
> x = gsub("@\\w+", "", x)
>
> # remove punctuation
>
> x = gsub("[[:punct:]]", "", x)
>
> # remove numbers
>
> x = gsub("[[:digit:]]", "", x)
>
> # remove links http
>
> x = gsub("http\\w+", "", x)
>
> # remove tabs
>
> x = gsub("[ |\t]{2,}", "", x)
>
> # remove blank spaces at the beginning
>
> x = gsub("^ ", "", x)
>
> # remove blank spaces at the end
>
> x = gsub(" $", "", x)
>
>
>
> ¿Alguna forma de eliminarlos?
>
>
>
> Muchas gracias!!!
>
>
>
> --
>
> Rubén.
>
>
>
> [[alternative HTML version deleted]]
>
>
>
> ___
>
> R-help-es mailing list
>
> R-help-es@r-project.org
>
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>
>
>



-- 
Rubén.

[[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] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-13 Thread Luisfo via R-help
Dear Tom,

I think this is the line you need
   arules::subset(rules, subset=lhs %pin% "")
I found the solution here: 
http://stackoverflow.com/questions/27926131/how-to-get-items-for-both-lhs-and-rhs-for-only-specific-columns-in-arules

One more thing. For printing the rules, I needed the inspect() command 
you didn't provide.

I hope this helps.

Best,

*Luisfo Chiroque*
/PhD Student | PhD Candidate
IMDEA Networks Institute/
http://fourier.networks.imdea.org/people/~luis_nunez/ 


On 09/12/2016 04:39 PM, Tom D. Harray wrote:
> Hello,
>
> subsets of association rules (with respect to support, confidence, lift, or
> items) can be obtained with the arules::subset() function; e.g.
>
>rm(list = ls(all.names = TRUE))
>library(arules)
>set.seed(42)
>
>x <- lapply(X = 1:500, FUN = function(i)
>  sample(x = 1:10, size = sample(1:5, 1), replace = FALSE)
>)
>x <- as(x, 'transactions')
>
>rules <- apriori(
>  data = x,
>  parameter = list(target = 'rules', minlen = 1, maxlen = 2,
>support = 0.10, confidence = 0.32)
>)
>rules <- arules::sort(x = rules, decreasing = TRUE, by ='support')
>
> gives the rules
> 3  {}  => {1} 0.330   0.330  1.000
> 2  {}  => {3} 0.326   0.326  1.000
> 1  {}  => {2} 0.320   0.320  1.000
> 20 {3} => {1} 0.120   0.3680982  1.1154490
> 21 {1} => {3} 0.120   0.3636364  1.1154490
> 16 {4} => {3} 0.114   0.3677419  1.1280427
> (...)
>
> However, I cannot figure out (help/web) how to get the subset for the rules
> with empty left hand side (lhs) like subset(rules, lhs == ''). I  could run 
> the
> apriori() function twice and adjust the min/maxlen parameters as a band
> aid fix.
>
>
> So my question is: How do I subset() association rules with empty lhs?
>
>
> Thanks and regards,
>
> Dirk
>
> __
> 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] Is this kind of removing of elements from data.frame (in)efficient?

2016-09-13 Thread mviljamaa
So I'm a beginner in R and I was testing the removal of elements from a 
data.frame.


The way I remove the element(s) with the minimum value in kid_score 
variable is to do:


kidmomhs <- data[kidmomhs$kid_score != min(kidmomhs$kid_score),]

So now kidmomhs is the same data, but without the row(s) with the 
minimum value of kid_score.


Judging by the syntax this looks as if R might be creating a copy of the 
data array, just without the rows that were removed.


The question however is, is this the most efficient way to remove 
elements from data structures in R? And is the above inefficient? Does 
the above create copies of almost the entire data structure?


In other programming languages I've become accustomed to doing removal 
of elements by changing them to NULL and then e.g. reordering the data 
structure. Rather than having to take copies of almost the entire data 
structure.


__
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] Hausman Test

2016-09-13 Thread Achim Zeileis

On Mon, 12 Sep 2016, Ding, Jie Ding (NIH/NIA/ERP) [F] wrote:


Dear Achim,

Sorry to have disturbed you. I have encountered a problem  when computing 
Hausman test statistics (i.e. p values)  in R to compare OLS and 2SLS models.

The problem is a discrepancy between the two p-value outputs from the "manual approach (by hand)" 
and the " diagnostics argument" in the "AER" library, respectively.

With respect to manual approach, I used the following codes:

cf_diff<-coef(ivreg)-coef(olsreg)
vc_diff<-vcov(ivreg)-vcov(olsreg)
x2_diff<-as.vector(t(cf_diff)%*% solve(vc_diff)%*%cf_diff)
pchisq(x2_diff,df=2,lower.tail=FALSE)


For diagnostic approach, I applied the following:

summary(ivreg, vcov = sandwich, df = Inf, diagnostics = TRUE)


However, p-value from the manual approach is always much larger than the 
diagnostic approach, e.g.  0.329 vs. 0.138


I would expect the values should be the same. Your advice would be 
highly appreciated.


The Wu-Hausman test in ivreg() follows the auugmented regression approach 
that is also used by Stata. This regresses the endogenous variable on the 
instruments and includes the fitted values in an OLS regression. The test 
is then a simple Wald test, see:

http://www.stata.com/support/faqs/statistics/durbin-wu-hausman-test/


With very best wishes,
Jennifer



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