Displaying 20 results from an estimated 30000 matches similar to: "row.names(), rownames(), colnames(), names() ...?"
2016 Apr 03
0
row.names(), rownames(), colnames(), names() ...?
Data frames are lists of columns. The names() function is appropriate for lists.
It doesn't pay to fall into the trap of thinking that data frames are truly symmetric between columns and rows, because there is a performance penalty for accessing rows that is greater than the cost of accessing columns. With that in mind, thinking of data frames as lists is preferred, so names is preferred
2000 Dec 11
2
row.names, rownames; colnames, no col.names?
There's a bit of a symmetry issue, which may or may not be important
(led to 15 seconds of confusion until I got my bearings straight):
row.names, rownames; colnames, no col.names?
I _NOW_ realize the difference between row.names and rownames, but
is there any reason not to have col.names for re-naming columns in a
data.frame?
(if there is, I don't particular need to know it, but it
2006 Mar 21
1
rownames, colnames, and date and time
I noticed something surprising (in R 2.2.1 on WinXP)
According to the documentation, rownames and colnames are character vectors.
Assigning a vector of class POSIXct or POSIXlt as rownames or colnames
therefore is not strictly according to the rules.
In some cases, R performs a reasonable typecast, but in some other cases
where the same typecast also would be possible, it does not.
Assigning a
2006 Mar 21
1
rownames, colnames, and date and time
I noticed something surprising (in R 2.2.1 on WinXP)
According to the documentation, rownames and colnames are character vectors.
Assigning a vector of class POSIXct or POSIXlt as rownames or colnames
therefore is not strictly according to the rules.
In some cases, R performs a reasonable typecast, but in some other cases
where the same typecast also would be possible, it does not.
Assigning a
2006 Jul 03
1
rownames, colnames, and date and time
Hi all
I was wondering whether there has ever been an update on the rownames and
colnames behaviour as described by Eric below?
I still get the same behaviour, exactly as described by Eric, on my WinXP
installation of R-2.3.0. I also posted a message to r-help on Friday but
looking through the online archives it seems to have not made it to the
list. I would agree with Eric that a consistent
2004 Aug 20
3
Loss of rownames and colnames
Hi,
I am working on some microarray data, and have some problems with
writing iterations.
In essence, the problem is that objects with three dimensions don't
have rownames and colnames. These colnames and rownames would
otherwise still be there in 2 dimensional objects.
I need to generate multiple iterations of a 2 means-clustering
algorithm, and these objects thus probably need 3
1998 Nov 09
1
Proposal for discussion: COLNAMES & ROWNAMES
Looking into several different parts of R../src/library/base/R/*.R
has led me to the conclusion
that quite a bit of code doubling could be saved by using the following two
functions whose naming philosophy is derived from that of NROW() & NCOL():
COLNAMES <- function(x)
if(is.null(n <- colnames(x))) paste(seq(length=NCOL(x))) else n
ROWNAMES <- function(x)
2017 Sep 25
2
Subset
myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"),
b = c("<0.1", 1, 0.3, 5, "Nil"),
stringsAsFactors = FALSE)
# you can subset the b-column in several ways
myDF[ , 2]
myDF[ , "b"]
myDF$b
# using the column, you make a logical vector
! is.na(as.numeric(myDF$b))
# This can be used to select the
2017 Sep 25
1
Subset
Always via logical expressions. In this case you can use the logical expression
myDF$b != "0"
to give you a vector of TRUE/FALSE
B.
> On Sep 25, 2017, at 8:00 AM, Shane Carey <careyshan at gmail.com> wrote:
>
> This is super, really helpfull. Sorry, one final question, lets say I wanted to remove 0's rather than NAs , what would it be?
>
> Thanks
>
2017 Jun 28
4
Nash equilibrium and other game theory tools implemented in networks using igraph or similar
I responded to the unhelpful suggestion "Why don't you implement and uplad the package to CRAN?" No mention of a search engine. Is this what you are commenting on Jeff?
> On Jun 28, 2017, at 5:41 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:
>
> In what way does reminding people that packages exist because others just like them contributed something
2017 Dec 08
2
Curiously short cycles in iterated permutations with the same seed
I have noticed that when I iterate permutations of short vectors with the same seed, the cycle lengths are much shorter than I would expect by chance. For example:
X <- 1:10
Xorig <- X
start <- 112358
N <- 10
for (i in 1:N) {
seed <- start + i
for (j in 1:1000) { # Maximum cycle length to consider
set.seed(seed) # Re-seed RNG to same initial state
X <- sample(X)
2018 Mar 21
2
Sum of columns of a data frame equal to NA when all the elements are NA
No. The empty sum is zero. Adding it to another sum should not change it. Nothing audacious about that. This is consistent; other definitions just cause trouble.
-pd
> On 21 Mar 2018, at 18:05 , Boris Steipe <boris.steipe at utoronto.ca> wrote:
>
> Surely the result of summation of non-existent values is not defined, is it not? And since the NA values have been _removed_,
2017 Sep 22
3
Subset
Super,
Thanks
On Fri, Sep 22, 2017 at 4:57 PM, Boris Steipe <boris.steipe at utoronto.ca>
wrote:
> > a <- c("<0.1", NA, 0.3, 5, "Nil")
> > a
> [1] "<0.1" NA "0.3" "5" "Nil"
>
> > b <- as.numeric(a)
> Warning message:
> NAs introduced by coercion
> > b
> [1] NA NA 0.3
2023 Jul 22
2
plotly
ChatGPT-4:
------ Query: ----------------------------------
Thank you. The `value` in the code example is 2874. The plot shows a large number at the center and a smaller value computed as a delta relative to the `reference` of 4800. But the large value is given as 2870, and the smaller value is given as -1930 i.e. both values are rounded. Can I control the precision of these two numbers?
2006 May 01
1
row.names != rownames for data.frame?
With a recent R 2.4 I notice the following:
df <- data.frame(x=1:2)
> row.names(df)
[1] "1" "2"
> rownames(df)
[1] 1 2
This seems related to recent changes in the internal storage format of
the row names data for data frames.
The man page for rownames says:
For a data frame, 'rownames' and 'colnames' are equivalent to
'row.names'
2017 Sep 25
0
Subset
This is super, really helpfull. Sorry, one final question, lets say I
wanted to remove 0's rather than NAs , what would it be?
Thanks
On Mon, Sep 25, 2017 at 12:41 PM, Boris Steipe <boris.steipe at utoronto.ca>
wrote:
> myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"),
> b = c("<0.1", 1, 0.3, 5, "Nil"),
>
2017 Aug 03
0
find similar words in text
Please keep messages on the list so others can pitch in.
_Which_ words do you want to consider identical for the purpose of frequency count?
_What_ do you want to plot?
B.
> On Aug 3, 2017, at 4:36 PM, Riaan Van Der Walt <Riaan.VanDerWalt at nwu.ac.za> wrote:
>
> Hallo Boris,
> I've loaded the Rstem, Snowball.
> But I am clueless how to get a list eg. whal* (whale,
2017 Nov 18
3
Complicated analysis for huge databases
The loop :
AllMAFs <- list()
for (i in length(SeparatedGroupsofmealsCombs) {
AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) ))
}
gives these errors (I tried this many times and I'm sure I copied it entirely) :-
Error in apply(SeparatedGroupsofmealsCombs[[i]], 2, function(x) maf(tabulate(x + :
object 'i' not found
> }
2017 Nov 18
2
Complicated analysis for huge databases
Although the loop seems to be formulated correctly I wonder why
it gives me these errors :
-object 'i' not found
- unexpected '}' in "}"
the desired output is expected to be very large as for each dataframe in the list of dataframes I expect to see maf value for each of the 600 columns! and this is only for
for one dataframe in the list .. I have around 150-200
2010 Jul 28
1
How get colnames and rownames in Rcpp method?
Hi all,
How get colnames and rownames in Rcpp method?
attecthed file : RGui.exe capture
my work environment :
R version : 2.11.1
OS : WinXP Pro sp3
Thanks and best regards.
Young-Ju, Park
from Korea
[1][rKWLzcpt.zNp8gmPEwGJCA00]
[@from=dllmain&rcpt=r%2Dhelp%40r%2Dproject%2Eorg&msgid=%3C20100728211143%2EH