[Rd] Standalone example to use eval in C (not eval in R)?

2013-05-24 Thread Peng Yu
'eval' is used in optim.c, but it is used along with other things. I'm looking for a standalone example to demonstrate the usage of eval in C. Does anybody have some a simple example? Thanks. -- Regards, Peng __ R-devel@r-project.org mailing list http

Re: [Rd] Is nested namespace supported?

2010-01-09 Thread Peng Yu
On Sat, Jan 9, 2010 at 3:03 PM, Romain Francois wrote: > On 01/09/2010 09:53 PM, Peng Yu wrote: >> >> Could somebody let me know if there is nested name space supported? >> For example, is it possible to define a function in the name space >> 'nested_namespace&#x

[Rd] Is nested namespace supported?

2010-01-09 Thread Peng Yu
Could somebody let me know if there is nested name space supported? For example, is it possible to define a function in the name space 'nested_namespace' which is nested in the name space 'some_namespace'? some_namespace:::nested_namespace:::a_function() I checked Section 1.6 of R-exts.pdf. It se

Re: [Rd] How x[, 'colname1'] is implemented?

2010-01-01 Thread Peng Yu
On Fri, Jan 1, 2010 at 6:52 AM, Barry Rowlingson wrote: > On Thu, Dec 31, 2009 at 11:27 PM, Peng Yu wrote: >> I don't see where describes the implementation of '[]'. >> >> For example, if x is a matrix or a data.frame, how the lookup of >> 'colname1

[Rd] How x[, 'colname1'] is implemented?

2009-12-31 Thread Peng Yu
I don't see where describes the implementation of '[]'. For example, if x is a matrix or a data.frame, how the lookup of 'colname1' is x[, 'colname1'] executed. Does R perform a lookup in the a hash of the colnames? Is the reference O(1) or O(n), where n is the second dim of x? __

Re: [Rd] How to organized code in the R/ directory of a package?

2009-12-10 Thread Peng Yu
e any problems navigating > them (with appropriate tool support).  Just  how many files do you > have? > > Hadley > > On Thu, Dec 10, 2009 at 3:56 PM, Peng Yu wrote: >> I'm making a package, Current, I put all R files in the R/ directory >> in the package (without usi

[Rd] How to organized code in the R/ directory of a package?

2009-12-10 Thread Peng Yu
I'm making a package, Current, I put all R files in the R/ directory in the package (without using subdirectory). This will become a problem when there are many files in the directory. I'm wondering how to use subdirectories in R/? Does 'R CMD INSTALL' install the files in the subdirectories autom

[Rd] Which packages in R use C++?

2009-12-10 Thread Peng Yu
I want to see some working examples on how to call C++ programs from R. Could somebody let me know which R packages mainly use C++ rather than C or Fortran? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Request to add section number to the bookmarks of R pdf documents

2009-12-10 Thread Peng Yu
It will be convenient to add section number to the bookmarks of R documents that are in pdf format. Could somebody take some time add the sections number? Writing R Extensions R Data Import/Export R Language Definition etc. __ R-devel@r-project.org mai

[Rd] Which version of findInterval is used?

2009-12-10 Thread Peng Yu
In an R session, I see the following, which means that findInterval is an R function. > findInterval function (x, vec, rightmost.closed = FALSE, all.inside = FALSE) { if (any(is.na(vec))) stop("'vec' contains NAs") if (is.unsorted(vec)) stop("'vec' must be sorted non-decrea

Re: [Rd] split() is slow on data.frame (PR#14123)

2009-12-09 Thread Peng Yu
I make a version for matrix. Because, it would be more efficient to split each column of a matrix than to convert a matrix to a data.frame then call split() on the data.frame. Note that the version for a matrix and a data.frame is slightly different. Would somebody add this in R as well? split.mat

Re: [Rd] split() is slow on data.frame (PR#14123)

2009-12-09 Thread Peng Yu
On Wed, Dec 9, 2009 at 5:44 PM, Charles C. Berry wrote: > On Wed, 9 Dec 2009, William Dunlap wrote: > >> Here are some differences between the current and proposed >> split.data.frame. > > Adding 'drop=FALSE' fixes this case. See in line correction below. Thank you for the correction. >>> d<-dat

Re: [Rd] Tabs in R source code

2009-12-03 Thread Peng Yu
On Sun, Nov 29, 2009 at 11:18 AM, Duncan Murdoch wrote: > On 29/11/2009 11:50 AM, Peng Yu wrote: >> >> On Sun, Nov 29, 2009 at 10:40 AM, Duncan Murdoch >> wrote: >>> >>> On 29/11/2009 10:58 AM, Peng Yu wrote: >>>> >>>> Some l

Re: [Rd] [R] go back a block of code in history

2009-12-02 Thread Peng Yu
2009/12/2 Uwe Ligges : > > > Peng Yu wrote: >> >> Suppose I run the following code in the R session. At the last prompt >> '>', I want to retrieve the second command (staring with 'y'). But I >> have to type up arrow many times, which is

Re: [Rd] [R] How to quit unwanted execution immediately?

2009-12-01 Thread Peng Yu
there are more or > less regular checks for events such as this one. > If you are using some contributed package, it may be an issue in this > package's source code. > > Best wishes, > Uwe Ligges > > > > > Peng Yu wrote: >> >> Occasionally, I start

Re: [Rd] Tabs in R source code

2009-11-29 Thread Peng Yu
On Sun, Nov 29, 2009 at 10:40 AM, Duncan Murdoch wrote: > On 29/11/2009 10:58 AM, Peng Yu wrote: >> >> Some lines are indented by tabs and some lines are indented by spaces, >> in R source code. This might due to the fact that the source code is >> not from a single per

[Rd] Tabs in R source code

2009-11-29 Thread Peng Yu
Some lines are indented by tabs and some lines are indented by spaces, in R source code. This might due to the fact that the source code is not from a single person. But I think that it is better to enforce a single convention. My editor defaults a tab to 8 spaces. So some source doesn't seem to b

Re: [Rd] How to generate dependency file that can be used by gnu make?

2009-11-17 Thread Peng Yu
e a tool by yourself to parse the R syntax to > resolve your problem. > > On Tue, Nov 17, 2009 at 11:51 AM, Peng Yu wrote: >> On Sun, Nov 15, 2009 at 8:45 PM, Peng Yu wrote: >>> gcc has options like -MM, which can generate the dependence files for >>> a C/C++ file

Re: [Rd] How to generate dependency file that can be used by gnu make?

2009-11-16 Thread Peng Yu
On Sun, Nov 15, 2009 at 8:45 PM, Peng Yu wrote: > gcc has options like -MM, which can generate the dependence files for > a C/C++ file that I can be used by gnu make. I'm wondering if there is > a tool that can generate dependence file for an R script. > > For example, I hav

Re: [Rd] How to compile R with command completion?

2009-09-30 Thread Peng Yu
her up in config.log > to see why it's failing -- do you have LD_LIBRARY_PATH setup to match your > custom location of libs? (Also I notice you are building x86_64 yet the > readline you are showing is in /lib and not in /lib64 -- did you build it > just in 32-bit?) > > Ch

Re: [Rd] How to compile R with command completion?

2009-09-30 Thread Peng Yu
On Wed, Sep 30, 2009 at 9:58 AM, Simon Urbanek wrote: > > On Sep 30, 2009, at 10:13 , Peng Yu wrote: > >> I compiled R-2.9.2 from source on Cent OS. But the compile R program >> does not support command completion. >> >> I get the following configure output

[Rd] How to compile R with command completion?

2009-09-30 Thread Peng Yu
I compiled R-2.9.2 from source on Cent OS. But the compile R program does not support command completion. I get the following configure output that is related to readline. Why 'rl_completion_matches' doesn't exist? How should I make R support command completion? === checking readl