Displaying 20 results from an estimated 1100 matches similar to: "hist: rel.freqs"
1998 Jan 23
1
R-beta: save.plot()
I currently use R0.61 to produce graphs for use in a tex document.
I first type
x11(orientation='portrait',width=4,height=3.5)
to fix the size of my graph, produce some plot type commands,
and then save the whole as an .eps file using save.plot().
The graph is included in the tex file using
\epsffile{file.eps}
in a figure environment.
The problem is that the graph occupies a whole page
1998 Jun 30
0
R-beta: stable distribution and stable glm package
I have just uploaded the package "stable-0.1.tgz" to the contrib section
of CRAN.
It enables to compute the density ('dstable'), the distribution
('pstable'), the quantile ('qstable') and the hazard ('hstable')
functions of a stable variate.
'stable.mode' computes the mode of a stable distribution.
The procedure 'stableglm' also enables
2010 Mar 30
1
hist.default()$density
Dear developers,
the current implementation of hist.default() calculates 'density' (and
'intensities') as
dens <- counts/(n*h)
where h has been calculated before as
h <- diff(fuzzybreaks)
which results in 'fuzzy' values for the density, see e.g.
> tmp <- hist(1:10,breaks=c(-2.5,2.5,7.5,12.5),plot=FALSE)
> print(tmp$density,digits=15)
[1]
1997 Dec 23
0
R-beta: bug in hist() (0.60/0.61)
I discovered a bug in hist().
Try the following:
x<-c(-5,-4,-4,-4,-3,-3,-3,-3,-2,-2,0,0,0,0,1,1,1,3,3,5,6)
# Note that sum(x)<0:
sum(x)
# [1] -13
hist(x)
# looks ok
hist(x,freq=F)
# negative bars !!
# and finally this gives not 1:
sum(hist(x,plot=F)$rel.freqs)
# [1] -0.8076923
The reason is, that "sum(x)" is used instead of "length(x)" in the following
line near
2000 Nov 17
2
hist() and density
There were some questions about hist() a couple of days ago which
triggered this post. My question/suggestion is about the y-axis in hist.
There are reasons to prefer making the y-axis density=relative
frequency/bin width. One reason is that the height of the plot does not
depend on the bin width; another is that if your histogram is in density
then you can easily superimpose a smooth theoretical
2006 Apr 05
1
hist function: freq=FALSE for standardised histograms
Dear All,
I am a undergraduate using R for the first time. It seems like an excellent
program and one that I look forward to using a lot over the next few years,
but I have hit a very basic problem that I can't solve.
I want to produce a standardised histogram, i.e. one where the area under
the graph is equal to 1. I look at the manual for the histogram function and
find this:
freq:
2009 Jul 26
2
problems hist() and density
Hello,
I have a problem with the hist() function and showing densities. The
densities sum to 50 and not to 1! I use R version 2.9.1 (2009-06-26) and
I load the seqinR library.
My data is the following vector:
[1] 0.1400000 0.2000000 0.2200000 0.2828283 0.1600000 0.1600000
0.3600000
[8] 0.1600000 0.2200000 0.2600000 0.2000000 0.3000000 0.2200000
0.2342342
[15] 0.1800000 0.2200000 0.1600000
2006 Aug 25
1
How to get back POSIXct format after calculating with hist() results
Hi,
I have a casting/formatting question on hist.POSIXt:
The histogram plot from POSIXct works perfect (with help of Prof. Ripley
-thanks!).
When processing the hist(plot=FALSE) output and then plotting the
results over the x-axis (bins) coming from hist(), I lose the date/time
labels, getting instead integers displayed.
Trying to cast the $breaks with as.POSIXct gives silly results with
2010 Jan 07
0
rJava in R 2.8.1 on Ubuntu 8.10
Dear all,
I have had the same problem as stated before, even with SUN's jdk
installed, and therefore enable to install any of 'iplots', 'rJava' or
'JGR' packages.
It seemed however that the R CMD javareconf couldn't catch the path of
my actual jdk.
The following worked for me by forcing the JAVA_HOME environment variable:
env
2008 Feb 10
1
Error while using fitdistr() function or goodfit() function
Try changing your method to "ML" and try again. I tried the run the
first example from the documentation and it failed with the same error.
Changing the estimation method to ML worked.
@List: Can anyone else verify the error I got? I literally ran the
following two lines interactively from the example for goodfit:
dummy <- rnbinom(200, size = 1.5, prob = 0.8)
gf <- goodfit(dummy,
1997 Dec 08
3
R-alpha: Bug in tapply in the Windows version of September
The function tapply is not working in the Windows version of R=20
(Version 0.50 Beta (Sept 29, 1997))
In
tapply <- function (x, INDEX, FUN=3DNULL, simplify=3DTRUE, ...)=20
...
The part:
if (simplify && all(unlist(lapply(ans, length)) =3D=3D 1)) {
ans <- unlist(ans, recursive =3D FALSE)
names(ans)<-namelist[[1]]
return(ans)
}
should be replaced by
if (simplify
2012 Aug 24
0
A question about GRAMMAR calculations in the FAM_MDR algorithm
Dear R developers:
I am a PHD candidate student in the school of public health of Peking
University and my major is genetic epidemiology. I am learning the FAM-MDR
algorithm, which is used to detect the gene-gene and gene-environment
interactions in the data of pedigree. The codes were written by Tom
Cattaert of the University of Liege. The algorithms and the sample datasets
are available at
2009 Jun 01
1
Bug in hist() when working with Dates ?
Hi,
It seems that hist() has a buggy behavior when breaking over "days".
The bug can be reproduced in a few steps:
> d=data.frame(date=c("2009-01-01", "2009-01-02", "2009-01-02"))
> d$date=as.Date(d$date)
> d$date
[1] "2009-01-01" "2009-01-02" "2009-01-02"
> h=hist(d$date, "days")
> h$count
[1] 3
2004 Nov 26
2
hist and truehist
Hello!
Up to now I have been 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
2007 Aug 15
4
Possible to "import" histograms in R?
Hi,
I have a large amount of data that I would like to create a histogram of and
plot and do things with in R. It is pretty much impossible to read the data
into R, so I have written a program to bin the data and now have a list of
counts in each bin. Is it possible to somehow import this into R and use
hist(), so I can, for instance, plot the probability density? I have looked
at the help page
1997 Oct 30
2
R-alpha: Minor plotting problems
1) There's a curious asymmetry between points and lines, in that you can
do
lines(...,type='p')
but not
points(...,type='l')
(and more importantly, not points(..., type='b'), which probably
*could* arise in real work)
This isn't deliberate, is it?
2) Did I remember to report the adverse effect of having plot(x,y)
coerce its argument to numeric? Several of my
2008 Feb 10
2
Error in optim while using fitdistr() function
Hello,
I am trying to fit distribution for data consisting of 421 readings.It is
basically no of requests arrived per minute.It contains many 0 entries as no
of requests.When i use
fd<-fitdistr(V2,"gamma")
I get following error:
Error in optim(x = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, :
initial value in 'vmmin' is not finite
What should I do ? I need
2009 Nov 06
2
Binning of integers with hist() function odd results (PR#14046)
Full_Name: Gerald Guglielmo
Version: 2.8.1 (2008-12-22)
OS: OSX Leopard
Submission from: (NULL) (131.225.103.35)
When I attempt to use the hist() function to bin integers the behavior seems
very odd as the bin boundary seems inconsistent across the various bins. For
some bins the upper boundary includes the next integer value, while in others it
does not. If I add 0.1 to every value, then the
2003 Mar 08
2
hist() basic question
Hi,
This is a very basic question, but I would like to undestand hist(). I
thought that the hist( , 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
2008 Nov 15
1
Rename objects based on list
Hi all,
I am trying to find a way to rename R objects with names pulled from a
vector of names. For example, I have a data frame, my.data.frame, and
a list of names, my.names. My.names is simply the column names of
my.data.frame.
I want save the histogram with the column name as the name of the object.
for (i in 1:ncol(my.data.frame) {
tmp<-hist(my.data.frame[,i])