Displaying 20 results from an estimated 20000 matches similar to: "R hangs when hist() gets vector with a single value"
1999 Aug 10
1
Problems with the ts library
Well, I upgraded to a later release and have been having good luck (R vers.
0.65.0) I haven't upgraded my Red-Hat linux from 5.2 so I had to compile from
source , ... so far so good. My problem is with the time series functions
[library(ts)]. I'm trying to use the autocorrelation function-acf() and am
having problems with it. mainly an error ERROR -Couldn't find function
2005 Jun 18
1
hist single block plot issue
# CASE 1
# The following plots a single cell or block for all three location 0,1,2.
y <- rep(2,8)
hist(y) # why is this a single block?
hist(y,xlim=c(0,2)) # same thing
hist(y,breaks=2) # same
# CASE 2
# adding a different value, plots as expected
y <- append(y,0)
hist(y) # plots as expected
In most cases of the data I have variances in the data so
2011 Mar 12
3
pass character vector in instrument field of get.hist.quote function
I am new to R so I apologize if my question is trivial. I have not been able
to figure out whether what I want to do is even possible.
I have a data frame of stock ticker symbols which I store into R space from
a txt file as follows:
tickers <- read.csv("stocks.txt", header=FALSE, sep=",")
tickers <- tickers[1] / the tickers are stored in the first column
>
2005 Oct 18
2
hist of dates
Hi all
I wish to draw an histogram... with dates but the following append, i don't know where is the problem, help(hist.Date) works and i don't see any usefull information on what i'm doing wrong...
> hist.Date(dt_cycles)
Error: couldn't find function "hist.Date"
> hist.date(dt_cycles)
Error: couldn't find function "hist.date"
> cycles
[1] 7 1
2008 May 20
2
hist clarification
Can someone help me with a misunderstanding I'm having with hist? I
expected, from the example below, that the number of bins would always be 10
and the length of the counts array the same. According to the help section
'breaks' can be a integer indicating the number of bins. From the example
below, the number of bins (length of the counts array) varies. Am I wrong in
expecting the
2006 Dec 04
2
erroneous warning in hist (PR#9408)
Full_Name: Alex Deckmyn
Version: 2.4.0
OS: linux
Submission from: (NULL) (193.190.63.62)
specifying the "right" option in hist results in a warning when plot=F. The
option is taken into account correctly, but a warning is issued anyway. When
plot=T there is no warning.
> hist(c(1,1.5),breaks=0:4)$counts
[1] 1 1 0 0
> hist(c(1,1.5),breaks=0:4,right=T)$counts
[1] 1 1 0 0
>
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]
2009 Dec 17
2
Which hist cell each value falls in?
Hi, all. I'm using hist() to obtain a vector of break values in an interval.
I then want to be able to identify which cell any value from another vector
falls in.
E.g. applying
> breaks
[1] -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0
to
> x
[1] -3.74519666 -0.38183630 -1.22884247 -0.20971824 -0.30533939 -0.36271207
[7] -2.27513499 -2.23688653 -1.98827155 -1.48666274
2003 Jan 08
4
weird breaks in hist (PR#2431)
Full_Name: Reinhold Koch
Version: 1.6.1
OS: redhat 8.0
Submission from: (NULL) (131.152.84.111)
I came across rather weird behavior of the breaks in hist:
hist(1:3)
gives the expected result, besides an unnecessary gap between 2nd and 3rd
column
hist(1:4)
always merges up the first two columns, also if I resort to
hist.default(1:4,breaks=1:4). hist.default(1:4, include.lowest=F) gives an
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
2013 Jan 14
1
Wrong bin count number with hist() ?
Hi there,
# Consider the following example:
A = 19
B = 20
A< B
A==B
hist(c(1:15,B,50),breaks=c(0,15,A,50),plot=F)$count
hist(c(1:15,A,50),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
2005 Dec 11
1
(PR#8376 inconsistency between plot(hist(...)) and hist(...)
On Sun, 11 Dec 2005 clausen at econ.upenn.edu wrote:
> Full_Name: Andrew Clausen
> Version: 2.1.0
> OS: Debian GNU/Linux
> Submission from: (NULL) (71.242.192.73)
>
>
> Hi,
>
> When I type
>
> hist(x, freq=F)
>
> I get a density function, as I expect. However, if I type
>
> plot(hist(x, freq=F))
>
> then I get the same output as if I had
2010 Mar 13
2
Is this a bug (or a feature) in hist(x)$density ??
Hi all,
A friend send me a question on why does this:
x<-rpois(100,1)
sum( hist(x)$density )
Gives out "2"
I tried this:
sum( hist(x, freq =T)$density )
It didn't help.
Then he came back with the following insight:
# with breaks
b<-c(0,0.9,1:8)
sum(hist(x,breaks=b)$density) # Much more then 2
# but if we add weights according to the interval length
2009 Jun 04
1
hist returning density larger than 1
The following code is giving me problems. I want to export densities
of a distribution to a csv file. At the bottom of the code I use the
hist function to generate the densities. But hist is returning values
greater than 1. I don't understand, why. Any help you can supply is
greatly appreciated.
# Set word path
dir<-"~/Research/MR Distribution Analysis/"
setwd(dir)
2004 Jun 02
2
a fault in the "hist" - function (PR#6931)
Full_Name: Stephan Schlueter
Version: 1.9.0
OS:
Submission from: (NULL) (217.184.109.24)
During my studies, I found a fault in the hist()-function:
If you have a vector x with values around zero and also bigger than 10,000,000 ,
there will be a shift of -max(x)/10,000,000 in the hist-datas.
See my example:
x<-runif(10000)
hist(x,breaks=c(seq(-3,3,0.1)),prob=TRUE)
#everything ok, but
2004 May 06
1
plot(hist.default(1:10,plot=F)) error.
Hi!
How to find out which plot function is used when i call
plot(hist.default(1:10,plot=F)) and all works fine ?
The reason why I would like to know it is that after loading some self written R functions
> plot(hist.default(1:10,plot=F))
Error in xy.coords(x, y, xlabel, ylabel, log) :
x and y lengths differ
> traceback()
5: stop("x and y lengths differ")
4: xy.coords(x, y,
2023 Aug 06
1
hist(..., log="y")
hist() is designed so that the total area sums to 1. You should build you desired behavior using a barchart.
?
David
Sent from my iPhone
> On Aug 5, 2023, at 11:50 PM, Ott Toomet <otoomet at gmail.com> wrote:
>
> ?Sorry if this topic has been discussed earlier.
>
> Currently, hist(..., log="y") fails with
>
>> hist(rexp(1000, 1), log="y")
2023 Aug 06
2
hist(..., log="y")
Sorry if this topic has been discussed earlier.
Currently, hist(..., log="y") fails with
> hist(rexp(1000, 1), log="y")
Warning messages:
1: In plot.window(xlim, ylim, "", ...) :
nonfinite axis=2 limits [GScale(-inf,2.59218,..); log=TRUE] -- corrected
now
2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
"log" is not a graphical
2001 Oct 04
1
get.hist.quote does not work (PR#1116)
Full_Name: Arto Luoma
Version: 1.3.1
OS: Windows 98
Submission from: (NULL) (153.1.53.119)
Hi!
The function get.hist.quote in the package tseries (Version 0.7-6) does not work
in
my computer.
I found that it uses the function strptime which did not "understand" English
month
names in my Finnish locale (see bug report 811). I changed the regional settings
to
be English (UK) and
1999 Feb 18
1
[Q] use of expression() in plot() vs. hist()
In plot() I can get greek symbols into text items without trouble.
However, some of the same commands don't work as I would expect with
hist(). See the example below.
> plot(1:10, 2:11, xlab=expression(paste("scaled", rho)))
---- works as expected, ie. prints the greek rho
> hist(c(0,0,0,0,4,5,6,6,6,8), xlab=expression(paste("scaled", rho)))
Error: Object