You can use:
print(dd1, row.names=F)
# Chisq DF Pr(>Chisq) term
153.0216306 1 7.578366e-35 # Sex
13.3696538 1 5.114571e-04 # Volume
0.8476713 1 7.144239e-01 # Weight
1.2196050 1 5.388764e-01 # Intensity
2.6349405 1 2.090719e-01 # ISO
6.0507714 1 2
On Jul 4, 2014, at 7:27 AM, Gang Chen wrote:
I really your kind help! This is exactly what I was looking for
except that I need to get rid of the numbered row names.
Look at the documentation:
?print.data.frame
You cannot "get rid of" rownames in dataframes (at least as far as I
know)
I really your kind help! This is exactly what I was looking for except that I
need to get rid of the numbered row names.
On July 3, 2014 9:57:00 PM EDT, arun wrote:
>Hi,
>May be this helps:
>nC <- max(nchar(row.names(dd)))
>Â term <- formatC(row.names(dd), width=-nC)
>#or
>Â term <- sprintf("%-1
; 2.6349405 1 2.090719e-01 # ISO
> 6.0507714 1 2.780045e-02 # SEC
>
>
>David Carlson
>
>-Original Message-
>From: r-help-boun...@r-project.org
>[mailto:r-help-boun...@r-project.org] On Behalf Of Gang Chen
>Sent: Thursday, July 3, 2014 2:56 PM
>To: r-h
Hi,
May be this helps:
nC <- max(nchar(row.names(dd)))
term <- formatC(row.names(dd), width=-nC)
#or
term <- sprintf("%-11s", row.names(dd))
dd1 <- setNames(data.frame(unname(dd), term,stringsAsFactors=F),
c(colnames(dd), formatC("term",width=-nC)))
dd1
# # Chisq DF Pr(>Chisq) term
un...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Gang Chen
Sent: Thursday, July 3, 2014 2:56 PM
To: r-help
Subject: [R] Display a dataframe
I have a matrix 'dd' defined as below:
dd <- t(matrix(c(153.0216306, 1, 7.578366e-35,
13.3696538, 1, 5.114571e-04,
0.8476713
I have a matrix 'dd' defined as below:
dd <- t(matrix(c(153.0216306, 1, 7.578366e-35,
13.3696538, 1, 5.114571e-04,
0.8476713, 1, 7.144239e-01,
1.2196050, 1, 5.388764e-01,
2.6349405, 1, 2.090719e-01,
6.0507714, 1, 2.780045e-02), nrow=3, ncol=6))
dimnames(dd)[[2]] <- c('# Chisq', 'DF', 'Pr(>Ch
Hi Ed,
In addition to Michael's suggestion (which is probably what you want),
consider something like:
head(mtcars)
tail(mtcars)
or for just the corners, you could try a little function like this:
corner <- function(x, n = 3L, ...) {
stopifnot(length(n) == 1L)
if (n < 0L || n * 2 > min(dim(
Welcome to the dark-side!
I think the View() command will do what you want. This brings up a new
window that displays the data spreadsheet style and you can scroll wherever
you wish. If you want to do work in your command window, the head() and
tail() commands will be of help to you.
If you are j
Hi, all;
I'm new to R. Have been a SAS developer for over 20 years.
Whenever I create a new table - you call them dataFrame objects - or modify
an existing one, I like to open the table in a grid with horizontal and
vertical sliders so that I can scan across the table and (especially) look
10 matches
Mail list logo