Displaying 20 results from an estimated 10000 matches similar to: "png(): Linux vs Windows"
2007 Apr 06
1
dbinom and Catherine Loader
Hi Folks,
There has been past correspondence regarding Catherine Loader's
Bell Labs (oops, Lucent) paper
"Fast and Accurate Computation of Binomial Probabilities"
which gives the algorithm on which R's dbinom() is based.
The original URL given in the R documentation "?dbinom" is:
http://cm.bell-labs.com/cm/ms/departments/sia/catherine/dbinom
but this link is
2008 Oct 20
3
? extended rep()
Hi Folks,
I'm wondering if there's a compact way to achieve the
following. The "dream" is that, by analogy with
rep(c(0,1),times=c(3,4))
# [1] 0 0 0 1 1 1 1
one could write
rep(c(0,1),times=c(3,4,5,6))
which would produce
# [1] 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1
in effect "recycling" x through 'times'.
The objective is to produce a vector of
2009 Feb 05
3
"open-ended" plot limits?
Hi Folks,
Maybe I've missed it already being available somehow,
but if the following isn't available I'd like to suggest it.
If you're happy to let plot() choose its own limits,
then of course plot(x,y) will do it.
If you know what limits you want, then
plot(x,y,xlim=c(x0,x1),ylim(y0,y1)
will do it.
But sometimes one would like to
a) make sure that (e.g.) the y-axis has a
2008 Mar 12
1
[follow-up] "Longitudinal" with binary covariates and outcome
Hi again!
Following up my previous posting below (to which no response
as yet), I have located a report which situates this type
of question in a longitudinal modelling context.
http://www4.stat.ncsu.edu/~dzhang2/paper/glm.ps
Generalized Linear Models with Longitudinal Covariates
Daowen Zhang & Xihong Lin
(This work seems to originally date from around 1999).
They consider an outcome Y,
2009 May 17
2
Output of binary representation
I am interested in studying the binary representation of numerics
(doubles) in R, so am looking for possibilities of output of the
internal binary representations. sprintf() with format "a" or "A"
is halfway there:
sprintf("%A",pi)
# [1] "0X1.921FB54442D18P+1"
but it is in hex.
The following illustrate the sort of thing I want:
1.1001 0010 0001 1111
2008 May 20
1
contr.treatments query
Hi Folks,
I'm a bit puzzled by the following (example):
N<-factor(sample(c(1,2,3),1000,replace=TRUE))
unique(N)
# [1] 3 2 1
# Levels: 1 2 3
So far so good. Now:
contrasts(N)<-contr.treatment(3, base=1, contrasts=FALSE)
contrasts(N)
# 1 2
# 1 1 0
# 2 0 1
# 3 0 0
whereas:
contr.treatment(3, base=1, contrasts=FALSE)
# 1 2 3
# 1 1 0 0
# 2 0 1 0
# 3 0 0 1
contr.treatment(3, base=1,
2008 Oct 11
2
R vs SPSS contrasts
Hi Folks,
I'm comparing some output from R with output from SPSS.
The coefficients of the independent variables (which are
all factors, each at 2 levels) are identical.
However, R's Intercept (using default contr.treatment)
differs from SPSS's 'constant'. It seems that the contrasts
were set in SPSS using
/CONTRAST (varname)=Simple(1)
I can get R's Intercept to match
2009 Mar 31
2
"digits" in round()
Hi Folks,
Compare
print(1234567890,digits=4)
# [1] 1.235e+09
print(1234567890,digits=5)
# [1] 1234567890
Granted that
digits: a non-null value for 'digits' specifies the minimum
number of significant digits to be printed in values.
how does R decide to switch from the "1.235e+09" (rounded to
4 digits, i.e. the minumum, in "e" notation) to
2009 Sep 01
2
Function for all 2^N subsets of N
Greetings all!
I have been searching the Site for a function, say "subsets",
such that for instance
subsets(10)
would return a (say) matrix of indices to the 2^10 subsets of
N items -- perhaps in the form of 2^10 rows each of which is
10 entries each either TRUE or FALSE. Or 1 or 0. Or ...
I can of course write my own, using good old looping technology
or similar, but it would be
2008 Apr 27
2
Deb-4.0 Etch and sources.list for R
Hi Folks,
I'm running Debian-4.0 Etch, installed last September
from a DVD, and regularly updated as things arise.
I have R version 2.4.0 Patched (2006-11-25 r39997)
installed (initially at the time of first installation
of Debian, as provided by Debian), along with a variety
of packages.
I'd like to be able to connect to the CRAN repositories
for Debian R, for updates etc.
When I visit
2010 May 12
6
A primitive OO in R -- where next?
Greetings All,
Out of curiosity, I've just done a very primitive experiment:
Obj <- list(Fun=sum, Dat=c(1,2,3,4))
Obj$Fun(Obj$Dat)
# [1] 10
That sort of thing (much more sophisticated) must be documented
mind-blowingly somewhere. Where?
Where I stand right now: The above (and its immediately obvious
generalisations, like Obj$Fun<-cos) is all I know about it so far.
Ted.
2010 Jun 15
2
Unspecified [upper] xlim/ylim?
Greetings!
I would like to be able to specify a fixed (say) lower limit
for plotting, while leaving the upper limit "floating, when
plotting. The context is that the maximum in the data to be
plotted is unpredictable, being the consequence of a simulation,
whereas I know that it cannot be less than (say) 0; and I want
to fix the lower limit at 0 in any plot, leaving the upper limit
to be
2007 Dec 09
2
Adding info from summary(lm(...)) to plot
Hi Folks,
Say I have 2 continuous variables X,Y.
I can of course plot (X,Y) with
plot(X,Y,pch="+",col="blue")
say, and add the regression line from lm(Y~X)
by extracting the coefficients 'a' of Intercept
and 'b' of X from Y.lm <- lm(Y~X).
Now, however, I want to have not only a general
explanatory title such as
main="Plot of Y against X"
2009 Jul 23
1
error message: .Random.seed is not an integer vector but
Thanks much Ted. I actually had just tried what you suggest here before
you posted, and resolved the problem. Thanks also for the other tips. I
wrote x = as.vector(c(1:12)) because I thought that the mode of x might be
the problem, the error message pointing to .Random.seed notwithstanding.
On a related note, I did a brief test a couple weeks back where I ran a
million random samples of 3 from
2007 Nov 30
2
Organising tick-marks in plot()
Hi Folks,
I'm advising someone who's a beginner with R,
and therefore wants the simplest answer possible.
The issue is to produce a plot using
plot(x,y,...)
where, on the X-axis, the tick-marks should be
on the lines of:
-- Range of X-axis: 0:1000
-- tick-marks labelled "0","200",...,"800","1000"
-- unlabelled tick-marks every 50 from 0 to
2008 Jun 01
2
Eliminating "[...]" from print
Hi Folks,
This must be easy but I've not managed to locate the solution!
Basically: I'm using sink() to save successively obtained
results, e.g. I construct a set of regression coefficients
etc. with names rows and columne (I want to see the names
in the output) as an object (say "Object"), and then I
emit it with
print(Object)
So far so good. But I also want to print a
2009 Oct 22
1
contour() & contourLines()
Hi Folks,
I have been using contour() to produce some contour plots
(of a spatially-smooted density produced by kde2d()), with
very satisfactory results.
I now want access to the coordinates of the points on the
contours, and it would seem that contour() does not return a
value, so there is nothing from which these could be extracted.
However, apparently contourLines() does, and it seems to be
2010 Jun 07
1
Test
Greetings Moderators!
I moderated the message below just now (one of two identical
test messages). I rejected it, with a covering note to the
author (John Munroe <munddr at gmail.com>, who does not appear
to be subscribed to the list) that I was doing so because
approving it would serve no useful purpose, and pointing out
that it had been held because the message headers matched a
filter
2009 Nov 22
1
contour(): lines & labels in different colours?
Greetings, All!
I want to draw contour lines in red, using contour(), but also
have the contour labels (for the level-values) in black so that
they will stand out against a coloured background already generated
using filled.contour() (the background shades from green at low
levels of "risk" to red at high levels).
In any case, contour labels in red are already somewhat inconspicuous
2008 May 19
2
How hist() decides breaks?
Hi Folks,
I'd like to know how hist() decides how many cells to use
when it ignores my "suggestion" to use say 'hist(...,breaks=50)'.
More specifically, I have the results of 10000 simulations,
each returning an 8-vector, therefore 8 variables each with
10000 values. Some of these 8 have somewhat skew distributions.
Say one of these 8 variables is X.
I ask for H <-