similar to: Scoping problem?

Displaying 20 results from an estimated 10000 matches similar to: "Scoping problem?"

1999 Jan 04
1
Names of data frame columns in an apply
Hi, [some background] I have a dataset which describes a number of subjects doing a "scientific discovery". That is, they have to discover the rules underlying a particular domain. To do so, they have to set the levels of 5 variables which leads to a certain outcome. To identify what kind of "experiments" the subjects did, I want to combine these levels into one variable
2001 Feb 21
1
Specification of factors in tapply
After some fiddling around with the tapply command, I discovered that the factors (the INDEX argument) given to tapply must be specified in fastest-cycling first order. The following code shows how I discovered my error: (R version 1.2.1) -o-o-o-o-o- x <- as.data.frame(list(data=c(-9,0,3,1,-9,1,0,-9,0,3,1,-9,1,0), subj=c(rep(1,7),rep(2,7)),
1999 Jan 11
0
Bug in axis(...,tcl=0)?
Hi, first of all, I would like to take this opportunity to thank all of you "answer guys" for giving such detailed answers. I think I've learned about as much from all these answers as from the different S/R documents I've read so far. Anyway, I ran into a incompatability between S and R, that is, R does not know the "ticks=T/F" argument to functions like axis and
2001 Feb 23
0
Prevent killing an ESS *R* buffer unintentionally
A couple of days ago I posted some elisp code that asks the user for confirmation before deleting a process buffer, e.g. the *R* buffer. However, this code was only evaluated if a buffer was killed by means of [C-x k]. The following code does not need to be bound to a particular key, it's internally called by kill-buffer. (Also works if buffer is deleted in other ways, e.g., [C-x C-c].)
2000 Jul 28
2
Loop removal?
Dear all, I've got a quite large dataframe (stor) with rows subject and rt (reaction time). I would like to split the reaction times per subject into 6 bins of equal size. Right now, I'm using the following code: bindata <- function(rt) { bindata <- rep(-1,length(rt)) binwidth <- length(rt)/6 bindata[order(rt)[(0*binwidth)+1:(1*binwidth)]] <- 1
2001 Mar 07
4
R.xpm?
I use AfterStep on Linux. I made an R.xpm file (attached) and put this icon in the "wharf". To invoke R I click on the R icon. I did not find an offical R.xpm, and so I am submitting this one for your collective consideration.... The idea behind the icon is that it looks like a scatterplot, which is "statistical". My main beefs with my R.xpm are that it doesn't have a
2001 Feb 15
1
Re: Question "kill-buffer"
I would be very thankfull for such a solution, too .... "R.E. Darnell" wrote: > > Would introducing a "Are you sure?" question after kill the *R* ( or > whatever) buffer with a hasty C-x k be a popular default > "feature". How can I include this for my own use? > > Thanks > > Ross Darnell --
2003 Aug 10
1
read.spss doesn't work anymore
A couple of months ago, probably using an older version of R, R used to run the following code just fine: library("foreign") data.exp1 <- as.data.frame(read.spss("dataDef.sav")) Issuing the same commands now (after starting R using --vanilla), gives me the following behavior: > library("foreign") > x <- read.spss("dataDef.sav") Error
2004 Dec 09
3
US 2004 Elections map
even for people who didn't like the outcome of the US elections this year, it must have been a joy to see all the nice (and not so nice) graphs that were shown. As an exercise, I recreated the map shown on the NY-Times website [ http://www.nytimes.com/packages/khtml/2004/11/03/politics/ 20041103_px_ELECT_GRAPHIC.html ] If you're interested,
2002 Jul 28
1
[R] bug in unsplit()? (PR#1843)
Hedderik van Rijn <hedderik@cmu.edu> writes: > If the second argument to unsplit is not a simple vector (but a "list > containing multiple lists"), the function seems to have some problems. > > Given a slight modification of the examples in help(split): > > > xg <- split(x,list(g1=g,g2=g)) > > unsplit(xg,list(g1=g,g2=g)) > [1] -0.7877109
1998 Jun 18
3
R-beta: netscape/R interaction
Using netscape 4.03 (or 2.x or 3.x)/ R-0.62.1 with SPARC Solaris 2.4: when netscape is running for help, graphics in R quit with "Color allocation error". Closing netscape removes the problem. netscape does not interfere with other X11 imaging programs including ghostscript and ImageMagick except that it increases the contrast in my mailer windows slightly. (netscape does block
2002 Dec 20
3
Sweave & xtable
I'm trying to get Sweave running for automatic report generation, and it seems to run fine when just using verbatim output. However, I've ran into a problem with xtable. I would like to print the following matrix using xtable: > dim(counts) [1] 19 15 All columns are filled with real/integer numbers > 0 and < 1000. Just typing xtable(counts) gives correct LaTeX output, but
2003 Oct 09
0
Scoping Rules: Summary
Thanks to Andy Liaw, Roger Peng, Thomas Lumley, Brian Ripley and Peter Dalgaard, all of whom addressed my questions or threads arising from them. The full messages were posted to the list so this is a brief summary: Andy Liaw explained the difference between lexical and dynamic scoping and the rationale behind the choice of lexical scoping for R. Roger Peng showed how to modify fnB. Brian
2002 Jul 28
0
[R] bug in unsplit()? (PR#1845)
Hedderik van Rijn <hedderik@cmu.edu> writes: > > Thanks for pointing this out. I think your code should work, although > > I'm slightly uneasy about actually modifying f, so how about > > Just curious, why are you uneasy about that? Does it have side effects? It is largely due superstition, but if you change f before calling split<-() you have split() and
2009 Sep 08
1
optim() argument scoping: passing parameter values into user's subfunction
Dear useRs, I have a complicated function to be optimized with optim(), and whose parameters are passed to another function within its evaluation. This function allows for the parameters to enter as arguments to various probability distribution functions. However, I am violating some scoping convention, as somewhere within the hierarchy of calls a variable is not visible. I will give a
2003 Oct 09
1
Scoping rules
Dear List members: I'm using R1.7.1 (Windows 2000) and having difficulty with scoping. I've studied the FAQ and on-line manuals and think I have identified the source of my difficulty, but cannot work out the solution. For the purposes of illustration. I have three functions as defined below: fnA <- function(my.x) { list(first=as.character(substitute(my.x)), second=sqrt(my.x)) }
1999 Jan 21
2
scoping problem?
Dear R-helpers: (this is part of a bigger program) the following fails as a function, but runs OK if we comment out the fnfn_ function() line. Any hint would be appreciated. -Yudi- R : Copyright 1998, The R Development Core Team Version 0.63.0 Beta (Nov 13, 1998) -- on WIndows3.11 fnfn _ function (m=10,n=10,spar=2) { fn _ function(u,v){ uc_ u-floor(m/2)-1 vc_ v-floor(n/2)-1
1998 Jun 18
0
R-beta: netscape/R interaction [color allocation]
Thanks to Martin Maechler, Douglas Bates, Peter Dalgaard, and Hedderik van Rijn for pointing out the problem is with the color resource demands of the two applications and for their suggested possible solutions. A 24 bit monitor would be ideal and maybe someday I'll have the $$$ to upgrade. "netscape -install" works with the attendant flashing screen color changes from window to
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
Right now, we require the user to supply potential metacontext names in advance, without knowing what the server actually supports until after the connection or nbd_opt_info call is complete. But the NBD protocol also supports a client being able to query what contexts a server supports, including where a client asks with a prefix and the server replies back with all answers that match the
2014 Jan 17
0
[PATCH INCOMPLETE] launch: libvirt: Use C macros to simplify XML generation.
This commit implements some hairy C macros to simplify XML generation. Given the target XML: <cpu mode="host-passthrough"> <model fallback="allow"/> </cpu> The old code would have looked like this: XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "cpu")); XMLERROR (-1, xmlTextWriterWriteAttribute (xo, BAD_CAST