search for: truehist

Displaying 20 results from an estimated 46 matches for "truehist".

2010 Apr 16
2
how to change the position of xlab in truehist?
Hi, I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin corresponds to each of the discrete case. I was thinking of first delete xlab and then add marks myself, but it does...
2006 Sep 29
2
X-axis labels in histograms drawn by the "truehist" function
Hi, I have a simple problem that I would appreciate getting some tips. I am using the "truehist" function within an "apply" call to plot multiple histograms. I can't figure out how to get truehist to use the column names of the matrix as the labels for the x-axis of the histograms. Here is a simple example: X <- matrix(runif(4000),ncol=4) colnames(X) <-...
2009 Apr 28
3
truehist and density plots
Hi, I wanted to plot the histogram of a vector and then, plot the density function of subsets of the vector on the histogram. So I use truehist in MASS package and lines(density) as follows: length(b) = 1000 truehist(b) lines(density(b[1:100])) however the density plot of the first 100 points exceeds the max of y axis (see attached). how is it possible to make a graphics so that the density plot of the subsets doesn't go beyond the m...
2007 Mar 20
1
truehist bug?
Hi, Is this a bug in truehist()? > library(MASS) > x <- rep(1, 10) > truehist(x) Error in pretty(data, nbins) : invalid 'n' value Thanks, Gad > R.version platform i486-pc-linux-gnu arch i486 os linux-gnu system i486, linux-gnu status major 2 minor...
2007 Mar 20
1
truehist bug?
Hi, Is this a bug in truehist()? > library(MASS) > x <- rep(1, 10) > truehist(x) Error in pretty(data, nbins) : invalid 'n' value Thanks, Gad > R.version platform i486-pc-linux-gnu arch i486 os linux-gnu system i486, linux-gnu status major 2 minor...
2004 Nov 26
2
hist and truehist
...een using hist() to display the distributions. Howevere, I noteiced strange numbers on y (vertical) axis, if I used probability = T or freq = F option. I thought it is a bug and launched the R-bug system and found some posts on that matter. Brian Ripley responded to one, that one should look at truehist() for that. Ok I can use truehist() if I want to see the ratios or probabilities, but what is then the "density or probability" in hist()? For example: # some data mydata <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5) # histogram with frequencies hist(mydata) # histogr...
2004 Sep 09
1
man page of hist points to truehist, which can't be viewed without loading a library?
rdevel from yesterday, also in 1.9.1 (Debian, -3). The man page of 'hist' (from the graphics package, obtained by "?hist") suggests 'truehist' under "see also", but 'truehist' isn't loaded by default (a sensible "of course"), so that "?truehist" fails. One can do help.search(), of course, which points what to do, but leads to my question: In referencing functions in other packages, should...
2007 Sep 24
2
truehist?
Hello, After a long time, I needed the truehist function, but my system couldn't found it. I tried to install the package MAAS, but I couldn't found it! Something happened? Carlos -- +-----------------------------------------------------------+ Carlos Henrique Grohmann - Guano Visiting Researcher at Kingston University...
2003 May 03
1
can't plot ylab in graph
Dear People, I am sure I am missing something obvious as usual, but in the following graph I can't plot ylab. Ignoring unimportant details, I am plotting one instance of truehist() and one instance of curve() on the same graph. Truehist() won't let me pass the ylab argument. It gives me the error Error in plot.default(xlim, c(0, ymax), type = "n", xlab = xlab, ylab = "", : formal argument "ylab" matched by multiple actual arguments I don...
2007 May 25
1
how to mimic plot=F for truehist?
Dear Rologists, In order to combine plots I need to get access to the some "par"s specific to my plot prior to replot it with modified parameters. I have not found any option like "plot=F" associated with truehist and would like to know whether someone can point out how to overcome this problem. Thanks, Joh
2013 Jan 14
1
Wrong bin count number with hist() ?
...0),breaks=c(0,15,B,50),plot=F)$count # I was expecting the same results with the following values of A and B: A = 19.6019203953960 B = 19.6019204365543 A< B A==B hist(c(1:15,B,50),breaks=c(0,15,A,50),plot=F)$count# wrong hist(c(1:15,A,50),breaks=c(0,15,B,50),plot=F)$count# correct # Note that truehist() of MASS define the bin count number "correctly" require(MASS) par(mfrow=c(1,2)) ? ? ?hist(c(1:15,B,50),breaks=c(0,15,A,50),col="light gray",main="wrong - hist()") truehist(c(1:15,B,50),breaks=c(0,15,A,50),main="correct - truehist()") # I was not able to fi...
2003 Apr 18
3
superimposing graphs
Dear People, I have a data set of data x from a probability distribution, and I have a function, mydensity, of the pdf of that distribution. I'm asking for help in superimposing the histogram of x and the plot of mydensity. In the function below, I call truehist and curve, but these are plotted in different figures. I'd like them to be plotted on the same figure, and to use common axes, of course. Can anyone suggest a simple, robust way to do this? I'd prefer not to do micro-fiddling of graphical parameters if possible. I'm currently searchin...
2002 Mar 23
1
Normal behavior or bug?
>selectiris<-sample(1:5, 150, replace=T) > hist(selectiris, plot=TRUE) #freq=TRUE, breaks=5, etc all do the same thing >truehist(selectiris) Is the behavior of "hist" in this sample of code correct. On my system (Windows 2K, SP2) the first and second bars are pushed together, while the 3rd, 4th, and 5th bars are correctly positioned. The function "truehist" gives the correct representation of the dat...
2001 Aug 28
1
Axis labels
Hi, I am trying to label the x-axis of some histograms with the units of measurement. However, when I use, for example: > truehist(Ca, prob=FALSE, col="gray", xlab=expression(paste("Calcium (", mu, eq^-1, ")"))) I get the following message: Error in eval(expr, envir, enclos) : Object "mu" not found Could someone let me know what I'm doing wrong? Many thanks Gav > version...
2007 Nov 18
1
many zeroes in rgamma ... what's going on?
...in the code below and found that for some reason rgamma is giving many values equal to zero, which is strange since a gamma distribution is continuous. What is going on here? Thanks for any help in advance. Greg > x1 <- rgamma(10000, shape=0.001, scale=0.001) > sd1 <- 1/sqrt(x1) > truehist(sd1, xlim=c(0, 1.5)) Error in truehist(sd1, xlim = c(0, 1.5)) : 'nbins' must result in a positive integer > summary(sd1) Min. 1st Qu. Median Mean 3rd Qu. Max. 2.266e+01 9.311e+66 3.250e+153 Inf Inf Inf --------------...
2011 Apr 22
1
histogram of dates
...ist(temp) Error in .Internal(inherits(x, what, which)) : 'x' is missing > traceback() 3: inherits(breaks, "Date") 2: hist.Date(temp) 1: hist(temp) Existence of hist.Date implies that this is intended to work. The MASS version fails in a different way. > library(MASS) > truehist(temp) Error in Ops.difftime(n, 2) : '%/%' not defined for "difftime" objects > sessionInfo() R version 2.13.0 (2011-04-13) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=...
2006 Nov 07
1
histogram bin width
hi all : i have the data below and then below that, i call the hist function three times using the Scott method for the widths of the bins. the bin width is different for the three histograms but I would like it to always be 0.05 regfardless of the data set being histogrammed. I'm sure there must be a manual way to do this which is fine with me. i tried breaks=0.05 but it wasn't happy
2002 Sep 11
1
axis with negative values
How can I extend the axis of truehist with negative values. I need to plot residuals from a stepwise regression. Ulrich -- __________________________________________________ Ulrich Leopold MSc. Department of Physical Geography Institute for Biodiversity and Ecosystem Dynamics Faculty of Science University of Amsterdam Nieuwe Achte...
2003 Mar 08
2
hist() basic question
..., freq=FALSE) should provide the relative frequencies (probabilities), and so they should sum 1, however: set.seed(2) ah <- hist(rnorm(100), freq=F) sum(ah$intensities) [1] 2 set.seed(2) bh <- hist(rlnorm(100), freq=F) sum(bh$intensities) [1] 0.4999996 I'm getting similar figures with truehist() in MASS. So I suppose I'm misunderstanding hist(). Any help? Thanks Juli
2010 Jan 03
6
Help with function "fitdistr" in "MASS"
Hi, R users: I want to fit my data into a normal distribution by using the command "fitdistr" in "MASS". I changed my data class from "ts" to "numeric" by >class(mydata)="numeric" but after using "fitdistr", I got the result below >fitdistr(mydata,"normal") mean sd NA NA (NA) (NA) the help doc of