similar to: Question about looking up names

Displaying 20 results from an estimated 8000 matches similar to: "Question about looking up names"

2003 Sep 11
2
(structured) programming style
I find that because R functions are call by value, and because there are no pointer or reference types (a la C++), I am making fairly heavy use of lexical scoping to modify variables. E.g. outer <- function() { m <- matrix(0, 2, 2) inner <- function() { m[2,2] <<- 3 ... } } I am not too pleased with this, as it violates basic rules of structured programming, namely
2005 Aug 18
2
Use of contains in S4 classes
setClass("B", representation=representation("B", extra="numeric)) setClass("B", representation=representation(extra="numeric"), contains="B") Are these the same? If not, how do they differ? What about setClass("B", representation=representation("B", extra="numeric"), contains="B") ? As far as I can
2005 Jun 02
1
Too generic with S4 methods?
I tried the following (relevant excerpt only) setMethod("likelihood", signature(spec="Specification", covs="vector", states="vector"), function(spec, covs, states) { #### setMethod("likelihood", signature(model="Model", path="matrix"), function(model, path) { This
2004 Feb 07
2
R does in memory analysis only?
I wonder if someone would confirm something I'm 99% sure of from the docs and discussion on the list, but can't find stated explicitly: R works only on problems that fit into (real or virtual) memory. Thus, even if you have a problem (e.g., simple regression) that could be solved by doing some operation on each row of a dataset at a time, you can't solve it unless the entire dataset
2010 Nov 17
1
Lexical Scope: How does it work?
Let me start by saying that I am a fan of lexical scoping as a way of increasing confidence in your execution models. I am hoping to move from the now thoroughly debunked "wackyscope" model that used to plague many programming languages over to proper lexical scoping in my puppet configs. I''m just having trouble finding documentation of how this works for puppet. I understand
2003 Jul 17
3
Looking to maximize a conditional likelihood
I want to maximize a conditional likelihood function that is basically logistic conditional on the number of successes within strata. What would be a good starting place for this? A complication is that the denominator includes a term that is the sum over all permutations. Although there is no time dimension to the problem, it's possible a degenerate use of the Cox proportional hazards
2003 May 06
1
Seeking packaging advice
I have 3 questions about creating a package for R, and would appreciate any guidance. 1. Demonstrating the packaged code requires some support code files. It would seem natural to put these in the demo directory, but "Writing R extensions" says files in demo should be suitable for runing from demo(). The support files are not intended to be run from the top level. How should I handle
2003 Nov 05
1
Contributing to the R Extensions documentation
I thought there were some gaps in the R Extensions document; in particular, I was left wondering how to create a list. I think a paragraph on it would be useful. I would be happy to contribute the paragraph, but I'm not sure if there's interest or what the procedure is. Can anyone advise me? Though I was looking at the 1.7.0 version, I just checked 1.8.0 and the relevant section seems
2005 Aug 18
1
problem with repeated formal arguments and ...
I want to add an argument if it is not present. Following the Green Book, p. 337: test <- function(x, ...){ dots <- list(...) if (!hasArg(from)) from <- 0 else from <- dots$from curve(x, from=from, ...) } > test(sin) > test(sin, from=4) Error in curve(x, from = from, ...) : formal argument "from" matched by multiple actual arguments The FAQ says, in
2004 Mar 24
1
snow documentation comments
There are a few points I found unclear or unmentioned in the snow documentation (mostly I looked at the cluster.html web page). I thought I'd mention them here. What is the start up environment for the children? -------------------------------------------------- My best guess at the answer is in parentheses Do they inherit shell variables? (no) Do they inherit variables set in R or other
2023 Mar 19
1
lexical scoping for scripts......
On 19/03/2023 2:55 p.m., akshay kulkarni wrote: > Dear Duncun, > ? ? ? ? ? ? ? ? ? ? ? ? ?What if there is no interactive "session" > running? I will be running my scripts automatically from crontab in Linux. I was talking about the session that is created for the duration of the BATCH run, not some other session that may be running in another process. Sorry for the
2003 Oct 30
4
packaging a package addon
I am trying to package some code that is a tweak to the survival package. When I asked earlier, the list consensus was that it would be best to do this as a separate package, dependent on survival. This is proving a bit tricky. I have some run-time and compile time concerns. Run-time, my R code needs R code from survival, and my C code needs C functions from survival. Will this all be
2023 Mar 19
2
lexical scoping for scripts......
Dear Duncun, What if there is no interactive "session" running? I will be running my scripts automatically from crontab in Linux. THanking you, Yours sincerely, AKSHAY M KULKARNI ________________________________ From: Duncan Murdoch <murdoch.duncan at gmail.com> Sent: Monday, March 20, 2023 12:20 AM To: akshay kulkarni <akshay_e4 at hotmail.com>; R
2023 Mar 19
1
lexical scoping for scripts......
Again, the answer is "interactivity does not matter". On March 19, 2023 12:54:28 PM PDT, akshay kulkarni <akshay_e4 at hotmail.com> wrote: >Dear Jeff, > I will not be running R command in the shell prompt. So there is no banner, no > prompt. Just running "myscript.R" from the shell prompt. or from crontab in Linux. I think you get the
2023 Mar 19
1
lexical scoping for scripts......
Dear Jeff, I will not be running R command in the shell prompt. So there is no banner, no > prompt. Just running "myscript.R" from the shell prompt. or from crontab in Linux. I think you get the context..... thanking you, yours sincerely AKSHAY M KULKARNI ________________________________ From: Jeff Newmiller <jdnewmil at dcn.davis.ca.us> Sent: Monday, March
2023 Mar 19
1
lexical scoping for scripts......
On 19/03/2023 2:33 p.m., akshay kulkarni wrote: > Dear Duncun, > ? ? ? ? ? ? ? ? ? ? ? ? ?thanks for the reply.... > > So when I run a script in the system command line by R CMD BATCH, the > objects created in the script cannot be stored in the workspace ,right? > If yes, how to save them? Moreover, the only way to save the objects > CREATED from the script permanently is
2004 Aug 20
2
Error messages and C
I am calling a C (C++ really) function via the .C interface. Sometimes when things go wrong I want to return an error message. 1. R provides C functions error and warning which look about right. But exactly how does this exit, and in particular what happens with cleaning up, calling C++ destructors, and unwinding the stack? Will I get memory leaks? 2. Before I discovered those functions, I
2003 Oct 02
2
Plot can't forget bad parameters
When I give plot some bad paramaters, it keeps giving me error messages forever after. I think the last time this happened, I even got the error messages for completely unrelated, non-graphical functions. Here's a recent example: > plot(it[[31]][,c(1, 3)], type="b", usr=c(0, 20, -20, 5)) Warning messages: 1: parameter "usr" couldn't be set in high-level plot()
2023 Mar 19
1
lexical scoping for scripts......
Dear Duncun, thanks for the reply.... So when I run a script in the system command line by R CMD BATCH, the objects created in the script cannot be stored in the workspace ,right? If yes, how to save them? Moreover, the only way to save the objects CREATED from the script permanently is to save them to the disk, right? THanking you, yours sincerely, AKSHAY M KULKARNI
2023 Mar 19
1
lexical scoping for scripts......
What do _you_ mean when you use the term "interactive"? Because R distinguishes between executing code in a function and executing code from the global environment, but it does not care whether a person is doing the typing or not. I get the feeling that you think of your R code in terms of "scripts" when you should be thinking of your code in terms of functions. What