Display a dataframe

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Display a dataframe

Gang Chen-4
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(>Chisq)')
dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '# Intensity',
'# ISO', '# SEC')

'dd' displays as the following:

                # Chisq DF   Pr(>Chisq)
# Sex       153.0216306  1 7.578366e-35
# Volume     13.3696538  1 5.114571e-04
# Weight      0.8476713  1 7.144239e-01
# Intensity   1.2196050  1 5.388764e-01
# ISO         2.6349405  1 2.090719e-01
# SEC         6.0507714  1 2.780045e-02

I would like to display it as:

# 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.780045e-02                                # SEC

This is what I came up with

(cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))

               X..Chisq DF   Pr..Chisq.        term
# Sex       153.0216306  1 7.578366e-35       # Sex
# Volume     13.3696538  1 5.114571e-04    # Volume
# Weight      0.8476713  1 7.144239e-01    # Weight
# Intensity   1.2196050  1 5.388764e-01 # Intensity
# ISO         2.6349405  1 2.090719e-01       # ISO
# SEC         6.0507714  1 2.780045e-02       # SEC

But I'm not happy with the following two issues:

1) How to get rid of the row names?
2) The special characters of #, (, >,) in the column names are not
displayed correctly.

Any suggestions?

Thanks,
Gang

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Display a dataframe

David Carlson
Not elegant, but it works:

> term <- dimnames(dd)[[1]]
> dd1 <- dd
> dimnames(dd1)[[1]] <- rep("", 6)
> dd2 <- capture.output(dd1)
> cat(paste(dd2, "   ", c("Term", term)), fill=48)
     # 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.780045e-02     # SEC


David Carlson

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] 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,  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(>Chisq)')
dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '# Intensity',
'# ISO', '# SEC')

'dd' displays as the following:

                # Chisq DF   Pr(>Chisq)
# Sex       153.0216306  1 7.578366e-35
# Volume     13.3696538  1 5.114571e-04
# Weight      0.8476713  1 7.144239e-01
# Intensity   1.2196050  1 5.388764e-01
# ISO         2.6349405  1 2.090719e-01
# SEC         6.0507714  1 2.780045e-02

I would like to display it as:

# 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.780045e-02                                # SEC

This is what I came up with

(cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))

               X..Chisq DF   Pr..Chisq.        term
# Sex       153.0216306  1 7.578366e-35       # Sex
# Volume     13.3696538  1 5.114571e-04    # Volume
# Weight      0.8476713  1 7.144239e-01    # Weight
# Intensity   1.2196050  1 5.388764e-01 # Intensity
# ISO         2.6349405  1 2.090719e-01       # ISO
# SEC         6.0507714  1 2.780045e-02       # SEC

But I'm not happy with the following two issues:

1) How to get rid of the row names?
2) The special characters of #, (, >,) in the column names are not
displayed correctly.

Any suggestions?

Thanks,
Gang

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Display a dataframe

arun kirshna
In reply to this post by Gang Chen-4
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      
#1 153.0216306  1 7.578366e-35 # Sex     
#2  13.3696538  1 5.114571e-04 # Volume  
#3   0.8476713  1 7.144239e-01 # Weight  
#4   1.2196050  1 5.388764e-01 # Intensity
#5   2.6349405  1 2.090719e-01 # ISO     
#6   6.0507714  1 2.780045e-02 # SEC     

A.K.





On Thursday, July 3, 2014 3:57 PM, Gang Chen <[hidden email]> wrote:
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(>Chisq)')
dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '# Intensity',
'# ISO', '# SEC')

'dd' displays as the following:

                # Chisq DF   Pr(>Chisq)
# Sex       153.0216306  1 7.578366e-35
# Volume     13.3696538  1 5.114571e-04
# Weight      0.8476713  1 7.144239e-01
# Intensity   1.2196050  1 5.388764e-01
# ISO         2.6349405  1 2.090719e-01
# SEC         6.0507714  1 2.780045e-02

I would like to display it as:

# 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.780045e-02                                # SEC

This is what I came up with

(cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))

               X..Chisq DF   Pr..Chisq.        term
# Sex       153.0216306  1 7.578366e-35       # Sex
# Volume     13.3696538  1 5.114571e-04    # Volume
# Weight      0.8476713  1 7.144239e-01    # Weight
# Intensity   1.2196050  1 5.388764e-01 # Intensity
# ISO         2.6349405  1 2.090719e-01       # ISO
# SEC         6.0507714  1 2.780045e-02       # SEC

But I'm not happy with the following two issues:

1) How to get rid of the row names?
2) The special characters of #, (, >,) in the column names are not
displayed correctly.

Any suggestions?

Thanks,
Gang

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Display a dataframe

Gang Chen-4
In reply to this post by David Carlson
Perfect! Thanks a lot!

On July 3, 2014 5:10:02 PM EDT, David L Carlson <[hidden email]> wrote:

>Not elegant, but it works:
>
>> term <- dimnames(dd)[[1]]
>> dd1 <- dd
>> dimnames(dd1)[[1]] <- rep("", 6)
>> dd2 <- capture.output(dd1)
>> cat(paste(dd2, "   ", c("Term", term)), fill=48)
>     # 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.780045e-02     # SEC
>
>
>David Carlson
>
>-----Original Message-----
>From: [hidden email]
>[mailto:[hidden email]] 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,  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(>Chisq)')
>dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '# Intensity',
>'# ISO', '# SEC')
>
>'dd' displays as the following:
>
>                # Chisq DF   Pr(>Chisq)
># Sex       153.0216306  1 7.578366e-35
># Volume     13.3696538  1 5.114571e-04
># Weight      0.8476713  1 7.144239e-01
># Intensity   1.2196050  1 5.388764e-01
># ISO         2.6349405  1 2.090719e-01
># SEC         6.0507714  1 2.780045e-02
>
>I would like to display it as:
>
># 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.780045e-02                                # SEC
>
>This is what I came up with
>
>(cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))
>
>               X..Chisq DF   Pr..Chisq.        term
># Sex       153.0216306  1 7.578366e-35       # Sex
># Volume     13.3696538  1 5.114571e-04    # Volume
># Weight      0.8476713  1 7.144239e-01    # Weight
># Intensity   1.2196050  1 5.388764e-01 # Intensity
># ISO         2.6349405  1 2.090719e-01       # ISO
># SEC         6.0507714  1 2.780045e-02       # SEC
>
>But I'm not happy with the following two issues:
>
>1) How to get rid of the row names?
>2) The special characters of #, (, >,) in the column names are not
>displayed correctly.
>
>Any suggestions?
>
>Thanks,
>Gang
>
>______________________________________________
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Display a dataframe

Gang Chen-4
In reply to this post by arun kirshna
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 <[hidden email]> wrote:

>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      
>#1 153.0216306  1 7.578366e-35 # Sex     
>#2  13.3696538  1 5.114571e-04 # Volume  
>#3   0.8476713  1 7.144239e-01 # Weight  
>#4   1.2196050  1 5.388764e-01 # Intensity
>#5   2.6349405  1 2.090719e-01 # ISO     
>#6   6.0507714  1 2.780045e-02 # SEC     
>
>A.K.
>
>
>
>
>
>On Thursday, July 3, 2014 3:57 PM, Gang Chen <[hidden email]>
>wrote:
>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(>Chisq)')
>dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '# Intensity',
>'# ISO', '# SEC')
>
>'dd' displays as the following:
>
>                # Chisq DF   Pr(>Chisq)
># Sex       153.0216306  1 7.578366e-35
># Volume     13.3696538  1 5.114571e-04
># Weight      0.8476713  1 7.144239e-01
># Intensity   1.2196050  1 5.388764e-01
># ISO         2.6349405  1 2.090719e-01
># SEC         6.0507714  1 2.780045e-02
>
>I would like to display it as:
>
># 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.780045e-02                                # SEC
>
>This is what I came up with
>
>(cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))
>
>               X..Chisq DF   Pr..Chisq.        term
># Sex       153.0216306  1 7.578366e-35       # Sex
># Volume     13.3696538  1 5.114571e-04    # Volume
># Weight      0.8476713  1 7.144239e-01    # Weight
># Intensity   1.2196050  1 5.388764e-01 # Intensity
># ISO         2.6349405  1 2.090719e-01       # ISO
># SEC         6.0507714  1 2.780045e-02       # SEC
>
>But I'm not happy with the following two issues:
>
>1) How to get rid of the row names?
>2) The special characters of #, (, >,) in the column names are not
>displayed correctly.
>
>Any suggestions?
>
>Thanks,
>Gang
>
>______________________________________________
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Display a dataframe

arun kirshna
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.780045e-02 # SEC     

A.K.





On Friday, July 4, 2014 10:27 AM, Gang Chen <[hidden email]> 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.


On July 3, 2014 9:57:00 PM EDT, arun <[hidden email]> wrote:
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      
>#1 153.0216306  1 7.578366e-35 # Sex     
>#2  13.3696538  1 5.114571e-04 # Volume  
>#3   0.8476713  1 7.144239e-01 # Weight  
>#4   1.2196050  1 5.388764e-01 # Intensity
>#5   2.6349405  1 2.090719e-01 # ISO     
>#6   6.0507714  1 2.780045e-02 # SEC     
>
>A.K.
>
>
>
>
>
>On Thursday, July 3, 2014 3:57 PM, Gang Chen <[hidden email]> wrote:
>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(>Chisq)')
>dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '# Intensity',
>'# ISO', '# SEC')
>
>'dd' displays as the following:
>
>                # Chisq DF   Pr(>Chisq)
># Sex       153.0216306  1 7.578366e-35
># Volume     13.3696538  1 5.114571e-04
># Weight      0.8476713  1 7.144239e-01
># Intensity   1.2196050  1 5.388764e-01
># ISO         2.6349405  1 2.090719e-01
># SEC         6.0507714  1 2.780045e-02
>
>I would like to display it as:
>
># 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.780045e-02                                # SEC
>
>This is what I came up with
>
>(cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))
>
>               X..Chisq DF   Pr..Chisq.        term
># Sex       153.0216306  1 7.578366e-35       # Sex
># Volume     13.3696538  1 5.114571e-04    # Volume
># Weight      0.8476713  1 7.144239e-01    # Weight
># Intensity   1.2196050  1 5.388764e-01 # Intensity
># ISO         2.6349405  1 2.090719e-01       # ISO
># SEC         6.0507714  1 2.780045e-02       # SEC
>
>But I'm not happy with the following
two issues:

>
>1) How to get rid of the row names?
>2) The special characters of #, (, >,) in the column names are not
>displayed correctly.
>
>Any suggestions?
>
>Thanks,
>Gang
>
>
>________________________________
>
>[hidden email] mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Display a dataframe

David Winsemius
In reply to this post by Gang Chen-4

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) but you _can_ print them without rownames.


--
David

> On July 3, 2014 9:57:00 PM EDT, arun <[hidden email]> wrote:
>> 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
>> #1 153.0216306  1 7.578366e-35 # Sex
>> #2  13.3696538  1 5.114571e-04 # Volume
>> #3   0.8476713  1 7.144239e-01 # Weight
>> #4   1.2196050  1 5.388764e-01 # Intensity
>> #5   2.6349405  1 2.090719e-01 # ISO
>> #6   6.0507714  1 2.780045e-02 # SEC
>>
>> A.K.
>>
>>
>>
>>
>>
>> On Thursday, July 3, 2014 3:57 PM, Gang Chen <[hidden email]>
>> wrote:
>> 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(>Chisq)')
>> dimnames(dd)[[1]] <- c('# Sex', '# Volume', '# Weight', '#  
>> Intensity',
>> '# ISO', '# SEC')
>>
>> 'dd' displays as the following:
>>
>>                 # Chisq DF   Pr(>Chisq)
>> # Sex       153.0216306  1 7.578366e-35
>> # Volume     13.3696538  1 5.114571e-04
>> # Weight      0.8476713  1 7.144239e-01
>> # Intensity   1.2196050  1 5.388764e-01
>> # ISO         2.6349405  1 2.090719e-01
>> # SEC         6.0507714  1 2.780045e-02
>>
>> I would like to display it as:
>>
>> # 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.780045e-02                                # SEC
>>
>> This is what I came up with
>>
>> (cc <- data.frame(data.frame(dd), term=dimnames(dd)[[1]]))
>>
>>                X..Chisq DF   Pr..Chisq.        term
>> # Sex       153.0216306  1 7.578366e-35       # Sex
>> # Volume     13.3696538  1 5.114571e-04    # Volume
>> # Weight      0.8476713  1 7.144239e-01    # Weight
>> # Intensity   1.2196050  1 5.388764e-01 # Intensity
>> # ISO         2.6349405  1 2.090719e-01       # ISO
>> # SEC         6.0507714  1 2.780045e-02       # SEC
>>
>> But I'm not happy with the following two issues:
>>
>> 1) How to get rid of the row names?
>> 2) The special characters of #, (, >,) in the column names are not
>> displayed correctly.
>>
>> Any suggestions?
>>
>> Thanks,
>> Gang


David Winsemius, MD
Alameda, CA, USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.