similar to: Constructing an environment from a data.frame

Displaying 20 results from an estimated 60000 matches similar to: "Constructing an environment from a data.frame"

2015 Mar 22
2
robust updating methods
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 WARNING: this is long. Sorry I couldn't find a way to compress it. Is there a reasonable way to design an update method so that it's robust to a variety of reasonable use cases of generating calls or data inside or outside a function? Is it even possible? Should I just tell users "don't do that"? * `update.default()` uses
2015 Mar 24
2
robust updating methods
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 15-03-23 12:55 PM, Thierry Onkelinx wrote: > Dear Ben, > > Last week I was struggling with incorporating lme4 into a package. > I traced the problem and made a reproducible example ( > https://github.com/ThierryO/testlme4). It looks very simular to > the problem you describe. > > The 'tests' directory contains
2011 Jan 04
5
scoping/non-standard evaluation issue
Dear r-devel list members, On a couple of occasions I've encountered the issue illustrated by the following examples: --------- snip ----------- > mod.1 <- lm(Employed ~ GNP.deflator + GNP + Unemployed + + Armed.Forces + Population + Year, data=longley) > mod.2 <- update(mod.1, . ~ . - Year + Year) > all.equal(mod.1, mod.2) [1] TRUE > > f <-
2008 Apr 19
2
problem in caluclaring the multiple regression
I am trying to calculate the regression for the follwing input data stored in 'data.txt' file.I am reading this and storing it in the variable i .then i am trying to get the predicted value using f1 as dependent and others f2....f10 as independent variables.It is giving the following error. Also i want that i shoul get one predicted value for each row(y). What should i do. Please help me
2004 Jan 06
1
Grouping data.frames
Hello all, I'm new to R (and the S language in general) so go easy on me if this is really simple. Given a data.frame df which looks like this: f1 f2 f3 f4 c1 c2 1 y y a b 10 20 2 n y b a 20 20 3 n n b b 8 10 4 y n a a 30 5 I'd like to aggregate it by the factors f1 and f2 (or f2 and f3, or any other combination of the three) and compute the sum of c1 and c2 (as separate values). I
2007 May 27
2
Question about "evalq"
The help page of eval says: The 'evalq' form is equivalent to 'eval(quote(expr), ...)'. But the following is not equivalent. Can anyone give me some explaination? Thanks very much. > f1 <- function(x,digits=5) lapply(x, f2) > f2 <- function(x) eval(quote(print(x+1,digits=digits)),list(x=x),parent.frame(2)) > f1(list(x1=1)) [1] 2 $x1 [1] 2 > > f1 <-
2005 Jan 24
2
using eval() with pre-built expression inside function
I'm trying to evaluate a pre-built expression using eval(), e.g. dataset <- data.frame(y = runif(30, 50,100), x = gl(5, 6)) # one like this mf <- expression(model.frame(y~x)) eval(mf, dataset, parent.frame()) # rather than this eval(expression(model.frame(y~x)), dataset, parent.frame()) In the example above there is no problem, the problem comes when I try to do a similar thing
2015 Oct 12
2
identical(..., ignore.environment=TRUE)
It seems odd/inconvenient to me that the "ignore.environment" argument of identical() only applies to closures (which I read as 'functions' -- someone can enlighten me about the technical differences between functions and closures if they like -- see below for consequences of my confusion). This is certainly not a bug, it's clearly documented, but it seems like a design
2011 Aug 11
1
Passing on "groups" argument to xyplot within a plotting function
An embedded and charset-unspecified text was scrubbed... Name: inte tillg?nglig URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110811/f20d8760/attachment.pl>
2011 Feb 14
4
sem problem - did not converge
Someone can help me? I tried several things and always don't converge # Model library(sem) dados40.cov <- cov(dados40,method="spearman") model.dados40 <- specify.model() F1 -> Item11, lam11, NA F1 -> Item31, lam31, NA F1 -> Item36, lam36, NA F1 -> Item54, lam54, NA F1 -> Item63, lam63, NA F1 -> Item65, lam55, NA F1 -> Item67, lam67, NA F1 ->
2008 Jun 24
4
Find max of a row in data frame (like Excel)
Hi, Here's the data we have: > rs[1:5,] probe_id f1 f2 f3 f4 M A f 1 A_68_P20002076 2 58 0 0 1.51778114 6.344453 59 2 A_68_P20002775 22 8 15 0 0.43419304 5.488819 59 3 A_68_P20005791 43 3 0 0 0.05698666 9.830594 59 4 A_68_P20005805 11 34 0 0 1.71076835 6.624038 59 5 A_68_P20006729 16 44 0 0 0.85498261 6.044229 59 I want rs$f be the max of f1, f2, f3,
2009 Apr 13
4
Group by in R
Hi, I have the following table data: f1, f2, f3, f4. I want to compute the counts of unique combinations of f1-f4. In SQL I would just write: SELECT COUNT(*) FROM <table> GROUP BY f1, f2, ..,f4. How to do this in R? Thanks, Nick -- View this message in context: http://www.nabble.com/Group-by-in-R-tp23020587p23020587.html Sent from the R help mailing list archive at Nabble.com.
2012 Jul 11
2
[LLVMdev] [NVPTX] llc -march=nvptx64 -mcpu=sm_20 generates invalid zero align for device function params
Hello, FYI, this is a bug http://llvm.org/bugs/show_bug.cgi?id=13324 When compiling the following code for sm_20, func params are by some reason given with .align 0, which is invalid. Problem does not occur if compiled for sm_10. > cat test.ll ; ModuleID = '__kernelgen_main_module' target datalayout = "e-p:64:64-i64:64:64-f64:64:64-n1:8:16:32:64" target triple =
2015 Oct 12
2
identical(..., ignore.environment=TRUE)
On 11/10/2015 10:36 PM, Duncan Murdoch wrote: > On 11/10/2015 8:05 PM, Ben Bolker wrote: >> >> It seems odd/inconvenient to me that the "ignore.environment" argument >> of identical() only applies to closures (which I read as 'functions' -- >> someone can enlighten me about the technical differences between >> functions and closures if they like
2001 Oct 10
4
Weird feature when creating function lists with apply
Hi R-fellows, can anyone explain this weird feature? I am trying to create a list of functions with apply, and it appears that there is something strange going on when the function evaluates the argument a. When I duplicate a into a local variable b, the result changes !?! Any pointers? Thank in advance. Cheers, Uffe # Create a function which returns a function > f1 <- function(a)
2019 Oct 05
6
should base R have a piping operator ?
Dear R-devel, The most popular piping operator sits in the package `magrittr` and is used by a huge amount of users, and imported /reexported by more and more packages too. Many workflows don't even make much sense without pipes nowadays, so the examples in the doc will use pipes, as do the README, vignettes etc. I believe base R could have a piping operator so packages can use a pipe in
2010 Feb 19
3
dot-dot-dot as an actual argument
I could not find any documentation of how dot-dot-dot works when used as an argument in a function call (rather than as a formal argument in a definition). I would appreciate some references to the rules governing situations like: f1<-function(x,y,...){ ? print(x) } f2<-function(...){ ? f1(...) } f2(1,2,3) In the call above how are the three numbers bound to the individual formal
2015 Oct 12
2
identical(..., ignore.environment=TRUE)
On 12/10/2015 9:51 AM, Ben Bolker wrote: > Duncan Murdoch <murdoch.duncan <at> gmail.com> writes: > > BB> >>>> It seems odd/inconvenient to me that the "ignore.environment" argument >>>> of identical() only applies to closures (which I read as 'functions' -- >>>> someone can enlighten me about the technical differences
2009 Jul 01
1
How should I denormalise a data frame list of lists column?
Hi, I have a data frame where one column is a list of lists. I would like to subset the data frame based on membership of the lists in that column and be able to 'denormalise' the data frame so that a row is duplicated for each of its list elements. Example code follows: # The data is read in in this form with the c2 list values in single strings which I then split to give lists: > f1
2020 Mar 03
2
TBAA for struct fields
[AMD Public Use] Hi Oliver, I get rid of the warnings by explicitly type-casting it to struct*, and still get similar results. ####################################################### struct P { float f1; float f2; float f3[3]; float f4; }; void foo(struct P* p1, struct P* p2) { p1->f2 = 1.2; p2->f1 = 3.7; } int callFoo() { struct P p; foo(&p,