Displaying 20 results from an estimated 500 matches similar to: "Making parent.env<- an error for package namespaces and package imports"
2023 Nov 15
1
saveRDS()/readRDS() on environments
Dear r-devel,
I was surprised to see that saveRDS() and readRDS() work quite well with
environments, see below:
```
z <- 3 # in global env
y <- new.env()
y$a <- 1
x <- new.env(parent = y)
x$b <- 2
saveRDS(x, "x.RDS")
# in a new session
x <- readRDS("x.RDS")
y <- parent.env(x)
x$b
#> [1] 2
y$a
#> [1] 1
parent.env(y)
#> <environment:
2007 Nov 27
0
Working with one model from another
Hi all,
I have some code where I''d like to set up an instance of a non-database
model from another, ActiveRecord, model in order to use some custom
methods on a string, without mixing extra methods into the String class.
I understand this might be less-than-sensible as models should normally
stand on their own..?
My two models:
#######################
# models/qualified_name.rb #
2010 Dec 17
2
newbie question on str output
Hi!
Here is some output from an str command:
> str(CO2)
Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and
'data.frame': 84 obs. of 5 variables:
$ Plant : Ord.factor w/ 12 levels "Qn1"<"Qn2"<"Qn3"<..: 1 1 1 1 1 1 1 2
2 2 ...
$ Type : Factor w/ 2 levels "Quebec","Mississippi": 1 1 1 1 1 1 1 1 1 1
...
$
2006 Mar 21
7
Nuube Sequence problem
In my database the id for a field is 810. RoR thinks that it is 809.
My log file (below) shows that just before the insert it grabs the next
sequence value. I dont think it should do that. This causes problems
further down the line when trying to access the Person object.
Development Log file :
"SQL (0.016000) select people_seq.nextval id from dual
Person Create (0.015000) INSERT
2008 May 06
3
a R_PV problem
Dear all,
When using gdb to debug my C code, I use R_PV to show the content of
SEXP variables:
SEXP sexp; // it is a data.frame
SEXP colNames = getAttrib(sexp, R_NameSymbol);
A strange thing is that after halting the program:
(gdb) p R_PV(colNames)
does not show the content of colNames. I am positive my code is right
because if I insert "PrintValue(colNames);" in the c code,
2016 Aug 05
2
Extra copies of objects in environments when using $ operator?
My understanding is that R will not make copies of lists if there is
only one reference to the object. However, I've encountered a case
where R does make copies, even though (I think) there should be only
one reference to the object. I hope that someone could shed some light
on why this is happening.
I'll start with a simple example. Below, x is a list with one element,
and changing that
2006 Oct 15
1
Feature request: names(someEnv) same as ls(someEnv)
Hi,
I would be nice if names() returned the equivalent of ls() for
environments.
--- a/src/main/attrib.c
+++ b/src/main/attrib.c
@@ -687,6 +687,8 @@ SEXP attribute_hidden do_names(SEXP call
s = CAR(args);
if (isVector(s) || isList(s) || isLanguage(s))
return getAttrib(s, R_NamesSymbol);
+ if (isEnvironment(s))
+ return R_lsInternal(s, 0);
return R_NilValue;
}
2007 Sep 20
1
copying promise
1. Is there some way to copy a promise so that the copy has the same
expression in its promise as the original. In the following we
y is a promise that we want to copy to z. We
want z to be a promise based on the expression x since y is a
promise based on the expression x. Thus the answer to the code
below is desired to be z=2 but its 1, 1 and y in the next three
examples so they are not the
2019 Apr 19
1
selftest: Perl error "Insecure $ENV{ENV} while running setgid at /home/user/src/samba-git/samba/source3/script/tests/printing/modprinter.pl line 138."
In my environment the selftest for samba3.rpc.spoolss.printer was
failing at source3/script/tests/printing/modprinter.pl(138)
with the Perl error in subject:
Insecure $ENV{ENV} while running setgid at
/home/user/src/samba-git/samba/source3/script/tests/printing/modprinter.pl
line 138
code is:
==============================
delete @ENV{'BASH_ENV'};
$ENV{'PATH'} =
2008 Jan 04
1
Evaluating R expressions from C
I am currently puzzled by a passage in the R Extensions manual, section 5.10:
SEXP lapply(SEXP list, SEXP expr, SEXP rho)
{
R_len_t i, n = length(list);
SEXP ans;
if(!isNewList(list)) error("`list' must be a list");
if(!isEnvironment(rho)) error("`rho' should be an environment");
PROTECT(ans = allocVector(VECSXP, n));
2011 Jan 11
1
as.environment.list provides inconsistent results under torture
Hello,
Using R-devel (rev 53950), I get inconsistent results with
as.environment( VECSXP ) when gctorture is on.
Consider:
a <- list( aa = rnorm, bb = runif )
gctorture(TRUE)
as.environment( a )
The last line sometimes produces the correct environment, but sometimes
I get errors. Here are the three situations:
# good
> as.environment( a )
<environment: 0x100b1c978>
# not good
2006 Oct 24
1
test env. differs from development env, tests breaking
I just got a new PC at work. My project files were copied from my old
drive. Just to be sure, though, I have erased them and pulled them back
down from source control.
My development database server is MySQL
My test database server is sqlite3
I am having a confusing issue: tests are failing and errors are
happening that weren''t happening before. Furthermore, they aren''t
2016 Aug 05
0
Extra copies of objects in environments when using $ operator?
On Fri, 5 Aug 2016, Winston Chang wrote:
> My understanding is that R will not make copies of lists if there is
> only one reference to the object. However, I've encountered a case
> where R does make copies, even though (I think) there should be only
> one reference to the object. I hope that someone could shed some light
> on why this is happening.
>
> I'll start
2015 Jan 14
2
Is the tcltk failure in affylmGUI related to R bug 15957
I maintain the package affylmGUI. It works when installed on many
previous versions of R. I have today tested exactly the same code under
R-2.15.3, R-3.0.2, R-3.1.0, R-3.1.1, R-3.1.2 and R-devel.
I have also tested the versions of affylmGUI downloaded by biocLite for
each version of R and the same result applies.
I have no errors under 2.15.3, 3.0.2, 3.1.0 and 3.1.1. The following
error
2006 May 16
2
Pass env var from Apache to Mongrel?
I use Apache to serve the static pages and let Mongrel handle Rails
requests via mod_rewrite/proxy. Apache RewriteRule can set
environment variable on the fly, and this is one of the features I
used, set an env var based on domain name.
I used to use SCGI Runner which was fine as the env var was passed to
Rails via scgi protocol. I seems can''t find a way to set env var in
Mongrel on
2007 Sep 10
1
Asked for a remote server ? nil, ENV["FERRET_USE_LOCAL_IN...
Hello,
I know this subject as been talked many time, but i can not figure out
how to get rid of this...
ENV : ruby 1.8.4, ferret 0.11.4, acts_as_ferret 0.4.1 under win32
Error : Asked for a remote server ? nil, ENV["FERRET_USE_LOCAL_INDEX"]
is nil, looks like we are not the server Will use local index.
My application is working find, with 4 mongrels, but i got this message
on
2007 Sep 08
0
rspec_on_rails - necessary to force "test" env?
Hi all
rspec_on_rails/lib/spec/rails.rb starts:
------
dir = File.dirname(__FILE__)
require ''application''
silence_warnings { RAILS_ENV = "test" }
------
That force into "test" environment is causing me trouble and I''ve
commented it out.
Why? I''m testing a plugin, and have a sort of mini rails app that I
use for the specs. The
2006 Nov 04
0
PostgreSQL ActiveRecord default localized date assigned in test env
Hi,
today I''ve configured an XUbuntu as workstation (ok I know...).
Using the following packages to make Rails interact with Postgres:
ii libpgsql-ruby1.8 0.7.1-7
ii postgresql-8.1 8.1.4-0ubuntu1
using rails 1.1.6 from gems.
The problem came up just on the testing environment, when I save a
model I get a:
ActiveRecord::StatementInvalid:
2006 Aug 04
0
Need to set production env route for images & stylesheets?
When manually editing my files for production deployment do I need to
edit .htaccess or routes.rb to include the images and stylesheets
directories so they''re still found like in my local development
environment?
I''m FTP''ing my "appname" directory to my hosting service to deploy.
Unfortunately they don''t allow ssh/capistrano access and have no
2006 Aug 04
0
Re: Passing env var from Apache to Mongrel
Hi Yan,
If you just need to access the env var which doesn''t change like
SERVER_NAME, you should be able to access it directly using "request".
However, if your env var is dynamicly set, you can try my way.
I use mod_rewrite to proxy to Mongrel. In your httpd.conf (you need mod_header)
RequestHeader set X_YOUR_ENV your_value
And in Rails access it by