similar to: Giving vector of colors to line in plots

Displaying 20 results from an estimated 10000 matches similar to: "Giving vector of colors to line in plots"

2020 Jan 19
2
rpois(9, 1e10)
Hello, All: ????? Consider: Browse[2]> set.seed(1) Browse[2]> rpois(9, 1e10) NAs produced[1] NA NA NA NA NA NA NA NA NA ????? Should this happen? ????? I think that for, say, lambda>1e6, rpois should return rnorm(., lambda, sqrt(lambda)). ????? For my particular Monte Carlo, I have replaced my call to rpois with a call to the following: ?rpois. <- function(n,
2018 May 01
2
How would I color points conditional on their value in a plot of a time series
How would I color points conditional on their value in a plot of a time series. Something like this: ## demonstration data ttt <- ts(rpois(12, lambda = 8), start = c(2000, 1), freq = 4) ttt plot(ttt, type = "p") ## doesn't work--all points the same color plot(ttt, type = "p", col = ifelse(ttt < 8, "black", "red")) ## also doesn't work--all
2020 Jan 19
2
rpois(9, 1e10)
On 2020-01-19 09:34, Benjamin Tyner wrote: >> ------------------------------------------------------------------------ >> Hello, All: >> >> >> ? ????? Consider: >> >> >> Browse[2]> set.seed(1) >> Browse[2]> rpois(9, 1e10) >> NAs produced[1] NA NA NA NA NA NA NA NA NA >> >> >> ? ????? Should this happen? >>
2020 Jan 19
2
rpois(9, 1e10)
So imagine rpois is changed, such that the storage mode of its return value is sometimes integer and sometimes numeric. Then imagine the case where lambda is itself a realization of a random variable. Do we really want the storage mode to inherit that randomness? On 1/19/20 10:47 AM, Avraham Adler wrote: > Maybe there should be code for 64 bit R to use long long or the like? > > On
2020 Jan 19
2
rpois(9, 1e10)
????? This issue arose for me in simulations to estimate confidence, prediction, and tolerance intervals from glm(., family=poisson) fits embedded in a BMA::bic.glm fit using a simulate.bic.glm function I added to the development version of Ecfun, available at "https://github.com/sbgraves237/Ecfun".? This is part of a vignette I'm developing, available at
2020 Jan 23
1
[External] Re: rpois(9, 1e10)
On 1/20/20 12:33 PM, Martin Maechler wrote: > > It's really something that should be discussed (possibly not > here, .. but then I've started it here ...). > > The NEWS for R 3.0.0 contain (in NEW FEATURES) : > > * Functions rbinom(), rgeom(), rhyper(), rpois(), rnbinom(), > rsignrank() and rwilcox() now return integer (not double) > vectors.
2003 Aug 26
4
Viewing function source
I know I should probably RTFM for this question, but could someone tell me if R supports the idea of "viewing source" on any particular function you want to use? If I want to "view source" on the rpois() function, for example, can I do somethink like: source(rpois) To see how the function is implemented? Regards, Paul Meagher Datavore Productions 50 Wood Grove Drive
2018 May 01
2
How would I color points conditional on their value in a plot of a time series
Excellent! Worked like a charm. Thanks. --Chris Ryan On Tue, May 1, 2018 at 4:33 PM, William Dunlap <wdunlap at tibco.com> wrote: > The ts method for plot() is quirky. You can use the default method: > > plot(as.vector(time(ttt)), as.vector(ttt), type = "p", col=ifelse(ttt<8, > "black", "red")) > > > Bill Dunlap > TIBCO Software
2020 Jan 19
2
rpois(9, 1e10)
On 2020-01-19 13:01, Avraham Adler wrote: > Crazy thought, but being that a sum of Poissons is Poisson in the sum, > can you break your ?big? simulation into the sum of a few smaller > ones? Or is the order of magnitude difference just too great? ????? I don't perceive that as feasible.? Once I found what was generating NAs, it was easy to code a function to return pseudo-random
2018 May 01
0
How would I color points conditional on their value in a plot of a time series
You may also want to check this out: plot(ttt, type = "p") points(ttt, col = ifelse(ttt < 8, "black", "red")) Eivind K. Dovik Bergen, NO On Tue, 1 May 2018, Christopher W Ryan wrote: > Excellent! Worked like a charm. Thanks. > > --Chris Ryan > > On Tue, May 1, 2018 at 4:33 PM, William Dunlap <wdunlap at tibco.com> wrote: > >> The
2020 Jan 19
2
rpois(9, 1e10)
On my Mac: str(.Machine) ... $ integer.max????????? : int 2147483647 ?$ sizeof.long????????? : int 8 ?$ sizeof.longlong????? : int 8 ?$ sizeof.longdouble??? : int 16 ?$ sizeof.pointer?????? : int 8 ????? On a Windows 10 machine I have, $ sizeof.long : int 4; otherwise the same as on my Mac. ????? Am I correct that $ sizeof.long = 4 means 4 bytes = 32 bits? log2(.Machine$integer.max)
2018 May 01
0
How would I color points conditional on their value in a plot of a time series
The ts method for plot() is quirky. You can use the default method: plot(as.vector(time(ttt)), as.vector(ttt), type = "p", col=ifelse(ttt<8, "black", "red")) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, May 1, 2018 at 1:17 PM, Christopher W Ryan <cryan at binghamton.edu> wrote: > How would I color points conditional on their value in a plot
2020 Jan 20
2
[External] Re: rpois(9, 1e10)
Thanks to Luke and Avi for their comments.? I wrapped "round" around the call to "rnorm" inside my "rpois.".? For "lambda" really big, that "round" won't do anything.? However, it appears to give integers in floating point representation that are larger than .Machine$integer.max.? That sounds very much like what someone would want.?
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the order of the arguments. This is an example: > rpois(n=1,lambda=2) [1] 3 > rpois(lambda=2,n=1) [1] 2 0 It obviously uses the first argument as the number of samples to be drawn, which is wrong. I used Version 0.49 Beta (April 23, 1997). Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the order of the arguments. This is an example: > rpois(n=1,lambda=2) [1] 3 > rpois(lambda=2,n=1) [1] 2 0 It obviously uses the first argument as the number of samples to be drawn, which is wrong. I used Version 0.49 Beta (April 23, 1997). Fredrik
2000 Apr 30
2
rpois hangs (PR#530)
Full_Name: Kjetil Kjernsmo Version: Version 1.0.0 OS: osf1 Submission from: (NULL) (129.240.28.227) Dear all, I have come across another really strange bug in rpois. If I do > rpois(1, 1000000 * rpois(1, 10000)) sometimes it hangs, and hangs... On my XP1000 alphaev6 workstation, it seems to happen more frequently than on other machines. I started a session on an older computer, and from
2008 Feb 20
3
reshaping data frame
Dear all, I'm having a few problems trying to reshape a data frame. I tried with reshape{stats} and melt{reshape} but I was missing something. Any help is very welcome. Please find details below: ################################# # data in its original shape: indiv <- rep(c("A","B"),c(10,10)) level.1 <- rpois(20, lambda=3) covar.1 <- rlnorm(20, 3, 1) level.2
2000 Nov 08
3
Strange means of numbers drawn from rpois
Dear all, I think I must be going crazy.... If I do > mean(rpois(1000000, 14)) I get: [1] 13.50420 and again: > mean(rpois(1000000, 14)) [1] 13.49896 > mean(rpois(1000000, 14)) [1] 13.50161 > mean(rpois(1000000, 15)) [1] 14.49250 > mean(rpois(1000000, 15)) [1] 14.49897 > mean(rpois(1000000, 14.5)) [1] 13.99689 > mean(rpois(1000000, 14.5)) [1] 13.9963 This was on a platform
2008 May 08
3
Setting matrix dimnames in a list
Hey All, I was wondering if I could solicit a little input on what I'm trying to do here. I have a list of matrices, and I want to set their dimnames, but all I can come up with is this: x <- matrix(1:4,2) y <- matrix(5:8,2) z <- list(x,y) nm <- c("a","b") nms <- list(nm,nm) z <- lapply(z,function(x)dimnames(x)<-nms) As you can see, this
2007 Feb 07
3
Sample Poisson Distribution
Hi, I'm completely new to R, I am all at sea with the interface and the confusing help files, so would appreciate some help to do a simple task. Need to present the mean and variance of 100 different samples of poisson distributions (N=1000, with fixed lambda) in a file in two columnns, and then produce histograms. So far I have figured out: > N <- 1000 > x <- rpois(N, 3.1) ,