similar to: how to eval subset?

Displaying 20 results from an estimated 10000 matches similar to: "how to eval subset?"

2007 Feb 14
2
[LLVMdev] Linux/ppc backend
Hi Chris, Chris Lattner wrote: >> 2) Line 369 of PPCInstrInfo.td, we declare the non-callee saved registers. >> However, Linux and Darwin do not have the same set >> of non-callee saved registers. I don't know how to make the if(isDarwin) test >> in here >> > > Take a look at ARM/ARMRegisterInfo.td for an example of this I tried to define Defs just
2004 May 20
4
pmvt problem in multcomp
Hi, all: Two examples are shown below. I want to use the multiple comparison of Dunnett. It succeeded in upper case "example 1". However, the lower case "example 2" went wrong. In "example 2", the function pmvt return NaN, so I cannot show this simtest result. Is there any solution? (I changed the variable "maxpts" to a large number in front of the
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
2008 Nov 10
1
Remove empty levels in subset
Hi, when I use use subset in a data.frame, all empty levels are maintained in the new table. > test <- data.frame(a=as.factor(rep(c("f1","f2","f3"),10)),b=rep(c(1,2,3),10)) > summary(test) a b f1:10 Min. :1 f2:10 1st Qu.:1 f3:10 Median :2 Mean :2 3rd Qu.:3 Max. :3 > test2 <-
2001 Sep 20
3
indexing an array
Dear everybody, I have a following problem. I have a 3D array lambda <- array( dim=c(N,M,M-1)) where I have to extract the elements as follows: lambda[ 1, state[1], 1] lambda[ 1, state[1], 2] ... lambda[ 1, state[1], M-1] lambda[ 2, state[2], 1] ... lambda[ 2, state[2], M-1] ... lambda[ N, state[N], M-1] i.e. the result should be a 2D array, where the second index follows the first one
2008 Feb 13
1
stumped by eval
In the following example, the inner evaluation pulls in the global value of subset (a function) rather than the one I thought I was passing in (a vector). Can anyone help me understand what's going on, and what I need to do to fix the problem? f0 <- function(formula, data, subset, na.action ) { f1(formula, data, subset,
2007 Oct 30
2
Splitting up the micEcon package?
Dear R Users: The functions of our "micEcon" package [1,2] can be subdivided into three categories: - microeconomic demand and firm models - sample selection models (mainly selection()) - routines for (likelihood) maximisation (e.g. maxLik(), maxNR(), maxBHHH()) (mainly used for ML estimation of sample selection models) Although sample selection models are often used in
2007 Oct 17
1
R CMD build and et_EE.UTF-8 locale -> invalid files (PR#10351)
Full_Name: Ott Toomet Version: 2.6.0, 2.5.x OS: debian etch, lenny Submission from: (NULL) (80.235.63.243) When building a package with 'R CMD build name_of_directory" using "et_EE.UTF-8" locale, I get the following: siim at tancredi:~/tyyq/econ/micEcon$ R CMD build trunk * checking for file 'trunk/DESCRIPTION' ... OK * preparing 'trunk': * checking
2007 Dec 06
1
updating a helper function in a R package
Hi list, Sorry for the vague title, but here is the scenario. I?m writing an R package, let?s say, ?pkg1?, which contains 3 functions: f1, f2, f3. f2 and f3 are helper functions for f1, i.e. f1 calls f2 which in turn calls f3. f1 <- function(?) { ?. f2() ? } f2 <- function(?){ ? f3(?) ? } f3 <- function(...){ .... } Then, I wrote a new version of f3 and I want to
2009 Oct 07
2
Plotting 1 covariate, 3 factors
I'm interested in plotting a y with an x factor as the combination of 2 factors and colour with respect to a third, which the code below does with interaction.plot(). However, this is because I redefine the x to be 1 factor. Is there a way of getting it to plot without redefining it, and ideally to not join up the lines BETWEEN levels a and b, but just join those between after and before for
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 ->
2011 Jun 01
3
error in model specification for cfa with lavaan-package
Dear R-List, (I am not sure whether this list is the right place for my question...) I have a dataframe df.cfa
2009 Aug 08
2
Problem using model.frame with argument subset in own function
Dear List, I am writing a formula method for a function in a package I maintain. I want the method to return a data.frame that potentially only contains some of the variables in 'data', as specified by the formula. The problem I am having is in writing the function and wrapping it around model.frame. Consider the following data frame: dat <- data.frame(A = runif(10), B = runif(10), C
2003 Jun 23
3
right assignment ("->") and functions
Hi everyone check this out [R-1.7.0]: R> f1 <- function(x){x^2} R> f1 -> f2 R> f2(4) [1] 16 R> R> function(x){x^2} -> f3 function(x){x^2} -> f3 R> f3(4) Error: couldn't find function "f3" Why does right assignment "->" work in the first but not the second case? Can anyone else reproduce this? -- Robin Hankin, Lecturer, School of
2004 Feb 05
0
correction to the previously asked question (about mergin g factors)
First of all, I do not understand why conversion to characters are not allowed. That's what Sundar's solution is doing implicitly (but more elegantly). Here's a test of all three. See the function definitions below. > f1 <- factor(sample(letters[1:3], 1e4, replace=TRUE)) > f2 <- factor(sample(letters[3:5], 1e4, replace=TRUE)) > f3 <- factor(sample(letters[5:7],
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 =
2006 Dec 13
1
Curious finding in MASS:::confint.glm() tied to eval()
Greetings all, I was in the process of creating a function to generate profile likelihood confidence intervals for a proportion using a binomial glm. This is a component of a larger function to generate and plot confidence intervals for proportions using the above, along with bootstrap (BCa), Wilson and Exact to visually demonstrate the variation across the methods to some folks. I had initially
2010 May 10
2
Robust SE & Heteroskedasticity-consistent estimation
Hi, I'm using maxlik with functions specified (L, his gradient & hessian). Now I would like determine some robust standard errors of my estimators. So I 'm try to use vcovHC, or hccm or robcov for example but in use one of them with my result of maxlik, I've a the following error message : Erreur dans terms.default(object) : no terms component Is there some attributes
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 Jul 15
4
Extract pairs (rowname, columname) from a matrix where value is 0
Dear sir, I have a matrix like a<-matrix(c(0,2,0,4,0,6,5,8,0),nrow=3) colnames(a)<-c("F1","F2","F3") rownames(a)<-c("A1","A2","A3") a F1 F2 F3 A1 0 4 5 A2 2 0 8 A3 0 6 0 I want to extract all pairs (rownames, columnames) from which the value in the matrix is 0 The result should be something like this A1, F1 A2,