Re: [R] Mysterious seg fault --- SOLVED

2018-08-14 Thread Rolf Turner

On 15/08/18 13:00, Richard M. Heiberger wrote:

There is no explanation other than gremlins and the malevolence that
the computer gods hold towards me.

fortune nomination.


I demur.  I already have a fortune with gremlins in it attributed to me
(fortune(213)).

cheers,

Rolf

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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] Mysterious seg fault --- SOLVED

2018-08-14 Thread Richard M. Heiberger
There is no explanation other than gremlins and the malevolence that
the computer gods hold towards me.

fortune nomination.

On Tue, Aug 14, 2018 at 7:12 PM, Rolf Turner  wrote:
> On 14/08/18 23:01, peter dalgaard wrote:
>>
>> Hmm,
>>
>>> .Fortran(stats:::C_setsmu, as.integer(0))
>>
>> [[1]]
>> [1] 0
>>
>>> .Fortran(stats:::C_setsmu, as.integer(fumble))
>>
>> Error: object 'fumble' not found
>>>
>>> .Fortran(stats:::C_setsmu, fumble=as.integer(fumble))
>>
>> Error: object 'fumble' not found
>>>
>>> .Fortran(stats:::C_setsmu, nphi=as.integer(nphi))
>>
>> Error: object 'nphi' not found
>>
>> so I think we need an alternative hypothesis about what went wrong for
>> you...
>>
>> If nphi was NULL from the outset, that could explain things.
>
>
> No, I never set nphi to NULL.
>
> I put the code back to the way it was previously, just now, and tried again.
> Now I get "object 'nphi' not found".
>
> There is no explanation other than gremlins and the malevolence that the
> computer gods hold towards me.
>
> cheers,
>
> Rolf
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
> __
> 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] Spline function

2018-08-14 Thread Duncan Murdoch

On 14/08/2018 11:48 AM, Tania Morgado Garcia wrote:

  Hello everyone. I'm new to R and I'm using spline functions. With the
command splinefun (x, y) I get the function of interpolating the values x
and y. Later, I can evaluate that function for values of x by obtaining the
respective values of y. The point is that I need the inverse operation,
with the function, for a value of Y I need to know the value of x. Could
you please help me?


Others have pointed out uniroot().  One other possibility:  maybe you 
don't need both the function and its inverse, or an approximate inverse 
is good enough.  In either of those cases, just swap x and y in the call 
to splinefun(), and you'll get a new function mapping y values to the 
corresponding x values.  (You'll get nonsense or an error in cases where 
this mapping is not unique.)  It won't match the inverse of the original 
spline interpolator except at observed (x,y) pairs, but will usually be 
close, especially if the functions are pretty smooth.


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] Mysterious seg fault --- SOLVED

2018-08-14 Thread Rolf Turner

On 14/08/18 23:01, peter dalgaard wrote:

Hmm,


.Fortran(stats:::C_setsmu, as.integer(0))

[[1]]
[1] 0


.Fortran(stats:::C_setsmu, as.integer(fumble))

Error: object 'fumble' not found

.Fortran(stats:::C_setsmu, fumble=as.integer(fumble))

Error: object 'fumble' not found

.Fortran(stats:::C_setsmu, nphi=as.integer(nphi))

Error: object 'nphi' not found

so I think we need an alternative hypothesis about what went wrong for you...

If nphi was NULL from the outset, that could explain things.


No, I never set nphi to NULL.

I put the code back to the way it was previously, just now, and tried 
again. Now I get "object 'nphi' not found".


There is no explanation other than gremlins and the malevolence that the 
computer gods hold towards me.


cheers,

Rolf

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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] [FORGED] Spline function

2018-08-14 Thread Rolf Turner



On 15/08/18 03:48, Tania Morgado Garcia wrote:


  Hello everyone. I'm new to R and I'm using spline functions. With the
command splinefun (x, y) I get the function of interpolating the values x
and y. Later, I can evaluate that function for values of x by obtaining the
respective values of y. The point is that I need the inverse operation,
with the function, for a value of Y I need to know the value of x. Could
you please help me?


Your question is ill-posed.  There could easily be multiple x values 
corresponding to a single y value, unless the spline function is monotone.


If you can specify an interval which encloses the x value that you are 
trying to and over which the spline function is monotone, then uniroot() 
might provide what you want.


Something like:

   spf <- splinefun(x,y)
   uniroot(f=function(x){spf-y0},interval=c(a,b))

where y0 is the y value for which you want the corresponding x value,
where spf() is monotone on [a,b], and where there *exists* an x value 
between a and b such that spf(x) = y0.


Good luck.

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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] Spline function

2018-08-14 Thread Greg Snow
The uniroot function can be used to find a value in a specified
interval, if it exists.
On Tue, Aug 14, 2018 at 3:30 PM Tania Morgado Garcia  wrote:
>
>  Hello everyone. I'm new to R and I'm using spline functions. With the
> command splinefun (x, y) I get the function of interpolating the values x
> and y. Later, I can evaluate that function for values of x by obtaining the
> respective values of y. The point is that I need the inverse operation,
> with the function, for a value of Y I need to know the value of x. Could
> you please help me?
> A cordial greeting
>
> [[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] Spline function

2018-08-14 Thread Bert Gunter
If I understand correctly, not in general possible.

Suppose for a bunch of different x's the y's are all constant =0. What x
would correspond to y = 1.

Or suppose (x,y) pairs trace a sine function over several periods. Then
there is no unique x corresponding to y = .5, say.

Perhaps if you more explicitly specified the nature of your problem (e.g.
is y monotonic in x?) some assistance might be provided.

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 Tue, Aug 14, 2018 at 8:48 AM, Tania Morgado Garcia 
wrote:

>  Hello everyone. I'm new to R and I'm using spline functions. With the
> command splinefun (x, y) I get the function of interpolating the values x
> and y. Later, I can evaluate that function for values of x by obtaining the
> respective values of y. The point is that I need the inverse operation,
> with the function, for a value of Y I need to know the value of x. Could
> you please help me?
> A cordial greeting
>
> [[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] Spline function

2018-08-14 Thread Tania Morgado Garcia
 Hello everyone. I'm new to R and I'm using spline functions. With the
command splinefun (x, y) I get the function of interpolating the values x
and y. Later, I can evaluate that function for values of x by obtaining the
respective values of y. The point is that I need the inverse operation,
with the function, for a value of Y I need to know the value of x. Could
you please help me?
A cordial greeting

[[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] FPMC?

2018-08-14 Thread Charles Determan
Greetings R users,

I recently came across an interesting paper regarding recommender systems.
The particular method defined in the manuscript was Factorizing
Personalized Markov Chains.  You can find the article in question here (
http://www.ra.ethz.ch/cdstore/www2010/www/p811.pdf).  I am curious if
anyone here has ever come across anything like this before in the R
community.  I have found multiple packages on Markov Chains but nothing
with respect to combining them with matrix factorization.  I will continue
to search around but thought I would pose the question here as well.

Regards,
Charles

[[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] Changing PDF orientation midstream

2018-08-14 Thread J C Nash
Not an R issue, but for linux users pdf-shuffler is a great tool

JN

On 2018-08-14 03:46 PM, Stats Student wrote:
> Hi, I'm wondering whether it is possible to change the orientation of the PDF 
> in the middle of the document. In other words, pages 1,2,3 - portrait, pages 
> 4,5 - landscape, etc. 
> 
> This is how I call it -
> 
> pdf (file, paper="US") or USr for landscape 
> 
> 
> Thanks!
> 
> __
> 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] Changing PDF orientation midstream

2018-08-14 Thread Bert Gunter
1. Probably not. But I'm no pdf expert.

2. This adobe thread may be relevant:

https://forums.adobe.com/thread/1091826

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 Tue, Aug 14, 2018 at 12:46 PM, Stats Student  wrote:

> Hi, I'm wondering whether it is possible to change the orientation of the
> PDF in the middle of the document. In other words, pages 1,2,3 - portrait,
> pages 4,5 - landscape, etc.
>
> This is how I call it -
>
> pdf (file, paper="US") or USr for landscape
>
>
> Thanks!
>
> __
> 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] Changing PDF orientation midstream

2018-08-14 Thread Stats Student
Hi, I'm wondering whether it is possible to change the orientation of the PDF 
in the middle of the document. In other words, pages 1,2,3 - portrait, pages 
4,5 - landscape, etc. 

This is how I call it -

pdf (file, paper="US") or USr for landscape 


Thanks!

__
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] Request for help with R program

2018-08-14 Thread Bert Gunter
R has no "associates". It is open source software with many users and
developers with varying skill levels and interests.

I think you are in over your head ("inexperienced in computer programming")
and should seek local resources at Baylor to help you. This list probably
cannot provide the level of assistance you seek.


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 Mon, Aug 13, 2018 at 4:13 PM, Spencer Brackett <
spbracket...@saintjosephhs.com> wrote:

> Good evening,
>
>   I am a high school research student who is partnering with Baylor
> University (TX) on a Genomic research project, and was seeking to use the R
> program to analysis our data— which is from GDC database. R-3.5.1 is
> currently downloaded onto my Windows PC and I am looking to download the
> CGDS and GAIA packages, and then to subsequently downloaded and analyze the
> Genomic data we have extracted via the R packages. I attempted to utilize
> the various help utilities you provide, but I am rather inexperienced with
> computer programming and the R program as a whole. Therefore, I am
> requesting a screen sharing session and/or phone or email correspondence
> with one of your associates so to achieve my goals. Such would be very
> helpful to my and my mentors work, and our pending publication.
>
> Many thanks,
>
> Spencer Brackett
>
> [[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] Cannot set correct miktex path for pdflatex

2018-08-14 Thread Richard M. Heiberger
You are getting the correct version.  R is using the 8.3 version of the path.
MS DOS often can't handle long MS Windows pathnames, particularly with
blank space characters.
MS therefore provides an 8.3 equivalent for all long names.

C:\>dir /x prog*
dir /x prog*
 Volume in drive C has no label.
 Volume Serial Number is 188D-5BB8

 Directory of C:\

12/03/2017  03:39 PM  PROGRA~1 Program Files
05/17/2018  03:02 AM  PROGRA~2 Program Files (x86)
   0 File(s)  0 bytes
   2 Dir(s)   1,257,172,992 bytes free

C:\>dir /x progra~1\Miktex*
dir /x progra~1\Miktex*
 Volume in drive C has no label.
 Volume Serial Number is 188D-5BB8

 Directory of C:\progra~1

12/18/2015  09:50 PM  MIKTEX~1.9   MiKTeX 2.9
   0 File(s)  0 bytes
   1 Dir(s)   1,257,172,992 bytes free

C:\>
C:\>dir /?
dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
  [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

  [drive:][path][filename]
  Specifies drive, directory, and/or files to list.

  /A  Displays files with specified attributes.
  attributes   D  DirectoriesR  Read-only files
   H  Hidden files   A  Files ready for archiving
   S  System files   I  Not content indexed files
   L  Reparse Points -  Prefix meaning not
  /B  Uses bare format (no heading information or summary).
  /C  Display the thousand separator in file sizes.  This is the
  default.  Use /-C to disable display of separator.
  /D  Same as wide but files are list sorted by column.
  /L  Uses lowercase.
  /N  New long list format where filenames are on the far right.
  /O  List by files in sorted order.
  sortorderN  By name (alphabetic)   S  By size (smallest first)
   E  By extension (alphabetic)  D  By date/time (oldest first)
   G  Group directories first-  Prefix to reverse order
  /P  Pauses after each screenful of information.
  /Q  Display the owner of the file.
  /R  Display alternate data streams of the file.
  /S  Displays files in specified directory and all subdirectories.
  /T  Controls which time field displayed or used for sorting
  timefield   C  Creation
  A  Last Access
  W  Last Written
  /W  Uses wide list format.
  /X  This displays the short names generated for non-8dot3 file
  names.  The format is that of /N with the short name inserted
  before the long name. If no short name is present, blanks are
  displayed in its place.
  /4  Displays four-digit years

Switches may be preset in the DIRCMD environment variable.  Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

On Mon, Aug 13, 2018 at 1:18 PM, Kelley, Claire  wrote:
> Hi all,
>
> I am having a problem in R where R is finding an old non existent version of 
> miktex rather than the new version. This occurs despite having set the path 
> to the correct location.
>
> For example in bash if I look for the location of pdflatex:
>
> $ which pdflatex
> /c/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex
>
>
> It points to the correct MikTex installation.
>
> However in R:
>
> Sys.which("pdflatex")
> pdflatex
> C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe"
>
> Points to the old  (1.9) version of Miktex.
>
> This is my session info:
>
> R version 3.5.1 (2018-07-02)
> 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=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.5.1
>
> Any thoughts?
>
> I have unsuccessfully tried:
>
>
>   1.  Adding correct MikTex path to my Renviorn.site. this adds MikTex to my 
> path and I can see the addition, but doesn’t fix the problem
>   2.  Adding MikTex path to my $PATH variable. This lets bash find the right 
> version of miktex but doesn’t help in R
>   3.  Making sure I only have on version of MIktex. I don’t have tiny tex 
> installed (nor can I because I need the full MIkTex for other work) .
>
>
> Best,
> Claire
>
> [[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 

Re: [R] Fast matrix multiplication

2018-08-14 Thread Ravi Varadhan
Does Microsoft open R come with pre-compiled BLAS that is optimized for matrix 
computations?

Thanks,
Ravi

-Original Message-
From: Ista Zahn  
Sent: Monday, August 13, 2018 3:18 PM
To: Ravi Varadhan 
Cc: r-help@r-project.org
Subject: Re: [R] Fast matrix multiplication


On Mon, Aug 13, 2018 at 2:41 PM Ravi Varadhan  wrote:
>
> Hi Ista,
> Thank you for the response.  I use Windows.  Is there a pre-compiled version 
> of openBLAS for windows that would make it easy for me to use it?

Not sure. If you want an easy way I would use MRO. More info at
https://mran.microsoft.com/rro#intelmkl1

--Ista

> Thanks,
> Ravi
>
> -Original Message-
> From: Ista Zahn 
> Sent: Friday, August 10, 2018 12:20 PM
> To: Ravi Varadhan 
> Cc: r-help@r-project.org
> Subject: Re: [R] Fast matrix multiplication
>
>
> Hi Ravi,
>
> You can achieve substantial speed up by using a faster BLAS (e.g., OpenBLAS 
> or MKL), especially on systems with multiple CPUs. On my (6 year old, but 8 
> core) system your example takes 3.9 seconds with using the reference BLAS and 
> only 0.9 seconds using OpenBLAS.
>
> Best,
> Ista
> On Fri, Aug 10, 2018 at 11:46 AM Ravi Varadhan  wrote:
> >
> > Hi,
> >
> > I would like to compute:  A %*% B %*% t(A)
> >
> >
> >
> > A is a mxn matrix and B is an nxn symmetric, positive-definite matrix, 
> > where m is large relative to n (e.g., m=50,000 and n=100).
> >
> >
> >
> > Here is a sample code.
> >
> >
> >
> > M <- 1
> >
> > N <- 100
> >
> > A <- matrix(rnorm(M*N), M, N)
> >
> > B <- crossprod(matrix(rnorm(N*N), N, N)) # creating a symmetric 
> > positive-definite matrix
> >
> >
> >
> > # method 1
> >
> > system.time(D <- A %*% B %*% t(A))
> >
> >
> >
> > # I can obtain speedup by using a Cholesky decomposition of B
> >
> > # method 2
> >
> > system.time({
> >
> > C <- t(chol(B))
> >
> > E <- tcrossprod(A%*%C)
> >
> > })
> >
> >
> >
> > all.equal(D, E)
> >
> >
> >
> > I am wondering how to obtain more substantial speedup.  Any suggestions 
> > would be greatly appreciated.
> >
> >
> >
> > Thanks,
> >
> > Ravi
> >
> >
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

__
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] Fast matrix multiplication

2018-08-14 Thread Ista Zahn
On Tue, Aug 14, 2018 at 9:41 AM Ravi Varadhan  wrote:
>
> Does Microsoft open R come with pre-compiled BLAS that is optimized for 
> matrix computations?

Yes, see https://mran.microsoft.com/rro#intelmkl1 for details.

--Ista

>
> Thanks,
> Ravi
>
> -Original Message-
> From: Ista Zahn 
> Sent: Monday, August 13, 2018 3:18 PM
> To: Ravi Varadhan 
> Cc: r-help@r-project.org
> Subject: Re: [R] Fast matrix multiplication
>
>
> On Mon, Aug 13, 2018 at 2:41 PM Ravi Varadhan  wrote:
> >
> > Hi Ista,
> > Thank you for the response.  I use Windows.  Is there a pre-compiled 
> > version of openBLAS for windows that would make it easy for me to use it?
>
> Not sure. If you want an easy way I would use MRO. More info at
> https://mran.microsoft.com/rro#intelmkl1
>
> --Ista
>
> > Thanks,
> > Ravi
> >
> > -Original Message-
> > From: Ista Zahn 
> > Sent: Friday, August 10, 2018 12:20 PM
> > To: Ravi Varadhan 
> > Cc: r-help@r-project.org
> > Subject: Re: [R] Fast matrix multiplication
> >
> >
> > Hi Ravi,
> >
> > You can achieve substantial speed up by using a faster BLAS (e.g., OpenBLAS 
> > or MKL), especially on systems with multiple CPUs. On my (6 year old, but 8 
> > core) system your example takes 3.9 seconds with using the reference BLAS 
> > and only 0.9 seconds using OpenBLAS.
> >
> > Best,
> > Ista
> > On Fri, Aug 10, 2018 at 11:46 AM Ravi Varadhan  
> > wrote:
> > >
> > > Hi,
> > >
> > > I would like to compute:  A %*% B %*% t(A)
> > >
> > >
> > >
> > > A is a mxn matrix and B is an nxn symmetric, positive-definite matrix, 
> > > where m is large relative to n (e.g., m=50,000 and n=100).
> > >
> > >
> > >
> > > Here is a sample code.
> > >
> > >
> > >
> > > M <- 1
> > >
> > > N <- 100
> > >
> > > A <- matrix(rnorm(M*N), M, N)
> > >
> > > B <- crossprod(matrix(rnorm(N*N), N, N)) # creating a symmetric
> > > positive-definite matrix
> > >
> > >
> > >
> > > # method 1
> > >
> > > system.time(D <- A %*% B %*% t(A))
> > >
> > >
> > >
> > > # I can obtain speedup by using a Cholesky decomposition of B
> > >
> > > # method 2
> > >
> > > system.time({
> > >
> > > C <- t(chol(B))
> > >
> > > E <- tcrossprod(A%*%C)
> > >
> > > })
> > >
> > >
> > >
> > > all.equal(D, E)
> > >
> > >
> > >
> > > I am wondering how to obtain more substantial speedup.  Any suggestions 
> > > would be greatly appreciated.
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Ravi
> > >
> > >
> > >
> > > [[alternative HTML version deleted]]
> > >
> > > __
> > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> >
>

__
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] Mysterious seg fault --- SOLVED

2018-08-14 Thread peter dalgaard
Hmm, 

> .Fortran(stats:::C_setsmu, as.integer(0))
[[1]]
[1] 0

> .Fortran(stats:::C_setsmu, as.integer(fumble))
Error: object 'fumble' not found
> .Fortran(stats:::C_setsmu, fumble=as.integer(fumble))
Error: object 'fumble' not found
> .Fortran(stats:::C_setsmu, nphi=as.integer(nphi))
Error: object 'nphi' not found

so I think we need an alternative hypothesis about what went wrong for you... 

If nphi was NULL from the outset, that could explain things.

-pd


> On 14 Aug 2018, at 01:16 , Rolf Turner  wrote:
> 
> On 13/08/18 23:39, peter dalgaard wrote:
>> It's odd, possibly a bug, that you don't get
>> Error: object 'nphi' not found
>> but I can't offhand see where the evaluation of args to .C/.Fortran is 
>> supposed to take place.
> 
> If it is indeed a bug then it would be nice an it were fixed.  If that is 
> possible.  Way beyond my level of comprehension but.
> 
> cheers,
> 
> Rolf
> 
> -- 
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@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] Assistance on Installing Rattle

2018-08-14 Thread Michael Dewey

Dear Shivi

The current version is on CRAN so why not use that?

install.packages("RGtk2")

should install version 2.30.35
If it does not then try another mirror

Michael

On 13/08/2018 19:47, Shivi Bhatia wrote:

Hi Michael
Thank you for the reply.
I have been looking for 3.5.1 version of this package but I cannot find 
one, would you recommend downgrading my current R version.

Would there be some or any other compatibly issue - please advice.

Thank you, Shivi


Sent from Yahoo Mail for iPhone 

On Monday, August 13, 2018, 21:56, Michael Dewey 
 wrote:


Dear Shivi

You are running R 3.5.1 according to your session info. Why are you
installing a version for R 3.3? Note that the up-to-date version
depends
on R > 3.4.0 so it is no surprise that you get problems.

Michael

On 13/08/2018 16:07, Shivi Bhatia wrote:
 > Hi Michael,
 >
 > I was able to install RGtk2
 >
from 
install.packages("https://cran.r-project.org/bin/windows/contrib/3.3/RGtk2_2.20.31.zip;,

 > repos=NULL) but after installing this and trying to install
rattle i get
 > this error:
 > Error : package 'RGtk2' was installed by an R version with different
 > internals; it needs to be reinstalled for use with this R version
 > ERROR: lazy loading failed for package 'rattle'
 >
 > I tried installing rattle from install.packages("rattle",
 > repos="https://rattle.togaware.com;, type="source").
 >
 > Regards, Shivi
 >
 >
 > On Sun, Aug 12, 2018 at 7:20 PM Michael Dewey
mailto:li...@dewey.myzen.co.uk>
 > >> wrote:
 >
 >    Dear Shivi
 >
 >    What error message do you get when you try to install RGtk2?
 >
 >    Michael
 >
 >    On 12/08/2018 11:49, Shivi Bhatia wrote:
 >      > Hi Eric,
 >      >
 >      > Thank you for the reply. I am adding the session details
below,
 >    hope it
 >      > helps:
 >      > R version 3.5.1 (2018-07-02)
 >      > Platform: x86_64-w64-mingw32/x64 (64-bit)
 >      > Running under: Windows >= 8 x64 (build 9200)
 >      >
 >      > Matrix products: default
 >      > locale:
 >      > [1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252
 >      > LC_MONETARY=English_India.1252
 >      > [4] LC_NUMERIC=C                   LC_TIME=English_India.1252
 >      >
 >      > attached base packages:
 >      > [1] stats     graphics  grDevices utils     datasets 
methods   base

 >      >
 >      > Thanks.
 >      >
 >      > On Sat, Aug 11, 2018 at 9:38 PM Eric Berger
 >    mailto:ericjber...@gmail.com>
>> wrote:
 >      >
 >      >> Hi Shivi,
 >      >> I have no experience with the rattle package but I just
 >    installed it with
 >      >> no problem.
 >      >> I am using a Windows 10 machine with R version 3.4.2.
 >      >>
 >      >> I suggest you provide additional information so that
others may
 >    have ideas.
 >      >> e.g. your operating system version and output from
sessionInfo()
 >    (in R)
 >      >>
 >      >> Best,
 >      >> Eric
 >      >>
 >      >>
 >      >> On Sat, Aug 11, 2018 at 6:55 PM, Shivi Bhatia
 >    mailto:shivipm...@gmail.com>
>>
 >      >> wrote:
 >      >>
 >      >>> Hi,
 >      >>>
 >      >>> Need assistance on installing Rattle.
 >      >>>
 >      >>> I have followed the instructions on
https://rattle.togaware.com/
 >      >>> but still facing error installing the package.
 >      >>> ERROR: dependency 'RGtk2' is not available for package
'rattle'.
 >      >>> Have tried installing RGt2 from multiple sources and its
still
 >    failing.
 >      >>>
 >      >>> One of the suggestion on stack overflow was to downgrade
the R
 >    version
 >      >>> here
 >      >>> :
 >      >>>
 >      >>>
 >

https://stackoverflow.com/questions/24913643/downgrade-r-version-no-issues-with-bioconductor-installation
 >      >>> Request assistance.
 >      >>>
 >      >>> Regards, Shivi
 >      >>>
 >      >>>          [[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, 

Re: [R] searching for a specific row name in R

2018-08-14 Thread Rui Barradas

Hello,

If you have one hundred identifier names that you want to check the 
result of


id %in% column

will have length 100, the same as length(id).
If you want a shorter result you can do

which(id %in% column)

This will give you only the TRUE values.

Hope this helps,

Rui Barradas


Às 05:16 de 14/08/2018, Deepa escreveu:

I have a hundred identifier names that I want to check from the second
column of a matrix with 6000 entries in the column.
Instead of using  R > c("d", "v", "4", "s") %in% letters , is there an
alternative?

I have the hundred identifier names that are of my interest stored in an
array.




On Tue, Aug 14, 2018 at 9:16 AM, Boris Steipe 
wrote:


Use the %in% operator:

help('%in%')

e.g.

R > c("d", "v", "4", "s") %in% letters
[1]  TRUE  TRUE FALSE  TRUE


B.



On 2018-08-13, at 23:36, Deepa  wrote:

Hi Don,

When there is a list of identifier names that I want to check, the only

way

is to loop over each entry stored in the list of identifier names or is
there is there any other shortcut?

Many thanks for the response?

On Mon, Aug 13, 2018 at 8:18 PM, MacQueen, Don 

wrote:



Or to return a logical value, i.e., TRUE if the column contains the

value,

FALSE if it does not:

  any( x[,2] == 'A501' )

-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509



On 8/13/18, 12:09 AM, "R-help on behalf of Albrecht Kauffmann" <
r-help-boun...@r-project.org on behalf of alkau...@fastmail.fm> wrote:

Hello Deepa,

sum(x[,2] == "A501")
or
which(x[,2] == "A501")
.
Best,
Albrecht


--
  Albrecht Kauffmann
  alkau...@fastmail.fm

Am Mo, 13. Aug 2018, um 07:10, schrieb Deepa Maheshvare:

Hello Everyone,

I have a 1000 x 20 matrix. The second column of the matrix has the

names

of identifiers. How do I check when a certain identifier is present

in

the set of 1000 identifier names present in the second column. For
instance, let the names of identifiers be A1,A2,...A1000. I want to
check whether A501 is present .How can this be checked?

Any help will be highly appreciated.


  [[alternative HTML version deleted]]

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

posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


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





   [[alternative HTML version deleted]]

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

posting-guide.html

and provide commented, minimal, self-contained, reproducible code.





[[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] Prevent Printing Function's Environment

2018-08-14 Thread Martin Maechler
> Abs Spurdle 
> on Tue, 14 Aug 2018 15:16:08 +1200 writes:

> Hi All

> When you print a function constructed within a function, R
> prints it's environment.  For example:

 > > myfunction = function ()
 > + {   f = function () NULL
 > + attributes (f) = list (class="myfunction", myattribute=1)
 > + f
 > + }

 > > myfunction.f = myfunction ()

 > > myfunction.f
 > function ()
 > NULL
 > 
 > attr(,"class")
 > [1] "myfunction"
 > attr(,"myattribute")
 > [1] 1

 > One way to prevent this is to set the function's environment to the 
global
 > environment.
 > But I was wondering if there's a way to stop R from printing the
 > environment without changing the environment?

Probably, not the way you want, but if you need it e.g., for
didactical reasons, here's a way that may be didactically
relevant in it self:

  > ls.str
  function (pos = -1, name, envir, all.names = FALSE, pattern, 
  mode = "any") 
  {
  if (missing(envir)) 
  envir <- as.environment(pos)
  nms <- ls(name, envir = envir, all.names = all.names, pattern = pattern)
  r <- unlist(lapply(nms, function(n) exists(n, envir = envir, 
  mode = mode, inherits = FALSE)))
  structure(nms[r], envir = envir, mode = mode, class = "ls_str")
  }
  
  

so, I want to suppress the last two lines that are printed.
That's a piece of cake if you know  capture.output() :

  > P2 <- function(.) writeLines(head(capture.output(.), -2))
  > P2(ls.str)
  function (pos = -1, name, envir, all.names = FALSE, pattern, 
  mode = "any") 
  {
  if (missing(envir)) 
  envir <- as.environment(pos)
  nms <- ls(name, envir = envir, all.names = all.names, pattern = pattern)
  r <- unlist(lapply(nms, function(n) exists(n, envir = envir, 
  mode = mode, inherits = FALSE)))
  structure(nms[r], envir = envir, mode = mode, class = "ls_str")
  }
  >

__
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] Prevent Printing Function's Environment

2018-08-14 Thread Rui Barradas

Hello,

I am not sure I understand the question.
You say that

One way to prevent this [to print the attributes] is to set the 
function's environment to the global environment.


But this is not true, just see the example below, where I set the 
function's environment to .GlobalEnv



myfunction2 = function (){
  f = function () NULL
  attributes (f) = list (class="myfunction2", myattribute2=1)
  environment(f) <- .GlobalEnv
  f
}

myfunction2.f = myfunction2 ()

myfunction2.f
#function ()
#  NULL
#attr(,"class")
#[1] "myfunction2"
#attr(,"myattribute2")
#[1] 1

environment(myfunction2.f)
#


When you run the function's name, the function's definition is printed, 
all of it. If you want to print its return value you have to call it 
with the parenthesis:


myfunction2.f()# My function
#NULL

myfunction.f() # Your function
#NULL


If you want to print the body of the function, use, well, body().

body(myfunction.f)
#NULL


Hope this helps,

Rui Barradas
Às 04:16 de 14/08/2018, Abs Spurdle escreveu:

Hi All

When you print a function constructed within a function, R prints it's
environment.
For example:


myfunction = function ()

+ {   f = function () NULL
+ attributes (f) = list (class="myfunction", myattribute=1)
+ f
+ }


myfunction.f = myfunction ()



myfunction.f

function ()
NULL

attr(,"class")
[1] "myfunction"
attr(,"myattribute")
[1] 1

One way to prevent this is to set the function's environment to the global
environment.
But I was wondering if there's a way to stop R from printing the
environment without changing the environment?


kind regards
Abs

[[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] Prevent Printing Function's Environment

2018-08-14 Thread Abs Spurdle
Hi All

When you print a function constructed within a function, R prints it's
environment.
For example:

> myfunction = function ()
+ {   f = function () NULL
+ attributes (f) = list (class="myfunction", myattribute=1)
+ f
+ }

> myfunction.f = myfunction ()

> myfunction.f
function ()
NULL

attr(,"class")
[1] "myfunction"
attr(,"myattribute")
[1] 1

One way to prevent this is to set the function's environment to the global
environment.
But I was wondering if there's a way to stop R from printing the
environment without changing the environment?


kind regards
Abs

[[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] Request for help with R program

2018-08-14 Thread Spencer Brackett
Good evening,

  I am a high school research student who is partnering with Baylor
University (TX) on a Genomic research project, and was seeking to use the R
program to analysis our data— which is from GDC database. R-3.5.1 is
currently downloaded onto my Windows PC and I am looking to download the
CGDS and GAIA packages, and then to subsequently downloaded and analyze the
Genomic data we have extracted via the R packages. I attempted to utilize
the various help utilities you provide, but I am rather inexperienced with
computer programming and the R program as a whole. Therefore, I am
requesting a screen sharing session and/or phone or email correspondence
with one of your associates so to achieve my goals. Such would be very
helpful to my and my mentors work, and our pending publication.

Many thanks,

Spencer Brackett

[[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] Cannot set correct miktex path for pdflatex

2018-08-14 Thread Eric Berger
Hi Claire,
In Unix (linux) the 'which' command is documented as searching for the
command according to the PATH environment variable.
The different results from
$ which
and
> Sys.which()
would point to the fact that the PATH variable is different in the two
cases.

Compare:
$ echo $PATH

versus

Sys.getenv("PATH")

HTH,
Eric




On Mon, Aug 13, 2018 at 8:18 PM, Kelley, Claire  wrote:

> Hi all,
>
> I am having a problem in R where R is finding an old non existent version
> of miktex rather than the new version. This occurs despite having set the
> path to the correct location.
>
> For example in bash if I look for the location of pdflatex:
>
> $ which pdflatex
> /c/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex
>
>
> It points to the correct MikTex installation.
>
> However in R:
>
> Sys.which("pdflatex")
> pdflatex
> C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe"
>
> Points to the old  (1.9) version of Miktex.
>
> This is my session info:
>
> R version 3.5.1 (2018-07-02)
> 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=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.5.1
>
> Any thoughts?
>
> I have unsuccessfully tried:
>
>
>   1.  Adding correct MikTex path to my Renviorn.site. this adds MikTex to
> my path and I can see the addition, but doesn’t fix the problem
>   2.  Adding MikTex path to my $PATH variable. This lets bash find the
> right version of miktex but doesn’t help in R
>   3.  Making sure I only have on version of MIktex. I don’t have tiny tex
> installed (nor can I because I need the full MIkTex for other work) .
>
>
> Best,
> Claire
>
> [[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] Assistance on Installing Rattle

2018-08-14 Thread Shivi Bhatia
Hi Michael Thank you for the reply.I have been looking for 3.5.1 version of 
this package but I cannot find one, would you recommend downgrading my current 
R version. Would there be some or any other compatibly issue - please advice. 
Thank you, Shivi 


Sent from Yahoo Mail for iPhone


On Monday, August 13, 2018, 21:56, Michael Dewey  
wrote:

Dear Shivi

You are running R 3.5.1 according to your session info. Why are you 
installing a version for R 3.3? Note that the up-to-date version depends 
on R > 3.4.0 so it is no surprise that you get problems.

Michael

On 13/08/2018 16:07, Shivi Bhatia wrote:
> Hi Michael,
> 
> I was able to install RGtk2 
> from 
> install.packages("https://cran.r-project.org/bin/windows/contrib/3.3/RGtk2_2.20.31.zip;,
>  
> repos=NULL) but after installing this and trying to install rattle i get 
> this error:
> Error : package 'RGtk2' was installed by an R version with different 
> internals; it needs to be reinstalled for use with this R version
> ERROR: lazy loading failed for package 'rattle'
> 
> I tried installing rattle from install.packages("rattle", 
> repos="https://rattle.togaware.com;, type="source").
> 
> Regards, Shivi
> 
> 
> On Sun, Aug 12, 2018 at 7:20 PM Michael Dewey  > wrote:
> 
>    Dear Shivi
> 
>    What error message do you get when you try to install RGtk2?
> 
>    Michael
> 
>    On 12/08/2018 11:49, Shivi Bhatia wrote:
>      > Hi Eric,
>      >
>      > Thank you for the reply. I am adding the session details below,
>    hope it
>      > helps:
>      > R version 3.5.1 (2018-07-02)
>      > Platform: x86_64-w64-mingw32/x64 (64-bit)
>      > Running under: Windows >= 8 x64 (build 9200)
>      >
>      > Matrix products: default
>      > locale:
>      > [1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252
>      > LC_MONETARY=English_India.1252
>      > [4] LC_NUMERIC=C                   LC_TIME=English_India.1252
>      >
>      > attached base packages:
>      > [1] stats     graphics  grDevices utils     datasets  methods   base
>      >
>      > Thanks.
>      >
>      > On Sat, Aug 11, 2018 at 9:38 PM Eric Berger
>    mailto:ericjber...@gmail.com>> wrote:
>      >
>      >> Hi Shivi,
>      >> I have no experience with the rattle package but I just
>    installed it with
>      >> no problem.
>      >> I am using a Windows 10 machine with R version 3.4.2.
>      >>
>      >> I suggest you provide additional information so that others may
>    have ideas.
>      >> e.g. your operating system version and output from sessionInfo()
>    (in R)
>      >>
>      >> Best,
>      >> Eric
>      >>
>      >>
>      >> On Sat, Aug 11, 2018 at 6:55 PM, Shivi Bhatia
>    mailto:shivipm...@gmail.com>>
>      >> wrote:
>      >>
>      >>> Hi,
>      >>>
>      >>> Need assistance on installing Rattle.
>      >>>
>      >>> I have followed the instructions on https://rattle.togaware.com/
>      >>> but still facing error installing the package.
>      >>> ERROR: dependency 'RGtk2' is not available for package 'rattle'.
>      >>> Have tried installing RGt2 from multiple sources and its still
>    failing.
>      >>>
>      >>> One of the suggestion on stack overflow was to downgrade the R
>    version
>      >>> here
>      >>> :
>      >>>
>      >>>
>    
>https://stackoverflow.com/questions/24913643/downgrade-r-version-no-issues-with-bioconductor-installation
>      >>> Request assistance.
>      >>>
>      >>> Regards, Shivi
>      >>>
>      >>>          [[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.
>      >
> 
>    -- 
>    Michael
>    http://www.dewey.myzen.co.uk/home.html
> 

-- 
Michael
http://www.dewey.myzen.co.uk/home.html




[[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] Fast matrix multiplication

2018-08-14 Thread Ravi Varadhan
Hi Ista,
Thank you for the response.  I use Windows.  Is there a pre-compiled version of 
openBLAS for windows that would make it easy for me to use it?
Thanks,
Ravi

-Original Message-
From: Ista Zahn  
Sent: Friday, August 10, 2018 12:20 PM
To: Ravi Varadhan 
Cc: r-help@r-project.org
Subject: Re: [R] Fast matrix multiplication


Hi Ravi,

You can achieve substantial speed up by using a faster BLAS (e.g., OpenBLAS or 
MKL), especially on systems with multiple CPUs. On my (6 year old, but 8 core) 
system your example takes 3.9 seconds with using the reference BLAS and only 
0.9 seconds using OpenBLAS.

Best,
Ista
On Fri, Aug 10, 2018 at 11:46 AM Ravi Varadhan  wrote:
>
> Hi,
>
> I would like to compute:  A %*% B %*% t(A)
>
>
>
> A is a mxn matrix and B is an nxn symmetric, positive-definite matrix, where 
> m is large relative to n (e.g., m=50,000 and n=100).
>
>
>
> Here is a sample code.
>
>
>
> M <- 1
>
> N <- 100
>
> A <- matrix(rnorm(M*N), M, N)
>
> B <- crossprod(matrix(rnorm(N*N), N, N)) # creating a symmetric 
> positive-definite matrix
>
>
>
> # method 1
>
> system.time(D <- A %*% B %*% t(A))
>
>
>
> # I can obtain speedup by using a Cholesky decomposition of B
>
> # method 2
>
> system.time({
>
> C <- t(chol(B))
>
> E <- tcrossprod(A%*%C)
>
> })
>
>
>
> all.equal(D, E)
>
>
>
> I am wondering how to obtain more substantial speedup.  Any suggestions would 
> be greatly appreciated.
>
>
>
> Thanks,
>
> Ravi
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
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] Cannot set correct miktex path for pdflatex

2018-08-14 Thread Kelley, Claire
Hi all,

I am having a problem in R where R is finding an old non existent version of 
miktex rather than the new version. This occurs despite having set the path to 
the correct location.

For example in bash if I look for the location of pdflatex:

$ which pdflatex
/c/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex


It points to the correct MikTex installation.

However in R:

Sys.which("pdflatex")
pdflatex
C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe"

Points to the old  (1.9) version of Miktex.

This is my session info:

R version 3.5.1 (2018-07-02)
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=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

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

Any thoughts?

I have unsuccessfully tried:


  1.  Adding correct MikTex path to my Renviorn.site. this adds MikTex to my 
path and I can see the addition, but doesn’t fix the problem
  2.  Adding MikTex path to my $PATH variable. This lets bash find the right 
version of miktex but doesn’t help in R
  3.  Making sure I only have on version of MIktex. I don’t have tiny tex 
installed (nor can I because I need the full MIkTex for other work) .


Best,
Claire

[[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] Makefile generator - please comment

2018-08-14 Thread Michal Burda
Dear R users,

I would like to ask you for comments on whether you find interesting a
package that would help you generate Makefiles for R analytical projects. I
am developing it for some time mainly for myself and now try to decide
whether it is worth an effort to continue and enhance it for wider
audience. Install the most recent version from github, if you wish:

devtools::install_github("beerda/rmake")

The use of the package is very simple. You write your rules as a pipe
similar to Magrittr's operator:

library(rmake)
job <- 'input.csv' %>>% rRule('preprocess.R') %>>% 'data.rds' %>>%
markdownRule('report.Rmd') %>>% 'report.pdf'
makefile(job, 'Makefile')

Thats it. This piece of code generates a complete Makefile that runs
preprocess.R, which reads input.csv and writes data.rds, and then compiles
a markdown report.Rmd, which depends on data.rds, and creates a final
report.pdf. (Of course more complicated pipelines are possible as well as
define dependencies programmatically, also some other features are
implemented already, you can imagine...) I ask the community of whether you
find it useful and whether it is good idea to continue in development of
such package. Recently, some other build tools appeared for R, which seem
very interesting, but which I am not so much experienced with (e.g.
"drake"). There are also some other projects with similar purpose, but they
seem more or less abandoned. Any comments are welcome.

Thanks, in advance.

Best regards,

Michal Burda

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