similar to: row.names in data.frame

Displaying 20 results from an estimated 80000 matches similar to: "row.names in data.frame"

2014 Nov 10
1
subscripting a data.frame (without changing row order) changes internal row.names
Dear R-devel, Can anyone help me to understand this? It seems that subscripting the rows of a data.frame without actually changing their order, somehow changes an internal representation of row.names that is revealed by e.g. dput/dump/serialize I have read the docs and inspected the (R) code for data.frame, rownames, row.names and dput without enlightenment. df=data.frame(a=1:10, b=1)
2008 Nov 03
0
row.names(data.frame(matrixWithDimnames)) depends on first (PR#13244)
On Thu, 30 Oct 2008, wdunlap at tibco.com wrote: > Full_Name: Bill Dunlap > Version: R version 2.9.0 Under development (unstable) (2008-10-29 r46795) > OS: Linux > Submission from: (NULL) (76.28.245.14) > > > When data.frame() is given a matrix with rownames, then the type of the output > row names depends on whether the first element of the input row names is ""
2000 Dec 31
0
editor in Windows doesn't like a data frame with row names (PR#798)
On Sun, 31 Dec 2000 jfox@mcmaster.ca wrote: > The editor in R version 1.2.0 returns an error after editing a data frame > that has row names. This is on a Windows 2000 system, but I've encountered > the same problem under Windows 95. Here's a simple example: Actually, that's not where the error is. If you use traceback() you will see it is in edit.data.frame. That tries
2008 Oct 30
1
row.names(data.frame(matrixWithDimnames)) depends on first rowname being "" or not. (PR#13230)
Full_Name: Bill Dunlap Version: R version 2.9.0 Under development (unstable) (2008-10-29 r46795) OS: Linux Submission from: (NULL) (76.28.245.14) When data.frame() is given a matrix with rownames, then the type of the output row names depends on whether the first element of the input row names is "" or not. The other elements of the input row names don't affect things. E.g.,
2013 Jan 02
2
In which column and in which row a number is in a matrix
Dear all, Happy New Year for all of you! I hope we have an year of essential freedom for everyone! I am trying to manipulate a matrix in order to know in which column and in which row a number is allocated. But, when we use the function "which" it returns the position of the number in the "vector representation of the matrix". For example: >
2012 Mar 06
2
Why aren't row names in a data frame unique?
I expected the row names to be unique but a data frame appears to be able to hold duplicate row names. This makes me thing that there must be circumstances when it is necessary. However, I cannot think of any. Please enlighten me. [[alternative HTML version deleted]]
1998 Jan 16
1
data.frame(...) not constructing "1:n" row.names [diff. S <--> R]
[I think Doug Bates has already alluded to this, somewhere..] In R, data.frame( ... ) does not construct row.names whereas in S, it does: R: > data.frame(x=1:2,y=3:4) x y [1,] 1 3 [2,] 2 4 > row.names(data.frame(x=1:2,y=3:4)) NULL S-plus: > data.frame(x=1:2,y=3:4) x y 1 1 3 2 2 4 > row.names(data.frame(x=1:2,y=3:4)) [1] "1" "2"
2009 Mar 17
1
question on "row.names" attribute of dataframe when called from a compiled package
Why does the following show a class attribute of "character" when using the interpreter: x <- data.frame(hat=1:10) class(rownames(x)) ## returns [1] "character" but when called from c/cpp, the rownames attribute has no class attribute, and is in fact a vector of INTSXP? > .Call("print_class_of_rownames", x, package = "test") length(x): 10
2018 Mar 01
2
Bug report - duplicate row names with as.data.frame()
Hello, I'd like to report what I think is a bug: using as.data.frame() we can create duplicate row names in a data frame. R version 3.4.3 (current stable release). Rather than paste code in an email, please see the example formatted code here: https://stackoverflow.com/questions/49031523/duplicate-row-names-in-r-using-as-data-frame I posted to StackOverflow, and consensus was that we should
2006 Mar 14
3
ActiveRecord row-by-row processing
I want to use ActiveRecord outside of Rails to do processing on large tables. I want to be able to process the rows as they are retrieved rather than having to store the results in an intermediate array. Any suggestions? Looks like I could hack the adapter to provide an accessor to the underlying DBI handle. Anything cleaner than that?
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 27
1
getdate_column
Plugin location: http://svn.kylemaxwell.com/getdate_column/ ** Won''t work on Windows ** OVERVIEW =================== Getdate_column is designed to make the accessor methods of a datetime column accept and return string representations of the date (e.g. "today", "10 days from now", "1/2/06 10pm"). I personally find date controls on the web to be clumsy,
2003 Dec 02
1
setMethod("min", "myclass", ...)
Hello, I have defined a new class > setClass("myclass", representation(min = "numeric", max = "numeric")) and want to write accessor functions, so that for > foo = new("myclass", min = 0, max = 1) > min(foo) # prints 0 > max(foo) # prints 1 At first i created a generic function for "min" > setGeneric("min",
2009 Oct 23
1
data.frame tall skinny transformation
Hi, I have a data.frame that looks something like this. feature 5637 ? ? ? ? ? ? ? ?1321N1 feature1 -0.568750616 -0.934748758 feature2 -0.913080902 -0.941455172 feature3 0.442477294 -0.257921866 I want to change it to look like this. feature ? ? ?cell.line ? ? value feature1 5637 -0.568750616 feature2 5637 -0.913080902 feature3 5637 0.442477294 feature1 1321N1
2008 Dec 11
1
Extract rows from data frame based on row names from another data frame
Hi all, Is there a function to extract row names from a data frame based on row names from another data frame? I can write a loop function to do this, but this may be inefficient in terms of processing. thanks for any information, Wade
2008 Oct 31
1
Proper way to write data frame with column and row names
I need to write a data frame along with its column and row names to a text file. However, the first row in the text file is always short of one element. I have tried setting different parameters to write.table but that didn't help. > m A B C 1 2 D 3 4 Using write.table(m, "table.xls", sep="\t", col.names=T, row.names=T) gives A B C 1 2 D 3 4
2010 Jul 05
3
adding a row of names to data.frame
Relative noob here, I have a data.frame and simply want to add an explicit column of names in column 1 of the form "trial_number01" for row 1, "trial_number02" for row 2 .... etc. It is simply for visual purposes and to explain data to others. I've tried Using row.names and other but still no luck, am sure it has been covered but I can't find it, can you please point
2007 Jul 14
1
row names and identical
Below x1, x2 and x3 all have the same data and all have the same value for row.names(x); however, the internal values of their row.names differ. The internal value of row.names is c(NA, -4L) for x1, c(NA, 4L) for x2 and c("1", "2", "3", "4") for x3; nevertheless, identical regards x1 and x2 as identical while x3 is not identical to either of x1 or x2. Is
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'