similar to: Indexing with NA as FALSE??

Displaying 20 results from an estimated 10000 matches similar to: "Indexing with NA as FALSE??"

2004 Apr 18
2
lm with data=(means,sds,ns)
Hi Folks, I am dealing with data which have been presented as at each x_i, mean m_i of the y-values at x_i, sd s_i of the y-values at x_i number n_i of the y-values at x_i and I want to linearly regress y on x. There does not seem to be an option to 'lm' which can deal with such data directly, though the regression problem could be algebraically
2009 May 21
2
NA when indexing vectors
Hello: Is there a more natural way to get all elements that satisfy a condition when there are NAs in the sample? > x=c(1,2,NA) > x>=2 [1] FALSE TRUE NA > x[x>=2] [1] 2 NA ## I would expect here to get just "2" > x[!is.na(x) & x>=2] ## seems a bit cumbersome [1] 2 Thanks, Szilard
2007 Mar 20
1
Symbol and Ellipsis problems
Hi Everyone, When I have a load of functions which have various arguments passed via the ellipsis argument it keeps on assigning them as symbol making them unusable to the function. My current work around involves using do.call but this is rather cumbersome. Does anyone know why it suddenly changes the types to symbol and if there is a way to get the actual data pointed to by the symbol? (I
2005 Apr 02
2
is a very big graphics-device
Hello, i am searching now the R-Documentation many hours, but i cannot find a solution to my problem. I hope, i can solve my issue with R. i have data-tables, 15*40 data-tables i want to visualise this. this example-code i copied makes a 3x3-grid: x <- 0:12 y <- sin(pi/5 * x) op <- par(mfrow = c(3,3), mar = .1+ c(2,2,3,1)) for (tp in c("p","l","b",
2005 Mar 11
2
Calculating lengths of runs of 0 or 1 sequences in meteorological data
Dear List Members, I need some help about programming in S language. My problem is as follows: I have meteorological data (about rainfall measurement each day from 1989-2002), say like http://www.angelfire.com/ab5/get5/data.rainfall.txt or http://www.angelfire.com/ab5/get5/R.rainfall.txt in a sequence of 0(denoting dry day)'s and 1(denoting wet day)'s. I want to construct a frequency
2003 Apr 02
2
Two questions
Hi all Two questions: 1. I note that help for the postscript device claims "The postscript produced by R is EPS (Encapsulated PostScript) compatible...". It does not say it is EPS *compliant*. Indeed, the EPS produced by R includes a \showpage command which I believe (not that I'm an expert!) non-standard EPS. My question: Is there any reason why it is EPS compatible, but
2006 Sep 18
8
acos(0.5) == pi/3 FALSE
Hello, I don't know if the result of acos(0.5) == pi/3 is a bug or not. It looks strange to me. Inaki Murillo
2002 Dec 17
4
Quick tip please!
I have two CSV files (exported from Excel), say file1 and file2. The have the same number of rows, and each has several columns, with names on the first line; and some of the columns in file1 are repeated in file2. Using the "foreign" package, I can read these in separately to dataframes say d1 and d2 with > d1<-read.csv("file1") >
2007 Jul 16
5
formula(CO2)
The formula attribute of the builtin CO2 dataset seems a bit strange: > formula(CO2) Plant ~ Type + Treatment + conc + uptake What is one supposed to do with that? Certainly its not suitable for input to lm and none of the examples in ?CO2 use the above.
2005 May 11
7
bug in modulus operator %% (PR#7852)
The following can't be right, first rw2010: > 1 %% 0.001 [1] 0.001 Then rw2001: > 1 %% 0.001 [1] -2.081668e-17 > and the last seems about right. -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
2012 Mar 21
1
fwdmsa package: Error in search.normal(X[samp, ], verbose = FALSE) : At least one item has no variance
I'm using the fwdmsa package to identify deviant cases in a Mokken scale analysis. I've run into a problem., separate from the one I posted previously. The problem comes with items that are "easy" by IRT standards. A good scale should include a range of difficulties; yet when I include "easy" items in a forward search I continuously run into the problem that these items
2002 Dec 10
3
clogit and general conditional logistic regression
Can someone clarify what I cannot make out from the documentation? The function 'clogit' in the 'survival' package is described as performing a "conditional logistic regression". Its return value is stated to be "an object of class clogit which is a wrapper for a coxph object." This suggests that its usefulness is confined to the sort of data which arise in
2002 Oct 17
3
Non-central distributions
Hi Folks, I note that, while the "chisq" functions dchisq(x, df, ncp=0, log = FALSE) pchisq(q, df, ncp=0, lower.tail = TRUE, log.p = FALSE) qchisq(p, df, ncp=0, lower.tail = TRUE, log.p = FALSE) rchisq(n, df, ncp=0) all have a slot for the non-centrality parameter "ncp", of the functions for the t and F distributions: dt(x, df, log = FALSE)
2004 Dec 26
2
Prosodic/phonetic analysis with R
Hi Folks, I'm interested in looking (in a beginner's amateurish way) at prosodic/phonetic analysis of recorded speech. In particular I would want to use R to formulate and evaluate specific models. So I would like to ask R people for their recommendations for a program which would a) Take as input a sound file in one of the common formats (".wav", ".au") b)
2007 May 01
2
Simulation using parts of density function
Hi My simulation with the followin R code works perfectly: sim <- replicate(999, sum(exp(rgamma(rpois(1,2000), scale = 0.5, shape = 12)))) But now I do not want to have values in object "sim" exceeding 5'000'000, that means that I am just using the beginning of densitiy function gamma x < 15.4. Is there a possibility to modify my code in an easy way? Thanks for any help!
2007 Jun 15
3
[OT] 'gv' and fractional points
Hi Folks, This is off-topic R-wise, but it may be close to the heart of many R-users, so I think it may be the best place to ask! Users of 'gv' (the "front end" to ghostscript) will be aware of the little window which gives you the x-y coordinates (in points = 1/72 inch) of the position of the "cross-hair" mouse cursor. These coordinates are those of the corresponding
2003 Jun 25
2
Execution of R code
Greetings Folks, When R code (as entered or read from a courced file) is executed, is it interpreted from the input form every time having once been read in, or do subsequent invocations use an "intermediate" (pre-interpreted) form? Or, putting it another way, is the execution of R code faster second time time round (and later) because the pre-interpretation has already been done once
2003 Oct 09
4
Automatic re-looping after error
Hi Folks, I'm seeking advice about how to resume an outer loop following failure of a function within the loop (which issues an error message). Essentially, I'm repeating (simulating) a process which involves random sampling, EM and MCMC. I'm walking on very edge of rather thin ice -- data rather thinly spread over many parameters! Occasionally some component of the loop fails, with
2010 Aug 09
1
Smart Indexing
Hi all, Suppose that I've two data frames, a and b say, both containing a column 'id'. While data frame 'a' contains multiple rows sharing the same id, data frame 'b' contains just one entry per id (i.e. a 1 to n relationship). For the ease of modeling I now want to generate a new data frame c, which is basically a copy of data frame 'a' augmented by the values
2005 Feb 26
2
R-help Time Series
Hi Folks, While I was browsing in the R-help archives yesterday, I got curious about the time series of the sizes of the monthly archives in MB. This turned out to have an unexpected feature or two, which I leave to readers to explore for themselves. I'm now wondering at what point in time we might expect to be receiving 1000MB/month (30+MB/day). It's not that far away, it seems, but