Displaying 20 results from an estimated 10000 matches similar to: "if/else for plot/lines?"
2007 Feb 02
1
multinomial logistic regression with equality constraints?
I'm interested in doing multinomial logistic regression with equality
constraints on some of the parameter values. For example, with
categorical outcomes Y_1 (baseline), Y_2, and Y_3, and covariates X_1
and X_2, I might want to impose the equality constraint that
\beta_{2,1} = \beta_{3,2}
that is, that the effect of X_1 on the logit of Y_2 is the same as the
effect of X_2 on the
2010 Mar 26
1
cacheSweave fails when used in conjunction with rjags
Hi all,
I use the excellent packages rjags and cacheSweave, and unfortunately
seem to have found an incompatibility between them. Below are a
minimal .Rnw file and corresponding JAGS model file which illustrate
the problem:
*** JAGS model file; name=j.bug ***
model {
mu ~ dnorm(0,1.0E-5)
sigma ~ dunif(0,100)
for(i in 1:length(y)) {
y[i] ~ dnorm(mu,sigma)
}
}
***
*** .Rnw
2010 Nov 06
1
Hashing and environments
Hi,
I'm trying to write a general-purpose "lexicon" class and associated methods for storing and accessing information about large numbers of specific words (e.g., their frequencies in different genres). Crucial to making such a class practically useful is to get hashing working correctly so that information about specific words can be accessed quickly. But I've never really
2010 Oct 08
1
Can Sweave be instructed to use the cairo graphics device?
I'm writing a book using Sweave which includes Unicode characters which R's postscript and pdf graphics devices don't handle properly. The cairo graphics device does handle these characters properly. Thus I'd like to be able to instruct Sweave to use cairo (either sometimes or always) to produce graphics when it processes R code. Is this possible?
Many thanks,
Roger Levy
--
2010 Jan 31
1
accessing column and row numbers inside splom in lattice
Hi,
When using splom() in the lattice package, I would like to be able to
access the row and column number of each individual pairs plot ,
similar to the way that current.row() and current.column() can be used
in other lattice plotting functions such as xyplot. For example, I
would like to be able to write something along the lines of
library(mvtnorm)
library(lattice)
y <-
2008 Nov 08
3
unable to install rjags on 64-bit Debian Linux (etch)
While I have been able to install rjags on my Windows computer, oddly I
have been unable to install rjags successfully on my 64-bit Linux
compute server (etch, Linux kernel 2.6.18). I am required to specify
the JAGS module directory upon installation; when doing this within R, I
get:
2002 Sep 18
2
No subject
--============_-1179735293==_ma============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
To: r-help-request@lists.R-project.org
From: "Dr. Chris Wills" <cwills@ucsd.edu>
Subject: Questions about sorting and functions
Cc:
Bcc:
X-Attachments:
Dear R-Gang -
Two questions for you:
1) I cannot figure out how to sort one column in an array,
and
2007 Nov 28
1
interaction of shingles and tapply()
I'm interested in a version of tapply() that operates with shingles
instead of factors. For instance:
x <- c(1,1,2,2,3,3)
y <- c(1,1,1,0,0,0)
s <- shingle(x,intervals=cbind(c(0.5,1.5),c(2.5,3.5)))
# the following function should exist!
tapply.shingle(x,s,mean) # returns the vector c(0.75,0.25)
I've written such a function as follows:
tapply.shingle <-
2007 Mar 02
1
Help with faster optimization for large parameter problem
Hello all,
I have a large parameter problem with the following very simple likelihood
function:
fn<-function(param) {
x1<-param[1:n]
g1<-param[(n+1):(2*n)]
beta<-param[(2*n+1):(2*n+k)]
sigma2<-param[2*n+k+1]^2
meang1sp<-mean(g1[sp])
mu<-beta%*%matrix(x1,1,n)-(g1[sp]-meang1sp)%*%matrix(g1,1,n)
return(sum((ydc-mu)^2)/(2*sigma2) + n*k*log(sqrt(sigma2)) +
2002 May 29
2
OpenSSH 3.2.3p1 won't compile under IRIX 6.5.14
Previously 3.2.2 would not compile under Solaris, then 3.2.3
came out with a bug fix for the problem.
Now 3.2.3 won't compile under IRIX 6.5.14. I've tried using
both gcc 3.0.1 and the IRIX MIPSpro 7.1 compilers. I've been
compiling previous versions of OpenSSH for years using these
same compilers (we haven't updated the MIPSpro compiler for 3
years, and I've been using it on
2004 Jan 21
1
cor( x, y , method = "spearman" ) incorrect if any( is.na(c( x, y (PR#6448)
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 8.1
year 2003
month 11
day 21
language R
> cor( 1:3, rep(NA,3) ) # OK
Error in cor(1:3, rep(NA, 3)) :
2005 Oct 20
2
md5sum for R-2.2.0-win32.exe ??
I get
c1279b77fcccf40379f59a83523a440e *R-2.2.0-win32.exe
but I see
e8bdf765fe8013129045314c8e2605fd *rw2011.exe
on several USA mirrors.
I hope the latter is merely in need of a replacement and not an
indication of a problem with the web sites.
Chuck
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E
2005 Oct 26
1
unexpected '[<-.data.frame' result
Is this a bug?
If not, I am curious to know why '[<-.data.frame' was designed to yield
a.frame$y != a.frame$z rather than refusing to carry out the operation at
all.
> a.frame <- data.frame( x=letters[1:5] )
> a.frame[ 2:5, "y" ] <- letters[2:5]
> a.frame[[ "z" ]][ 2:5 ] <- letters[2:5]
> a.frame
x y z
1 a b <NA>
2 b c
2000 Mar 26
1
matlines, matpoints don't follow prototype (PR#506)
The Blue Book allows the 'type' argument to be used in matpoints and
matlines.
matlines(x, y, type="l", lty=1:5, pch=, col=1:4)
R-1.0.0 does not.
Thus, type="h", "b", must be invoked thru matplot( x, y, type = "h",
add=TRUE)
For the sake of consistency with S, it would be nice to have matlines
defined as:
"matlines" <-
2000 Mar 13
1
plot(1:10,c(1)$nothing) yields index plot (PR#482)
<<insert bug report here>>
IMHO,
plot(x,c(1)$nothing)
should fail or at least issue a warning.
Instead it produces an index plot of the first argument, i.e. plot(x)
Chuck Berry
--please do not edit the information below--
Version:
platform = sparc-sun-solaris2.7
arch = sparc
os = solaris2.7
system = sparc, solaris2.7
status = Patched
major = 1
minor = 0.0
year = 2000
2000 Mar 07
2
lm(rnorm(1000)~rnorm(1000)) kills rw1000 (PR#476)
First:
R core: (Thank You!)^HUGE_VAL
Now, down to business:
In a loop or in repeated command lines:
system.time(lm(rnorm(1000)~rnorm(1000)))
( or lm(rnorm(1000)~rnorm(1000))$coef )
fails after several iterations with the Windows message 'This program
has performed an illegal operation and will be shut down. If the
problem persists, please contact the vendor'.
clicking on DETAILS
2001 Jun 18
1
"[.data.frame" allows un-named 3rd subscript (PR#989)
Since the Extract page has usage as:
x[i, j, ... , drop=TRUE]
I would expect that 'drop=' would need to be given to the third 'subscript'
> diag(4)[ , 4 , 4 ] # Forgot 'drop=' or added extra ','
Error in diag(4)[, 4, 4] : incorrect number of dimensions
>
> as.data.frame( diag(4) )[ , 4 , 4 ] # should return error, right?
[1] 0 0 0 1
Also note:
2001 Nov 29
1
rug(x) clip warning incorrect if par("xlog")==TRUE (PR#1188)
To wit:
> plot(1:2,1:2,log="x")
> rug(1:2) # should not warn
Warning message:
some values will be clipped in: rug(1:2)
> plot(1:2,1:2,log="x")
> rug(c(0,.1,.2)) # should warn, but does not
>
I believe this fixes the problem:
% diff -c /tmp/orig.rug.R /tmp/cberry.rug.R
*** /tmp/orig.rug.R Thu Nov 29 12:59:00 2001
--- /tmp/cberry.rug.R Thu Nov 29
1999 Nov 11
2
dimname'less array breaks apply (PR#318)
<<insert bug report here>>
> apply(array(1:20,c(2,2,5)),2:3,function(x) x)
Error: length of dimnames must match that of dims
>
Changing:
dimnames = if (is.null(dn.ans)) list(ans.names, NULL) else c(list(ans.names), dn.ans)
To:
dimnames = if (length(dn)==0) NULL else
if (is.null(dn.ans)) list(ans.names, NULL) else c(list(ans.names), dn.ans)
seems to fix this.
Chuck
2000 Nov 08
1
substitute(x$y)) corrupts 'y' component (PR#731)
viz.
> (function(x,y=a) substitute(x$y))(x)
x$a
> (function(x,y=a) substitute(x$y))(list(y=1:3))
list(y = 1:3)$a
> (function(x,y) eval(substitute(substitute(y))))(x=list(y=1:3),y=x$y)
list(y = 1:3)$x$y
The behavior I expect and want is like that in Splus 3.4:
> (function(x,y=a) substitute(x$y))(x)
x$y
> (function(x,y=a) substitute(x$y))(list(y=1:3))
list(y = 1:3)$y
>