Re: [R] issue with Rcmdr

2020-01-09 Thread Norm Matloff


> Message: 14
> Date: Wed, 8 Jan 2020 09:59:56 -0800
> From: Bert Gunter 
> To: Norm Matloff 
> Cc: R-help 
> Subject: Re: [R] issue with Rcmdr
 
> ... and even more generally, is generally misleading. ;-)
 
> (search "problems with R^2" or similar for why).
 
> Bert Gunter

I was addressing the OP's issue of computing R^2.  Its value in analysis
is a separate question.  If one's goal is prediction, it arguably is
fairly good providing we avoid overfitting.  If our goal is inference,
R^2 still is informative, but limited.

Norm

__
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] issue with Rcmdr

2020-01-08 Thread Norm Matloff
Glad to hear it now works for you.  But speaking more generally, note that 
R-squared is the squared correlation between the predicted Y and actual Y 
values.  E.g.

lmout <- lm(y ~ x)
print(cor(lmout$fitted.values,y)^2)

One can use this in any regression setting, even machine learning methods.

Norm

__
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] book on parallel programming

2014-02-01 Thread Norm Matloff
I'm about halfway finished writing a book titled, Parallel Computation
for Data Science:  with Examples in R and Beyond, to be published later
this year by Chapman and Hall.

I'm making a rough draft of the first half of the book available on the Web:

http://heather.cs.ucdavis.edu/paralleldatasci.pdf

Your comments and suggestions are welcome, in fact very much hoped-for.
I took this approach when I wrote my R programming book, and found it
very helpful to me, and of much value to people who downloaded it.
Hopefully the same will be true here.

Norm Matloff

__
R-help@r-project.org mailing list
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] novel graphics package

2013-09-18 Thread Norm Matloff
I've developed a new graphics library, BDGraphs, designed for big
data, meaning any data large enough to cause major screen clutter and
overplotting if the points are plotted individually.

The library includes a novel approach to parallel coordinates, and some
methods I introduced in my JSM talk last month.

I'm posting this message because I'd like to get feedback from people
before I put the package on CRAN.  If you're interested, please go to 

http://heather.cs.ucdavis.edu/bdgraphs.html 

The package is there for downloading, and the Examples page shows
several examples with pictures.

Norm Matloff

__
R-help@r-project.org mailing list
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] Split the work for many cores

2012-05-12 Thread Norm Matloff
One replier worried about doing multiple operations on the graphics
device in parallel.  To avoid this, try saving the output of your plot
function instead of immediately displaying it (if the function allows
this).  Then display everything when you're all done.

Norm Matloff

To: Alaios ala...@yahoo.com
Subject: Re: Split the work for many cores
In-Reply-To: 1336655568.56888.yahoomail...@web120106.mail.ne1.yahoo.com
References: 1336655568.56888.yahoomail...@web120106.mail.ne1.yahoo.com

In gmane.comp.lang.r.general, you wrote:
 Dear all,
 I am using my code the vgram.matrix of packets fields. I have around 500 
 matrices that I need to pass inside that function and then plot those results.

 Even though my system has 16 cores is quite clear that I am only using one of 
 those.
 Would it be able to skip these 500 tasks to the 16 cores, with each 
 processor having around 4 matrices to process?

 What would you suggest me doing?

 Regards
 Alex

   [[alternative HTML version deleted]]


__
R-help@r-project.org mailing list
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] Discrete Event Simulation problem

2012-02-13 Thread Norm Matloff

Unfortunately, I don't have time to read your code, but if it is any
help, I have general discrete event simulation code as an example in my
book.  I've posted the code at

http://heather.cs.ucdavis.edu/DES.R

Norm Matloff

__
R-help@r-project.org mailing list
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] new R debugging tool

2011-10-30 Thread Norm Matloff
Rainer wrote:

*  On Thu, Oct 20, 2011 at 12:22 AM, Norm Matloff
*  matl...@cs.ucdavis.eduwrote:
*  
*  
*   I've developed a new R debugging tool, debugR, available at
*   http://heather.cs.ucdavis.edu/debugR.html
*  
*   This basically replaces my edtdbg, which I will no longer be
*   supporting.
*   The new tool is now decoupled from one's text editor, and has a lot
*   more
*   features than edtdbg did.
*  
*  
*  Sounds interesting. Do I have to write a script file for debugging, or
*  is
*  there an option to run it from within R to debug a function instead of a
*  script?
*  
*  Rainer

One does indeed basically debug at the function level (or set of
functions), as desired.  The user specifies on the command line a file
in which those functions reside.  (In time, I can broaden this.)

The best way to see the operation is to try the Quick Start.  It really
IS quick!  Just go to http://heather.cs.ucdavis.edu/debugR.html where
I've now included the Quick Start.

I hope to write up a longer example for Tal's e-newsletter.

Norm

__
R-help@r-project.org mailing list
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] new R debugging tool

2011-10-19 Thread Norm Matloff

I've developed a new R debugging tool, debugR, available at
http://heather.cs.ucdavis.edu/debugR.html 

This basically replaces my edtdbg, which I will no longer be supporting.
The new tool is now decoupled from one's text editor, and has a lot more
features than edtdbg did.

Try it!  Feedback is encouraged, of course.

Norm Matloff

__
R-help@r-project.org mailing list
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] running R commands asynchronously

2011-06-13 Thread Norm Matloff
On 06/10/2011 02:29 PM, Richard M. Heiberger wrote:

 I am interested in running R commands asynchronously...

You can do this with my Rdsm package on CRAN.

Set up 2 Rdsm clients, which I'll call A and B.  Use client A as you
main R session, where you do most of your work, but start your
asynchronous process in B, writing to memory shared by A and B.

The code at B would look like:

   run task B, writing results to shared variable X[1] when done

The code at A would look like:

   do various unrelated tasks
   while (X[1] == 0) ;  
   use X[1]

Norm Matloff

__
R-help@r-project.org mailing list
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] conversion of matrix into list

2011-06-03 Thread Norm Matloff
Martin Spindler wrote:

 I have a matrix X which consists of 2 columns. I would like to convert this
 matrix into a list where every entry of the list consists of a single row of
 the matrix.

Here's another way besides split():

# returns a list of the matrix m's rows (rowcol=1) or columns
mat2lst - function(m,rowcol=1) {
   if (rowcol == 1) m - t(m)
   dm - as.data.frame(m)
   as.list(dm)
}

This seems to be faster than the split() approach for columns, but
slower for rows.  Apparently the transpose operation makes the
difference.  (You could try investigating via Rprof().)

Norm Matloff

__
R-help@r-project.org mailing list
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] GUI's and R background processes

2010-12-16 Thread Norm Matloff

Anne, you can accomplish your goal by using my Rdsm package, which adds
a threads-like capability to R.  You can download it from CRAN.  

Look in particular in the examples/ directory.  The file WebProbe.R is
pretty much exactly the same usage that you want.  Look at Auction.R
too. 

You may also find my UseR! presentation on Rdsm to be helpful,
user2010.org/slides/Matloff.pdf

You could do the same thing, though less directly and I believe less
conveniently, using some of the packages Louis mentioned, as well as
bigmemory.

Norm Matloff

__
R-help@r-project.org mailing list
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] Significance of the difference between two correlation coefficients

2010-12-02 Thread Norm Matloff
Adaikalavan Ramasamy wrote:

 Using the info from that website, I can code up the following to give
 the two-tailed p-value of difference in correlations:
 
   diff.corr - function( r1, n1, r2, n2 ){
 ...

William Revelle also mentioned the r.test in the psych package.

I would add here that inference on second-order quantities, such as
correlation coefficients and variances, is not robust to the assumption
of a normally-distributed population.  (Inference on first-order
quantities such as means and regression coefficients, IS pretty robust
to that assumption.) A good general alternative is the bootstrap,
implemented in R in the boot package.

Norm Matloff

__
R-help@r-project.org mailing list
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] binary tree construction in R

2010-10-06 Thread Norm Matloff
On Tue, Oct 05, 2010 at 06:13:04PM -0400, Mike Marchywka wrote:
 
 I guess it wouldn't be too far a field to discuss benefits
 of data stucture exploration in R vs cpp or java- Especially
 for something like this where you may want to time it in a multithreaded
 setting- you can always instrument something like that, collect lots
 of monte carlo results, and then import the statistical data into R
 for analysis I would think. 

This is fairly common--do your data collection in another language, then
analyze it in R.

R has nice interfaces to other languages, e.g. Python and C, so you can
do this directly rather than writing to a file in one language and then
reading it from R.

For a multithreaded setting, see the various approaches that have been
developed, at

http://cran.r-project.org/web/views/HighPerformanceComputing.html

However, in my opinion, these work well only for embarrassingly
parallel applications.  For the other apps, probably including yours,
you may need to go to C.

Norm

__
R-help@r-project.org mailing list
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] binary tree construction in R

2010-10-05 Thread Norm Matloff
MK wrote:

 Hi all, 

 I'm very new to R and I'm trying to construct a threaded binary tree using
 recursive functions. 

 I'm very confused was wondering if anyone had any R sample code they would
 share. I've come across a lot of C++ code(nothing in R) and this is not
 helping. 

 best, 

 MK

Not sure what you mean by a threaded binary tree, but I am enclosing
code below.  It is from my forthcoming book on software development in
R.

Two caveats:

1.  It hasn't been checked yet.  There may be bugs, inefficiencies etc.

2.  It does search and insert, not delete.

Norm Matloff

# routines to create trees and insert items into them are included
# below; a deletion routine is left to the reader as an exercise

# storage is in a matrix, say m, one row per node of the tree; a link i
# in the tree means the vector m[i,] = (u,v,w); u and v are the left and
# right links, and w is the stored value; null links have the value NA;
# the matrix is referred to as the list (m,nxt,inc), where m is the
# matrix, nxt is the next empty row to be used, and inc is the number of
# rows of expansion to be allocated when the matrix becomes full

# initializes a storage matrix, with initial stored value firstval
newtree - function(firstval,inc) {
   m - matrix(rep(NA,inc*3),nrow=inc,ncol=3)
   m[1,3] - firstval
   return(list(mat=m,nxt=2,inc=inc))
}

# inserts newval into nonempty tree whose head is index hdidx in the
# storage space treeloc; note that return value must be reassigned to
# tree; inc is as in newtree() above
ins - function(hdidx,tree,newval,inc) {
   tr - tree
   # check for room to add a new element
   tr$nxt - tr$nxt + 1
   if (tr$nxt  nrow(tr$mat))
  tr$mat - rbind(tr$mat,matrix(rep(NA,inc*3),nrow=inc,ncol=3))
   newidx - tr$nxt  # where we'll put the new tree node
   tr$mat[newidx,3] - newval
   idx - hdidx  # marks our current place in the tree
   node - tr$mat[idx,]
   nodeval - node[3] 
   while (TRUE) {
  # which direction to descend, left or right?
  if (newval = nodeval) dir - 1 else dir - 2
  # descend
  # null link?
  if (is.na(node[dir])) {
 tr$mat[idx,dir] - newidx
 break
  } else {
 idx - node[dir]
 node - tr$mat[idx,]
 nodeval - node[3] 
  }
   }
   return(tr)
}

# print sorted tree via inorder traversal
printtree - function(hdidx,tree) {
   left - tree$mat[hdidx,1]
   if (!is.na(left)) printtree(left,tree)
   print(tree$mat[hdidx,3])
   right - tree$mat[hdidx,2]
   if (!is.na(right)) printtree(right,tree)
}

__
R-help@r-project.org mailing list
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] Why is vector assignment in R recreates the entire vector ?

2010-09-02 Thread Norm Matloff

Tal wrote:

 A friend recently brought to my attention that vector assignment actually
 recreates the entire vector on which the assignment is performed.
...

I brought this up in r-devel a few months ago.  You can read my posting,
and the various replies, at

http://www.mail-archive.com/r-de...@r-project.org/msg20089.html

Some of the replies not only explain the process, but list lines in the
source code where this takes place, enabling a closer look at how/when
duplication occurs. 

Norm Matloff

__
R-help@r-project.org mailing list
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] Question regarding significance of a covariate in a coxme survival

2010-08-31 Thread Norm Matloff
In 2010-08-30, C. Peng button...@hotmail.com wrote:

 What statistical measure(s) tend to be answering ALL(?) question of
 practical interest?

None.  All I had said was that significance testing doesn't really
answer any questions of practical interest.  Unfortunately, that doesn't
mean there's something to answer all such questions.

In the regression case brought up by the original poster (that was Cox
regression, but the principle is the same), prediction-oriented measures
such AIC or cross-validation directly address the question of interest,
if that question is predictive ability.

In general, one should at the very least form confidence intervals
instead of significance tests.  In the case in which tests are
demanded, e.g. medical journals, replace instead of by in addition
to.

Norm

__
R-help@r-project.org mailing list
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] Question regarding significance of a covariate in a coxme survival

2010-08-29 Thread Norm Matloff
Using a p-value to make any kind of decision is questionable to begin
with, and especially unreliable in choosing covariates in regression.
Old studies, e.g. by Walls and Weeks and by Bendel and Afifi, have shown
that if predictive ability is the criterion of interest and one wishes
to use p-values for deciding whether to include a covariate, one should
set the p-value bar very large, at 0.25 and even 0.40.

By contrast, methods such as AIC are aimed at avoiding overfitting, by
penalizing models with large numbers of covariates.  Same for Mallows'
Cp, cross validation etc.

So, the p-value and AIC are answering quite different questions, and
thus should not be expected to give the same or even similar results.
But, worse than that, many point out that p-values tend not to be
answering ANY question of practical interest.

It's a shame that the use of p-values is so entrenched.  I can expand on
this, with references, if there is interest.

Norm Matloff
Professor of Computer Science (formerly Statistics)
University of California, Davis

__
R-help@r-project.org mailing list
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] ANNOUNCE--Rdsm package, a threads-like environment for R

2010-03-11 Thread Norm Matloff
Guo-Hao Huang wrote:

 Date: Thu, 11 Mar 2010 14:55:35 +0800
 From: Guo-Hao Huang guohao.hu...@gmail.com
 To: Norm Matloff matl...@cs.ucdavis.edu
 Cc: r-help@r-project.org
 Subject: Re: [R] ANNOUNCE--Rdsm package, a threads-like environment
   for R
 
 I am interested in Rdsm package, but I have no idea about how to use it.
 Where can I find examples?
 
 regards
  
 Guo-Hao Huang
 
There are examples there in the package, in the examples/ directory.
The file examples/README will tell you what to do in quick-start form.

Also, after loading the Rdsm library, type 

  help(Rdsm)

at the R interactive prompt, for further information.  If you have further
questions, feel free to contact me.

Norm

__
R-help@r-project.org mailing list
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] ANNOUNCE--Rdsm package, a threads-like environment for R

2010-03-10 Thread Norm Matloff

My long-promised Rdsm package is now on CRAN.  Some of you may recall
that I made a prototype available on my own Web page last July.  This is
the official version, much evolved since I released the prototype.

The CRAN description states:  

   Provides a threads-like programming environment for R, usable both on
   a multicore machine and across a network of multiple machines. The
   package gives the illusion of shared memory, again even across
   multiple machines on a network.

This is based on a similar package I wrote for Perl back in 2002.

Rdsm should complement the bigmemory package written by Mike Kane and
Jay Emerson.  As noted above and in my July announcement for my
prototype, Rdsm works across a network of machines, while bigmemory is
limited to multicore platforms.  On the other hand, bigmemory is capable
of handling huge data structures, which Rdsm is not.  Rdsm is intended
for parallel/distributed computing, while bigmemory is currently used
primarily for the problems its name implies.  However, if bigmemory is
used as a parallel R vehicle on a multicore machine, it may be faster
than Rdsm for some applications, given its direct use of bare shared
memory; typically, though, they should provide similar performance in
such contexts.  By the way, I have a prototype of an infrastructure
package to facilitate using bigmemory as a parallel R engine. 

Norm Matloff
University of California, Davis

__
R-help@r-project.org mailing list
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] ANNOUNCE: edtdbg debugging tool

2010-01-22 Thread Norm Matloff
My edtdbg debugging tool is now on CRAN, at 

http://cran.r-project.org/web/packages/edtdbg/index.html

I've added a few new commands since the last time I announced the
package here.  I'll enclose command list at the end of this message.

Currently the package is implemented for Vim.  I have a volunteer to
adapt it to Emacs, so I'm hopeful it will be usable for Emacs fans
later.

I'm still looking for time to prepare my Rdsm parallel R package for
submission to CRAN.  The code is all ready, though, so if anyone wishes
to obtain it, just let me know.

Norm

Here are the edtdbg commands, typed within the editor:

* ,dbg

  Start edtdbg.

* ,dbgu

  Exit ‘edtdbg’.

* ,src

  Tell R to source the file you have in your current Vim
  buffer.

* [

  If you are in the browser in your R window, hitting the
  left-bracket key runs the browser's n command.  Your Vim
  cursor will then automatically move to the new line, i.e. to
  the one that the browser will now be on.

* ]

  Same as [, but runs the c command instead of n.

* ,dsp

  This toggles display. When display is on, the values of the
  current function's arguments and local variables will appear
  in the R window after each debug step.

* ,mom

  This displays the arguments and local variables in the parent
  function, i.e. the next-higher frame in the call stack.  The
  action occurs once per time you invoke the command.

* ,glb

  This displays all global variables.  The action occurs once
  per time you invoke the command.

* ,br

  This sets a breakpoint at the line after the current cursor
  line of the editor. This is done by inserting a call to
  browser() and then re-sourcing the code at R.

* ,bru

  This undoes the last action of ,br thus removing the last
  breakpoint. If you wish to remove a different breakpoint, you
  need to do that manually.

* ,dbga

  This tells R to set the debug status on all of your functions,
  i.e. call debug() on them.

* ,dbgf

  This tells R to display a list of our functions with the
  status on each, regarding whether the function is currently
  the subject of a debug() call. The user can then specify on
  which functions to toggle that status.

* ,q

  This exits the browser, i.e. emits a Q command to the
  browser.

* ,dt

  This executes the R call you've previously stored in the Vim
  variable g:TestRun.

  For example, suppose you are testing your code via a call
  test(5,12,13).  You can store that by typing
  
   :let g:TestRun = test(5,12,13)
   

  in Vim.  Then anytime you want to run the test, hit ,dt.

__
R-help@r-project.org mailing list
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] new, much improved version of edtdbg debugging tool

2009-12-22 Thread Norm Matloff

A few weeks ago, I released my package edtdbg, which integrates R's
debug() with your text editor.  At the time, I said I'd release a
version with more features in a couple of days.  Well, it's taken a
while, as I've experimented with various approaches, but I'm now releasing
the new version, introducing the new features I had in mind then and
some I've thought of since then.

The current features include:

   * Code Tracking: As one steps from line to line of code using the
 debugger, the cursor in the editor will always follow, i.e. it
 will alway be on whatever line the debugger is on.

   * Variable Display: One can enable automatic display of the current
 arguments and local variables in the R window.

   * Quick Breakpoints: One can quickly and conveniently set
 breakpoints.

   * Toggling of Function Debugging Status:  Turn debugging on or off 
 for several functions at once.

The current version is for Vim with vim-r only.  I did write an
Emacs/ESS version, but it started to hang mysteriously, so I am
releasing the Vim/vim-r version only.

The package is downloadable at

   http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/edtdbg.zip

I'd like to thank Jakson and Duncan M. for some useful e-mail exchanges.

Now that this digression is done, I can get back to finishing my Rdsm
parallel R package and uploading it to CRAN.  (Not sure whether edtdbg
is appropriate for CRAN?)

Norm Matloff

__
R-help@r-project.org mailing list
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] Announce: edtdbg, integrating R's debug() with your text editor

2009-12-07 Thread Norm Matloff
The files seem to be inaccessible, and I can't see why.  Neither can my
department Web technician.

So, for the time being, simply go to

http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/

and then download the 3 files as directed.

Meanwhile, I've thought of an interesting enhancement, and a couple of
people have made suggestions as well.  I'll post an enhanced version in
a day or so.

Norm

 Date: Sun, 6 Dec 2009 23:39:06 -0800
 From: Norm Matloff matl...@cs.ucdavis.edu
 Subject: [R] Announce:  edtdbg, integrating R's debug() with your text
   editor
 To: r-help@r-project.org
 
 I've just developed edtdbg, a small package that integrates R's debug()
 with one's text editor.
 
 Excerpt from the README file:
...
 I'm placing the current version of the package at:
 
 http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/edtdbg.tar.gz
 
 http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/edtdbg.zip

__
R-help@r-project.org mailing list
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] Announce: edtdbg, integrating R's debug() with your text editor

2009-12-06 Thread Norm Matloff
I've just developed edtdbg, a small package that integrates R's debug()
with one's text editor.

Excerpt from the README file:

   Goal
   
   The debug() function in R is primitive.   My goal was to make it more
   usable by integrating it with one's text editor.  Hence I wrote the
   package here, edtdbg.  Its features include:
   
   * As one steps from line to line of code using the debugger, the
 cursor in the editor will always follow, i.e. it will alway be on
 whatever line the debugger is on.
   * One can enable automatic display of user-specified variables.
   * One can quickly and conveniently set breakpoints.
   
   Currently the package is implemented only for Vim.  In addition, the
   second and third features require the vim-r plugin for Vim.  Emacs/ESS
   users should easily be able to convert the code; some of the machinery
   is already in the code and in the instructions below.

I'm placing the current version of the package at:

http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/edtdbg.tar.gz

http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/edtdbg.zip

Please give me your comments.  I probably will upload to CRAN at some
point, possibly after an ESS guru contributes the ESS code. :-)

A note on my Rdsm package for parallel R:  The new, much improved
version is just about ready.  I'll be uploading Rdsm to CRAN very soon.

Norm Matloff

__
R-help@r-project.org mailing list
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] Book on R programming

2009-08-31 Thread Norm Matloff
ANJAN PURKAYASTHA wrote:

 Most books on R I come across describe running statistical procedures
 in R.
 Any suggestions on a good book that teaches *programming* in R?
 Thanks,
 Anjan

I'm in the midst of writing such a book right now.  It will be published
early next year, by the whimsically named No Starch Press, a subsidiary
of O'Reilly (the menagenary series on programming languages and
software).  You've seen the NSP series in bookstores, with the yellow
and black motif.  I published a book on debugging with them last year,
with Peter Salzman.

I just checked with NSP, and they say that I can provide the current
manuscript if anyone is interested.  Just sent me an e-mail message
requesting it. 

That current manuscript is about 75% complete.  Obviously, due to its
incomplete state, it likely has various bugs in the code (though I've
run all the code), missed opportunities (i.e. code that could be written
better if I were to make better use of R constructs), and incorrect
statements.  But hopefully there are not many such cases, and it should
be useful to R programmers, both beginning and experienced.  Needless to
say, I would like to hear of any such cases you find.

A bit on the background I bring to this book project:  My PhD was in
Math at UCLA, with a thesis in probability theory and a lot of work in
applied statistics.  I was a founding member of the Dept. of Statistics
at UC Davis, but later moved to form the Dept. of Computer Science.  My
CS research work has often been statistical in nature.  I'm an R user
going way back to the blue book days of S.

Norm Matloff

__
R-help@r-project.org mailing list
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] Rdsm, a DSM package for parallel R programming

2009-07-08 Thread Norm Matloff
As I mentioned last week, I've been developing a package that I call
Rdsm (R distributed shared memory), modeled after a similar package,
PerlDSM, I wrote for Perl some years ago.  It is now in alpha form, so
I'm not uploading to CRAN yet, but it is definitely usable, and I am
releasing it at 

http://heather.cs.ucdavis.edu/~matloff/R/Rdsm

I hope many try it out, and give me some feedback.

Note that the word distributed here means that the memory is not
really shared, but instead is an abstraction, to give the programmer a
shared-memory view even though the program may be running on several
separate machines.  For C/C++ this is generally accomplished by
manipulation of the virtual memory hardware.  For R, I do this by
redefining functions such as [ and [- for a new class.

Rdsm is intended as an alternative for those who favor the shared-memory
view of things.  In the parallel processing community, there has always
been a debate between advocates of the two main programming paradigms,
shared memory and message passing.  Shared memory advocates claim
greater clarity of code, while the message passing people point to that
paradigm's greater flexibility.  I happen to be of the shared-memory
school.  Given the popularity of OpenMP for C/C++/FORTRAN, I believe
Rdsm will be of interest to many for R.  Indeed, in the next few months,
I will be extending Rdsm with functions that give it the look and feel
of OpenMP.

Norm Matloff
UC Davis



- End forwarded message -

__
R-help@r-project.org mailing list
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] queue simulation

2008-12-22 Thread Norm Matloff
 Date: 22-Dec-2008 10:11:28 GMT
 From: Gerard M. Keogh gmke...@justice.ie
 Subject: [R] queue simulation
 To: r-help@r-project.org
 
 Hi all,
 
 
 I have a multiple queing situation I'd like to simulate to get some idea of
 the distributions - waiting times and allocations etc.
 Does R has a package available for this - many years ago there used to be a
 language called simscript for discrete event simulation and I was
 wondering if R has an equivalent (or hopefully with graphics, something
 better!).

To my knowledge, this doesn't exist, but one never knows.  I look
forward to hearing the other responses.

Discrete-event simulation (DES) is generally done under one of two main
world views--event-oriented, process-oriented.  The more popular is
probably the process-oriented view, but it requires something like
threading, which would be problematic in R.  

It would be easy to take the event-oriented view, as it would just
require coding up some kind of priority queue routine.  In fact, a
couple of weeks ago I made a note to myself to do this as an example of
how one could do linked data structures in R.  Again, this view is
considered a poor way to program DES, but if you are interested, feel
free to contact me.

I very much like (and am somewhat involved in the development of) SimPy,
a Python-based DES package.  You could use SimPy for your simulation and
use RPy to access R from SimPy, to take advantage of R's graphics and
statistics facilities.

SimPy is at http://simpy.sourceforge.net/  Also, I have a tutorial on it
at http://heather.cs.ucdavis.edu/~matloff/simcourse.html

Norm Matloff
University of California, Davis

__
R-help@r-project.org mailing list
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.