Displaying 20 results from an estimated 80000 matches similar to: "print data frames without row names (within a list)"
2007 May 24
1
Is it possible to print a data.frame without the row names?
Is it possible to print a data.frame without the row names? I checked
?data.frame, ?print, ?format and didn't see anything that helped. In
the example below, I would just like to show the two columns of data and
not the row.names 1:10.
> a<-data.frame(1:10, 21:30)
> a
X1.10 X21.30
1 1 21
2 2 22
3 3 23
4 4 24
5 5 25
6 6 26
7
2005 Aug 02
3
how to print a data.frame without row.names
Dear All,
is there a simple way to print a data.frame without its row.names?
example:
datum <- as.Date(c("2004-01-01", "2004-01-06", "2004-04-12"))
content <- c('Neujahr', 'Hl 3 K.', 'Ostern')
df1 <- data.frame(datum, content)
print(df1)
datum content
1 2004-01-01 Neujahr
2 2004-01-06 Hl 3 K.
3 2004-04-12 Ostern
Can I get
2009 Sep 04
2
transforming a badly organized data base into a list of data frames
Dear R-ers!
I have a badly organized data base in Excel. Once I read it into R it
looks like this (all variables become factors because of many spaces
and other characters in Excel):
2010 Jan 08
3
Print data frame as list including row/column name
Hi all,
I have the following problem:
I have a data frame (actually it is a prop.table) which I want to print as a
list, e.g.:
C1 C2 C3
R1 0.0 0.0 1.0
R2 1.0 0.0 0.0
R3 0.0 0.0 0.0
R4 0.0 1.0 0.0
should be printed like
C1;R1;0.0
C2;R1;0.0
C3;R1;1.0
C1;R2;1.0
C2;R2;0.0
.....
Is there any existing solution out there or could somebody please give me a
hint on how to
2009 Mar 07
4
merge data frames with same column names of different lengths and missing values
Hello, I'm switching over from SAS to R and am having trouble merging data frames. The data frames have several columns with the same name, and each has a different number of rows. Some of the values are missing from cells with the same column names in each data frame. I had hoped that when I merged the dataframes, every column with the same name would be merged, with the value in a complete
1999 Jan 20
1
data frames with non-unique row.names
In R and S, the general idea is that data.frames
must have unique row.names (aka dimnames(.)[[1]]).
Several observations / problems (in R *and* S !).
[Example code at the end]
1)
Both in S and R,
data.frame(..)
(and e.g., also cbind(<data.frame>, ..) which dispatches to data.frame())
silently drops the whole row.names and replaces it by "1" "2" ...
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)
2011 Aug 31
1
Convert List of Data.Frames to Data.Frame when List has NULL
Dear R gurus,
I trying to convert a list of data frames to one data frame, but one of the values within the list is NULL, so I get the error "arguments imply differing number of rows." Do you know of a quick way to tell R to combine all that are not null? Here is a simple example:
>
1999 Jan 20
0
data frames with non-unique row.names (PR#98)
(following up on myself:)
>>>>> "MM" == Martin Maechler <maechler@stat.math.ethz.ch> writes:
MM> In R and S, the general idea is that data.frames
MM> must have unique row.names (aka dimnames(.)[[1]]).
MM> Several observations / problems (in R *and* S !).
....
MM> 2)
MM> Now, in S (but not in R),
MM> the
2012 Jul 18
2
duplicate data between two data frames according to row names
Hi everybody.
I'll first explain my problem and what I'm trying to do.
Admit this example:
I'm working on 5 different weather stations.
I have first in one file 3 of these 5 weather stations, containing their
data. Here's an example of this file:
DF1 <- data.frame(station=c("ST001","ST004","ST005"),data=c(5,2,8))
And my two other stations in
2005 Feb 12
3
data.frame into list by columns; merge and row.names
Hi
a)
I want to make a list out of a data.frame, where each element of the
list is a column of the data.frame.
I looked in the archives and saw a lot of postings but surprsingly
none elucidated me. I also tried the split, aggregate help files and
counldn't see any easy way to do this. I wouldn't be surprised if
it's there, but I really didn't see it.
I solved the problem
2006 Jul 20
3
How do I modify an exported function in a locked environment?
Running R.app on Mac OS X 10.4
> version
_
platform powerpc-apple-darwin8.6.0
arch powerpc
os darwin8.6.0
system powerpc, darwin8.6.0
status
major 2
minor 3.1
year 2006
2006 Jul 20
3
How do I modify an exported function in a locked environment?
Running R.app on Mac OS X 10.4
> version
_
platform powerpc-apple-darwin8.6.0
arch powerpc
os darwin8.6.0
system powerpc, darwin8.6.0
status
major 2
minor 3.1
year 2006
2006 Nov 08
1
a list with row.names = c(NA, 1000)
R users,
I posted a message on "error message for row names". I looked at a saved
file that has a list structure.
I found that some of list components have row.names = c(NA, 1000). I
compared what I did with R.2.3.0 with what I did with R.2.4.0.
Previously, with R.2.3.0, row.names = c("1", "2", "3", ...., "1000"). What
do I need to read the
2008 Sep 24
2
print.data.frame : row.name = FALSE not having intended effect
Hi,
Does anybody know if row.name = FALSE actually works in v2.6.2?
Because it isn't working for me... here is some sample code and
output:
====+====+====+====+====+====+====+====+====+====+
> print(x,row.names = FALSE)
party_abbr candidate_name votes_candidate
2 DFL AMY KLOBUCHAR 1,278,849
5 R MARK KENNEDY 835,653
4 IP
2004 Nov 01
5
make apply() return a list
Hi,
I have a dataframe (say myData) and want to get a list (say myList) that
contains a matrix for each row of the dataframe myData. These matrices are
calculated based on the corresponding row of myData. Using a for()-loop to do
this is very slow. Thus, I tried to use apply(). However, afaik apply() does
only return a list if the matrices have different dimensions, while my
matrices have
2010 Dec 07
3
How to find out if a data frame has automatic row names?
Hi all,
I just stumbled across the difference between explicit and 'automatic'
row names for data frames. Is there a quick way to find out if a data
frame has automatic row names or not? Of course I know this for data
frames that I create myself, but what if a function needs to extract
this information for an argument?
The following example shows that this property is not easily
2023 Mar 27
3
printing a data.frame without row numbers
R 4.2.3
OS X
Colleagues,
I am printing a large number of tables using the print command. A simple example is:
print(data.frame(COL1=1:5, COL2=10:6))
The result in this case is:
COL1 COL2
1 1 10
2 2 9
3 3 8
4 4 7
5 5 6
I would like to print the table WITHOUT the row numbers:
COL1 COL2
1 10
2 9
3 8
4 7
5 6
Is there any simple
2016 Jan 13
3
as.data.frame and illegal row.names argument (bug in package:DoE.wrapper?)
as.data.frame methods behave inconsistently when they are given a row.name
argument of the wrong length. The matrix method silently ignores row.names
if it has the wrong length and the numeric, integer, and character methods
do not bother to check and thus make an illegal data.frame.
> as.data.frame(matrix(1:6,nrow=3), row.names=c("One","Two"))
V1 V2
1 1 4
2 2 5
3 3
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'