Discussion:
[R] weird "vector size cannot be NA/NaN" problem
Werner Wernersen
2009-09-21 10:06:09 UTC
Permalink
Hi,

I have to follow up my own question since this problem is getting quite disturbing and I fear that it also causes other functions to malfunction without notice.

It occurs quite quite often when I manipulate the mentioned data set. It definitely is caused by the column entries which are Inf (caused by a value/0 operation) but I cannot reproduce the error. When I do a describe(c(5,3,76,4/0)), for example, the last value is Inf but the error is not thrown.

But I can save the vector and load it and the error still occurs. Would someone be willing to look at that vector and maybe finds out the root of the problem? (I'll send the vector by email)

As I said in the earlier email, the data is imported with read.dta of the foreign library and the only manipulation I do is dividing the values of two columns by each other.

Thanks a million,
Werner
I have a weird problem with my data but I cannot really
locate it and cannot make a small example data set do
reproduce the problem.
I basically divide one numerical column of a data frame
with another. When I run describe() on that column, I get
"Error in vector("integer", length) : vector size cannot be
NA/NaN"
The two original columns comprise many zero values and I
think the particular row which causes the problem ends up
with an "Inf".
I fear that other functions might also not be reliable for
this data and that I have to repair it somehow. It actually
happens with many of the variables from the various tables
which originally are in Stata .dta format and which I import
with the foreign library.
I am working on windows XP and R 2.9.1
I assume that this description is too vague but if anybody
has an idea, I would appreciate it.
Thanks so much,
? Werner
Petr PIKAL
2009-09-21 10:40:28 UTC
Permalink
Hi

I tried but
Post by Werner Wernersen
describe(c(5,3,76,4/0))
Error: could not find function "describe"
What shall I do? Quick search did not find function on CRAN and I do not
have enough time to dig it from somewhere.

Regards
Petr
Post by Werner Wernersen
Hi,
I have to follow up my own question since this problem is getting quite
disturbing and I fear that it also causes other functions to malfunction
without notice.
It occurs quite quite often when I manipulate the mentioned data set. It
definitely is caused by the column entries which are Inf (caused by a
value/0
Post by Werner Wernersen
operation) but I cannot reproduce the error. When I do a
describe(c(5,3,76,4/
Post by Werner Wernersen
0)), for example, the last value is Inf but the error is not thrown.
But I can save the vector and load it and the error still occurs. Would
someone be willing to look at that vector and maybe finds out the root
of the
Post by Werner Wernersen
problem? (I'll send the vector by email)
As I said in the earlier email, the data is imported with read.dta of
the
Post by Werner Wernersen
foreign library and the only manipulation I do is dividing the values of
two
Post by Werner Wernersen
columns by each other.
Thanks a million,
Werner
I have a weird problem with my data but I cannot really
locate it and cannot make a small example data set do
reproduce the problem.
I basically divide one numerical column of a data frame
with another. When I run describe() on that column, I get
"Error in vector("integer", length) : vector size cannot be
NA/NaN"
The two original columns comprise many zero values and I
think the particular row which causes the problem ends up
with an "Inf".
I fear that other functions might also not be reliable for
this data and that I have to repair it somehow. It actually
happens with many of the variables from the various tables
which originally are in Stata .dta format and which I import
with the foreign library.
I am working on windows XP and R 2.9.1
I assume that this description is too vague but if anybody
has an idea, I would appreciate it.
Thanks so much,
Werner
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
Post by Werner Wernersen
and provide commented, minimal, self-contained, reproducible code.
johannes rara
2009-09-21 13:06:46 UTC
Permalink
This is probably a describe function from Hmisc-package.
Post by Petr PIKAL
Hi
I tried but
Post by Werner Wernersen
describe(c(5,3,76,4/0))
Error: could not find function "describe"
What shall I do? Quick search did not find function on CRAN and I do not
have enough time to dig it from somewhere.
Regards
Petr
Post by Werner Wernersen
Hi,
I have to follow up my own question since this problem is getting quite
disturbing and I fear that it also causes other functions to malfunction
without notice.
It occurs quite quite often when I manipulate the mentioned data set. It
definitely is caused by the column entries which are Inf (caused by a
value/0
Post by Werner Wernersen
operation) but I cannot reproduce the error. When I do a
describe(c(5,3,76,4/
Post by Werner Wernersen
0)), for example, the last value is Inf but the error is not thrown.
But I can save the vector and load it and the error still occurs. Would
someone be willing to look at that vector and maybe finds out the root
of the
Post by Werner Wernersen
problem? (I'll send the vector by email)
As I said in the earlier email, the data is imported with read.dta of
the
Post by Werner Wernersen
foreign library and the only manipulation I do is dividing the values of
two
Post by Werner Wernersen
columns by each other.
Thanks a million,
? Werner
I have a weird problem with my data but I cannot really
locate it and cannot make a small example data set do
reproduce the problem.
I basically divide one numerical column of a data frame
with another. When I run describe() on that column, I get
"Error in vector("integer", length) : vector size cannot be
NA/NaN"
The two original columns comprise many zero values and I
think the particular row which causes the problem ends up
with an "Inf".
I fear that other functions might also not be reliable for
this data and that I have to repair it somehow. It actually
happens with many of the variables from the various tables
which originally are in Stata .dta format and which I import
with the foreign library.
I am working on windows XP and R 2.9.1
I assume that this description is too vague but if anybody
has an idea, I would appreciate it.
Thanks so much,
? Werner
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
Post by Werner Wernersen
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Peter Ehlers
2009-09-21 16:29:27 UTC
Permalink
Werner,

Thanks for sending the data.

The problem does seem to lie with describe() in pkg:Hmisc.
Frank may want to know that it can be triggered by

f <- function(n)describe(c(1:n,1/0))
f(18) #ok
f(19) #triggers the error

Perhaps it's related to the "at least 20 unique values" condition
mentioned in ?describe.

Peter Ehlers
Post by Werner Wernersen
Hi,
I have to follow up my own question since this problem is getting quite disturbing and I fear that it also causes other functions to malfunction without notice.
It occurs quite quite often when I manipulate the mentioned data set. It definitely is caused by the column entries which are Inf (caused by a value/0 operation) but I cannot reproduce the error. When I do a describe(c(5,3,76,4/0)), for example, the last value is Inf but the error is not thrown.
But I can save the vector and load it and the error still occurs. Would someone be willing to look at that vector and maybe finds out the root of the problem? (I'll send the vector by email)
As I said in the earlier email, the data is imported with read.dta of the foreign library and the only manipulation I do is dividing the values of two columns by each other.
Thanks a million,
Werner
I have a weird problem with my data but I cannot really
locate it and cannot make a small example data set do
reproduce the problem.
I basically divide one numerical column of a data frame
with another. When I run describe() on that column, I get
"Error in vector("integer", length) : vector size cannot be
NA/NaN"
The two original columns comprise many zero values and I
think the particular row which causes the problem ends up
with an "Inf".
I fear that other functions might also not be reliable for
this data and that I have to repair it somehow. It actually
happens with many of the variables from the various tables
which originally are in Stata .dta format and which I import
with the foreign library.
I am working on windows XP and R 2.9.1
I assume that this description is too vague but if anybody
has an idea, I would appreciate it.
Thanks so much,
Werner
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
William Dunlap
2009-09-21 17:31:45 UTC
Permalink
-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of Peter Ehlers
Sent: Monday, September 21, 2009 9:29 AM
To: Werner Wernersen
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] weird "vector size cannot be NA/NaN" problem
Werner,
Thanks for sending the data.
The problem does seem to lie with describe() in pkg:Hmisc.
Frank may want to know that it can be triggered by
f <- function(n)describe(c(1:n,1/0))
f(18) #ok
f(19) #triggers the error
Perhaps it's related to the "at least 20 unique values" condition
mentioned in ?describe.
The call to range() in describe.vector needs the finite=TRUE
argument, so it returns the range of only the finite elements
of the input.

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com
Peter Ehlers
Post by Werner Wernersen
Hi,
I have to follow up my own question since this problem is
getting quite disturbing and I fear that it also causes other
functions to malfunction without notice.
Post by Werner Wernersen
It occurs quite quite often when I manipulate the mentioned
data set. It definitely is caused by the column entries which
are Inf (caused by a value/0 operation) but I cannot
reproduce the error. When I do a describe(c(5,3,76,4/0)), for
example, the last value is Inf but the error is not thrown.
Post by Werner Wernersen
But I can save the vector and load it and the error still
occurs. Would someone be willing to look at that vector and
maybe finds out the root of the problem? (I'll send the
vector by email)
Post by Werner Wernersen
As I said in the earlier email, the data is imported with
read.dta of the foreign library and the only manipulation I
do is dividing the values of two columns by each other.
Post by Werner Wernersen
Thanks a million,
Werner
I have a weird problem with my data but I cannot really
locate it and cannot make a small example data set do
reproduce the problem.
I basically divide one numerical column of a data frame
with another. When I run describe() on that column, I get
"Error in vector("integer", length) : vector size cannot be
NA/NaN"
The two original columns comprise many zero values and I
think the particular row which causes the problem ends up
with an "Inf".
I fear that other functions might also not be reliable for
this data and that I have to repair it somehow. It actually
happens with many of the variables from the various tables
which originally are in Stata .dta format and which I import
with the foreign library.
I am working on windows XP and R 2.9.1
I assume that this description is too vague but if anybody
has an idea, I would appreciate it.
Thanks so much,
Werner
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
Post by Werner Wernersen
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Peter Ehlers
2009-09-21 18:05:57 UTC
Permalink
Good spot Bill,

and the error message comes from tabulate().

Peter Ehlers
Post by William Dunlap
-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of Peter Ehlers
Sent: Monday, September 21, 2009 9:29 AM
To: Werner Wernersen
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] weird "vector size cannot be NA/NaN" problem
Werner,
Thanks for sending the data.
The problem does seem to lie with describe() in pkg:Hmisc.
Frank may want to know that it can be triggered by
f <- function(n)describe(c(1:n,1/0))
f(18) #ok
f(19) #triggers the error
Perhaps it's related to the "at least 20 unique values" condition
mentioned in ?describe.
The call to range() in describe.vector needs the finite=TRUE
argument, so it returns the range of only the finite elements
of the input.
Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com
Peter Ehlers
Post by Werner Wernersen
Hi,
I have to follow up my own question since this problem is
getting quite disturbing and I fear that it also causes other
functions to malfunction without notice.
Post by Werner Wernersen
It occurs quite quite often when I manipulate the mentioned
data set. It definitely is caused by the column entries which
are Inf (caused by a value/0 operation) but I cannot
reproduce the error. When I do a describe(c(5,3,76,4/0)), for
example, the last value is Inf but the error is not thrown.
Post by Werner Wernersen
But I can save the vector and load it and the error still
occurs. Would someone be willing to look at that vector and
maybe finds out the root of the problem? (I'll send the
vector by email)
Post by Werner Wernersen
As I said in the earlier email, the data is imported with
read.dta of the foreign library and the only manipulation I
do is dividing the values of two columns by each other.
Post by Werner Wernersen
Thanks a million,
Werner
I have a weird problem with my data but I cannot really
locate it and cannot make a small example data set do
reproduce the problem.
I basically divide one numerical column of a data frame
with another. When I run describe() on that column, I get
"Error in vector("integer", length) : vector size cannot be
NA/NaN"
The two original columns comprise many zero values and I
think the particular row which causes the problem ends up
with an "Inf".
I fear that other functions might also not be reliable for
this data and that I have to repair it somehow. It actually
happens with many of the variables from the various tables
which originally are in Stata .dta format and which I import
with the foreign library.
I am working on windows XP and R 2.9.1
I assume that this description is too vague but if anybody
has an idea, I would appreciate it.
Thanks so much,
Werner
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
Post by Werner Wernersen
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...