Displaying 20 results from an estimated 28 matches for "objnam".
Did you mean:
objname
2004 Mar 23
3
how to modify variables of another frame (but not global)
Hello!
Maybe "frame" is not the right term in this context.
I explain my problem by example code:
fun2 <- function(objName, add) {
## the object "objName" should be increased by "add",
## but the evaluation should be done in the calling function (here:
fun1)
## ...... what's the right code??
}
fun1 <- function() {
x <- 1
fun2("x", 10) ## should modify "x"...
2007 Feb 23
2
Functions that write functions in R packages
...advice as to which is preferable? (or if there's
a better way I haven't thought of)
My code currently looks like this (experimenting with two ways of
creating the functions)
create_accessors <- function(objects, name, short=NULL) {
lapply(objects, function(x) {
assign(paste(name, x$objname, sep="_"), x$new, pos=globalenv())
if (!is.null(short)) {
eval(
substitute(
f <- function(plot, ...) plot + add(...),
list(
add = as.name(paste(name, x$objname, sep="_")),
f = as.name(paste(short, x$objname, sep=""))
)
), env...
2012 Apr 24
2
load only one object from a .RData file
Hi list,
Is there a way to load one specific object from a .RData file which contains multiple data objects?? Thanks,
...Tao
2007 Mar 06
2
bug: sticky symbol refs? (PR#9555)
...uot;/temp/.RData") # to create it
> attach( "/temp/.RData", pos=2 )
# now source() /temp/myFuns.R in a local env, then copy new objs to search pos 2:
> newEnv <- new.env()
> eval(expression(source(file = "/temp/myFuns.R", local = T)), envir=newEnv)
> for( objName in objects(envir = newEnv, all.names = T) ) {
assign(objName, get(objName, envir = newEnv), pos = 2)
}
> f <- f # copy from pos 2 to workspace; (needed?)
> g <- g # copy from pos 2 to workspace; (needed?)
> f(1) # gives correct answer
[1] FALSE
> g <- function(x) stop(...
2012 Jan 21
1
Enumerate the class of objects
ls() gives me the vector of objects in the workspace
class(objName) gives me the class of objName
class(ls()) just returns character as many times as there are objects.
How do I get a vector of all objects in the workspace?
[[alternative HTML version deleted]]
2013 Mar 20
1
S4 Reference Classes: undesired behavior when calling method '$field()'
...sired when calling
'$field()':
If the field name whose value you're trying to get is *not* a valid
field of the Reference Class, then R doesn't stop there with an error,
but scans through all enclosing environments/frames. The result is
something similar to calling '|get(<objname>, inherits=TRUE)|' when
you'd actually expect something like ' get(<objname>, inherits=FALSE)'
to be the default (at least I do) in order to avoid undesired retrieval
results.
Here's a little illustration of the behavior:
http://stackoverflow.com/questions/15529251...
2018 Feb 25
0
segfault calling SDL_Init with FFI/ MCJIT
...8, argc=4, l=<optimised out>) at dl-init.c:30
#7 _dl_init (main_map=main_map at entry=0x775af0, argc=4,
argv=0x7fffffffdae8, env=0x7fffffffdb10) at dl-init.c:120
#8 0x00007ffff7dec8e2 in dl_open_worker (a=a at entry=0x7fffffffc520) at
dl-open.c:575
#9 0x00007ffff7de7564 in _dl_catch_error
(objname=objname at entry=0x7fffffffc510,
errstring=errstring at entry=0x7fffffffc518,
mallocedp=mallocedp at entry=0x7fffffffc50f,
operate=operate at entry=0x7ffff7dec4d0 <dl_open_worker>,
args=args at entry=0x7fffffffc520) at dl-error.c:187
#10 0x00007ffff7debda9 in _dl_open (file=0x7fffffffc7a...
2015 Feb 16
4
[LLVMdev] Segfault when using llvm-3.6 and OpenGL at the same time on Linux (with mesa, which uses llvm-3.4)
...l_init (env=0xbfffefbc, argv=0xbfffefb4, argc=1,
l=<optimized out>) at dl-init.c:36
#4 _dl_init (main_map=main_map at entry=0x8267e20, argc=1, argv=0xbfffefb4,
env=0xbfffefbc) at dl-init.c:126
#5 0xb7ff0e8e in dl_open_worker (a=0xbfffe59c) at dl-open.c:577
#6 0xb7fecc26 in _dl_catch_error (objname=objname at entry=0xbfffe594,
errstring=errstring at entry=0xbfffe598, mallocedp=mallocedp at entry=0xbfffe593,
operate=operate at entry=0xb7ff0b90 <dl_open_worker>,
args=args at entry=0xbfffe59c) at dl-error.c:187
#7 0xb7ff0684 in _dl_open (file=0xbfffe7b4
"/usr/lib/i386-linux-gnu/...
2006 Dec 21
1
A problem with "copy()" in the svIO package
Hi R-users:
When I type the following code in R, using
the svIO package I got a problem only with
the "latex" type option.(With "raw", "ascii" and
"html" options, it works fine).
x<-1:50
copy('x', type='latex', objname='x')
Erro en file.info(fn <- c(...)) : argumento del nombre de archivo inv?lido
Thank you for your help.
Kenneth
--
2010 Nov 24
1
diverting output from nested loops
Dear List,
I have a series of nested loops with the structure shown below, and I am
struggling to figure out how to divert output to folders created with
dir.create() within the loops.
What I need is for the output to end up as topNameK/subNameL/objNameM.pdf;
what I get instead is a series of directories topNameK/, directories
subNameL/, and files objNameM.pdf, all in the working directory. Any hints
on how to do this will be much appreciated!
Many thanks in advance,
Lara
for (K in ...){
... create object ...
topDirName <- as.cha...
2011 Aug 26
2
eRm/raschsampler error message
Hi, I am running the non-parametric rasch model tests using eRm. I have a
reasonably large dataset for this type of exercise (110 items, 248 persons).
I run:
> allb2=as.matrix(allb)
> rsample <- rsampler(allb2, ctr)
> t102<-NPtest(rsample, method="T10") #global test, subgroup inv
and receive error message as follows.
"Error in m[idx1, idx2] <- 1 : subscript out
2009 Jul 30
3
Looping through R objects with $ operator and tags
Hi all,
Suppose I want to set the values in a column to the log of the values
of another column like so:
object$LogDist <- log10(object$Distance)
How do I loop through the objects if I have object1, object2, etc to
perform this function?
object1$LogDist <- log10(object1$Distance)
object2$LogDist <- log10(object2$Distance)
object3$LogDist <- log10(object3$Distance)
I was trying to
2011 Feb 03
3
get caller's name
Hi,
Suppose a function that checks an object:
stop.if.dims <- function(x) {
if (! is.null(dim(x))) {
stop("cannot handle dimensional data")
}
}
This would be used by other functions that can only work with
dimensionless objects. The problem is the error message would need to
include the name of the function that called stop.if.dims, so that the
user knows which function got
2005 Feb 13
5
Select Enumerated Values with FormOptionsHelper
Hey,
I''m new, so apologies if I''ve overlooked obvious resources or violated
any etiquette rules for this list.
Since rails does not support the MySQL enum data type, I''m following
David''s advice of using a varchar and storing the valid values in the
application:
http://one.textdrive.com/pipermail/rails/2005-January/001536.html
So here''s my
2011 Jul 11
4
Save generic plot to file (before rendering to device)
I am looking for a way to save a plot (graphics contents) to a file after the
plot has been calculated but before it has been rendered. More specifically,
assume that I made a plot that took a very long time to produce, I would
like to save this plot to a generic file that I can later, on a different
machine, render to either PDF, PNG, SVG using the usual R graphics devices,
without recalculating
2011 Jul 11
4
Save generic plot to file (before rendering to device)
I am looking for a way to save a plot (graphics contents) to a file after the
plot has been calculated but before it has been rendered. More specifically,
assume that I made a plot that took a very long time to produce, I would
like to save this plot to a generic file that I can later, on a different
machine, render to either PDF, PNG, SVG using the usual R graphics devices,
without recalculating
2016 Dec 13
2
syntax difference clusterExport in parallel and snow
We got some errors and eventually figured out that
parallel::clusterExport second argument is "varlist" while in
snow::clusterExport it is "list".
The user had loaded parallel first, but did something else which
inadvertently loaded snow, then clusterExport failed because we had
"varlist" and not "list".
Are these different on purpose?
pj
--
Paul E.
2007 Nov 16
1
Exponential Smoothing for ggplot2's stat_smooth()
Hello everyone,
I was wondering if anyone was aware of a way in which I could use ggplot's
stat_smooth() function for add an exponential moving average.
I was thinking that I could maybe use something like:
>myggplot + stat_smooth (method = 'HoltWinters( data , .9 , 0, 0)')
but my efforts were futile.
Perhaps there is a way to write my own custom method to throw into
2018 Sep 10
2
OpenJDK8 failed to work after compiled by LLVM 8 for X86
...call_init(env=0x7fffffffdca0,
argv=0x7fffffffdc88, argc=0x2, l=<optimized out>)
[#7] 0x7ffff7de7eab → Name: _dl_init(main_map=0x602190, argc=0x2,
argv=0x7fffffffdc88, env=0x7fffffffdca0)
[#8] 0x7ffff7dece46 → Name: dl_open_worker(a=0x7fffffff97e0)
[#9] 0x7ffff7de7c44 → Name: _dl_catch_error(objname=0x7fffffff97d0,
errstring=0x7fffffff97d8, mallocedp=0x7fffffff97cf,
operate=0x7ffff7decae0 <dl_open_worker>, args=0x7fffffff97e0)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
0x00007ffff6ae2f5b in NativeCallStack::NativeCa...
2011 Nov 08
3
lapply to list of variables
Hi
Can someone help me with this?
How can I apply a function to a list of variables.
something like this
listvar=list("Monday","Tuesday","Wednesday")
func=function(x){x[which(x<=10)]=NA}
lapply(listvar, func)
were
Monday=[213,56,345,33,34,678,444]
Tuesday=[213,56,345,33,34,678,444]
...
in my case I have a neverending list of vectors.
Thanks!