Displaying 20 results from an estimated 10000 matches similar to: "row names of 'rowsum()'"
2011 Mar 25
2
two minor bugs in rowsum()
(a) In R 2.12.2 rowsum can overflow if given an integer input:
> rowsum(c(2e9L, 2e9L), c("a", "a"))
[,1]
a -294967296
> 2^32 + .Last.value
[,1]
a 4e+09
Should it be changed to coerce its x argument to numeric
(double precision) so it always returns a numeric output?
(b) When rowsum is given an x containing both NaN and NA it
appears to use the last
2015 Aug 21
1
sequence divided by data.frame
Can anyone explain me the following behavior:
> 1:2/1
[1] 1 2
-- makes sense
> 1:2/matrix(1,1,1)
[1] 1 2
-- makes sense
> 1:2/data.frame(a=1)
a
1 1
-- why is this different?
Best,
Ott
--
Ott Toomet
Visiting Researcher
School of Information
Mary Gates Hall, Suite 095
University of Washington
Seattle, WA 98195
[[alternative HTML version deleted]]
2016 Sep 22
1
as.character.factor and S4 object containing factor
Do I mess up something or is this a bug? If I define an S4 object
that contains "factor", all the tests indicate that it is a factor but
as.character.factor() complains of it being a non-factor...
> setClass("Foo", contains="factor")
> a <- new("Foo", factor(1:3))
> a
Object of class "Foo"
[1] 1 2 3
Levels: 1 2 3
> class(a)
[1]
2003 Aug 26
3
plot empirical pdf
Hi,
are there any function to plot the empirical probability distribution
function? I just don't want to reinvent the wheel...
Best wishes,
Ott
--
Ott Toomet
PhD Student
Dept. of Economics
?rhus University
Building 322
Universitetsparken
8000 ?rhus C
Denmark
otoomet (a) econ au dk
ph: (+45) 89 42 20 27
-------------------------------------------
(o_ (*_ (O_
2017 Jun 22
5
Hunting a histogram variant
I'm looking for a histogram variant in which data points are plotted as labelled rectangles 'piled up' to form a histogram. I've posted an example at https://www.dropbox.com/s/ozi8bhdn5kqaufm/labelled_histogram.png?dl=0
It seems to have a long pedigree, as I see it (as in this example) in documents going back beyond the '80s. But I've not seen it in recent textbooks. So it
2017 Jul 20
3
Precision of values > 53 bits
> On 10 Jan 2013, at 15:56 , S Ellison <S.Ellison at lgcgroup.com> wrote:
>
>
>
>> I am working with large numbers and identified that R looses
>> precision for such high numbers.
> Yes. R uses standard 32-bit double precision.
Well, for large values of 32... such as 64.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
2011 Mar 29
1
rowsum
> with the entirely different rowSums, but it has been around
> for a long time.)
A lot longer than rowSums ...
> Bill Dunlap
> Spotfire, TIBCO Software
---
This made me smile. The rowsums function was originally an internal
part of the survival package, used for fast computation of certain sums
when there is a cluster() statement. It was Statistical
2007 Mar 24
1
frequency tables and sorting by rowSum
Dear list,
I have some trouble generating a frequency table over a number of vectors.
Creating these tables over simple numbers is no problem with table()
> table(c(1,1,1,3,4,5))
1 3 4 5
3 1 1 1
, but how can i for example turn:
0 1 0
0 0 1
0 1 0
1 0 0
0 1 0
1 0 0
into
0 0 1 1
1 0 0 2
0 1 0 3
My second problem is, sorting rows and columns of a matrix by the rowSums/colSums.
I did it
2015 Oct 06
5
authorship and citation
> The former co-author contributed, so he is still author and probably copyright
> holder and has to be listed among the authors, otherwise it would be a CRAN
> policy violation ...
It's a bit of a philosophical question right now, but at some point in a developing package's life - particularly one that starts small but is subsequently refactored in growth - there may be no code
2002 Oct 29
1
pretty not pretty
Hi,
I have a following vector:
> smallch
[1] 0.0652840 0.1181300 0.0319370 0.0155700 0.0464110 0.0107850
[7] 0.0158970 0.0375900 0.0603090 0.0310300 0.0105920 0.0540580
[13] -0.0177740 0.0039393
Pretty (R 1.5.1) has problems with zero:
> pretty(smallch)
[1] -2.000000e-02 -3.469447e-18 2.000000e-02 4.000000e-02 6.000000e-02
[6] 8.000000e-02 1.000000e-01 1.200000e-01
2002 Oct 29
1
pretty not pretty
Hi,
I have a following vector:
> smallch
[1] 0.0652840 0.1181300 0.0319370 0.0155700 0.0464110 0.0107850
[7] 0.0158970 0.0375900 0.0603090 0.0310300 0.0105920 0.0540580
[13] -0.0177740 0.0039393
Pretty (R 1.5.1) has problems with zero:
> pretty(smallch)
[1] -2.000000e-02 -3.469447e-18 2.000000e-02 4.000000e-02 6.000000e-02
[6] 8.000000e-02 1.000000e-01 1.200000e-01
2019 Aug 30
3
?Syntax wrong about `?`'s precedence ?
Precedence is a property of the parser and has nothing to do with the
semantics assigned to various symbols. Using just core R functions you can
see the precedence of '?' is between those of '=' and '<-'.
> # '=' has lower precedence than '?'
> str(as.list(parse(text="a ? b = c")[[1]]))
List of 3
$ : symbol =
$ : language `?`(a, b)
$
2001 Sep 13
1
rowsum dimnames
Hi,
The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.:
> rowsum(matrix(1:12, 3,4), c("Y","X","Y"))
[,1] [,2] [,3] [,4]
1 2 5 8 11
2 4 10 16 22
whereas S-Plus gives the more useful result:
[,1] [,2] [,3] [,4]
X 2 5 8 11
Y 4 10 16 22
This is because R's rowsum() code gives
2001 Sep 14
1
rowsum dimnames (PR#1092)
The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.:
> rowsum(matrix(1:12, 3,4), c("Y","X","Y"))
[,1] [,2] [,3] [,4]
1 2 5 8 11
2 4 10 16 22
whereas S-Plus gives the more useful result:
[,1] [,2] [,3] [,4]
X 2 5 8 11
Y 4 10 16 22
This is because R's rowsum() code gives the
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")
2003 Aug 13
2
rowsum() may return a vector instead of a matrix (PR#3737)
If all rows are in the same "group", rowsum() returns a vector instead of a
(1xN) matrix, contrary to documentation:
R> print(z <- rowsum(matrix(1:12, 3,4), rep("x",3)))
[1] 6 15 24 33
R> dim(z)
NULL
It worked correctly in version 1.4.0 but was broken by version 1.6.1. I'm
currently using 1.7.1 under Solaris 2.8.
--please do not edit the information
2004 Jun 08
3
make fails with utf-8 locale, RH9 (PR#6958)
Hi,
I have an RH9 box (gcc (GCC) 3.2.2, perl 5.8.0, make 3.79.1). My
locale is
LANG="et_EE.UTF-8"
I do:
$ ./configure --prefix=/usr/local
...
$ make
...
make[4]: Entering directory `/home/otoomet/a/R-1.9.0/src/library/stats4'
dumping R code in package 'stats4'
Error in structure(c(unlist(lapply(list(...), unclass))), class = c("POSIXt", :
couldn't
2003 Mar 21
1
barplot legend size
Dear R-people,
are there any way to change the size of legend in barplot? I have
tried various versions of cex, both as par(cex.*= ) and barplot(...,
cex.*= ). So long without success.
Sincerely,
Ott
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
2008 Mar 25
2
help with rowsum/aggregate type functions
Hi--
This is a question with a trivial and obvious answer, I'm sure, but I can't seem to find it in the help files and books that I have handy. I have a dataframe consisting of two columns, "Gene_Name," a list of gene symbols, and "Number," a numeric measure of how frequently a tag representing that gene showed up in a SAGE library. Several of the genes are
2013 Feb 06
1
weighing proportion of rowSums in dataframe
Dear R-List,
I am sure there must be a very simple way to do this - I just do not know how...
This is what I want to do:
#my dataframe
df<-data.frame(id=c("x01","x02","x03","x04","x05","x06"),a=c(1,2,NA,4,5,6),b=c(2,4,6,8,10,NA),c=c(NA,3,9,12,NA,NA),sum=c(3,9,15,24,15,6))
id a b c sum
1 x01 1 2 NA 3
2