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
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
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
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
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
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 <-
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 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,
2006 Sep 18
1
ISO8601 week-of-year to date
Hi,
are there any way to convert ISO8601 weeks to gregorian dates? Something
like
coverttodate(year=2006, week=38, day=1)
# Sept 18, 2006
Thanks in advance,
Ott
2002 Sep 09
2
lapply-related question
Dear R-gurus,
I would like to use a lapply on a kind of "bivariate" problem. I have
a vector and a list, components of which are vectors, e.g.
vec <- c(1,2,3)
lst <- list(1, c(2,3), c(4,5,6))
I want to apply a function to each component of the list, using the
corresponding component of the vector as a parameter. E.g. I want a
list in the form
list(lst[[1]] + vec[1], lst[[2]]
2002 Aug 10
2
package for saving large datasets in ASCII
Hi,
I have made a tiny package for saving dataframes in ASCII format. The
package contains functions save.table() and save.delim(), the first
mimics (not completely) write.table() and the second uses just
different default values, suitable for read.delim().
The reason I have written the functions is that I have had problems
with saving large dataframes in ASCII form. write.table() essentially
2002 Jun 20
2
cat output To data.frame.rows ?
Hi,
is there a possibilty to get my function output with "cat "
as data.frame.rows with variables ?
Var1---------------- 8 15 1 3
Var2---------------- 0.170 0.319 0.0213 0.0638
Var3---------------- 83.8 88.6 90 75
Var4---------------- 84.3 84.3 100 83.3
Var5---------------- 62.5 56 20 53.3
function(data.frame) {
....
....
2002 May 13
3
Histograms rotated, side-by-side
Hi there,
I am wanting to create 8 side-by-side histograms which have been rotated 90
degrees clockwise from how they usually sit.. all with the same scales. Is
someone able to help me out?
Thanks so much,
Rachel Cunliffe
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send
2002 Jan 25
2
problem with read.table -- example
Hi,
I have not get much response for my question about read.table for couple of
days ago. As I said, the problem is that read.delim() do not want to read
more than 51 lines of data, with longer file it reads the first column as
row names, although I have not noticed any special binary symbols around
line 51 either. This problem seems to happen with this particular file, I
could easily read in a
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
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],
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
2001 Oct 09
1
bug in paste?
Dear all,
I have strange problems with paste. Actually I suggest it is a bug (I
send a associated bug report for some days ago too).
I have a vector ce0, a character vector m and I paste them together:
> ce0
[1] "1985" "9" "2" "2" "1" "A" "1" "" "NA" "5"
[11]
2005 Nov 18
1
challenge: using 'subset = <computed>' inside function ..
I've been asked by someone else whom I originally taught
`` to just work with substitute() and then all will be fine'' ...
But it looks to me that I've been caught here.
Is it possible to make this work along the way we thought it should?
1) Inside a function, say tst() with the 'formula' and a 'data' argument,
2) call another modeling function using