An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110415/50064445/attachment.pl>
str() on a data frame with 600 variables
5 messages · zubin, Marc Schwartz, Duncan Murdoch +1 more
On Apr 15, 2011, at 7:19 AM, zubin wrote:
Hello.. How do I get str() to show all variables in a data frame? It seems to be "list output truncated" at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show all variables, we see list.len() but again can't seem to figure this out - help will be appreciated. R> str(raw) 'data.frame': 1201 obs. of 626 variables: . . $ varXYZ : int 0 0 0 0 0 0 0 0 0 0 ... [list output truncated]
Try: str(raw, list.len = 999) DF <- as.data.frame(matrix(1:1000, 50, 200))
str(DF)
'data.frame': 50 obs. of 200 variables: $ V1 : int 1 2 3 4 5 6 7 8 9 10 ... $ V2 : int 51 52 53 54 55 56 57 58 59 60 ... $ V3 : int 101 102 103 104 105 106 107 108 109 110 ... $ V4 : int 151 152 153 154 155 156 157 158 159 160 ... $ V5 : int 201 202 203 204 205 206 207 208 209 210 ... ... $ V95 : int 701 702 703 704 705 706 707 708 709 710 ... $ V96 : int 751 752 753 754 755 756 757 758 759 760 ... $ V97 : int 801 802 803 804 805 806 807 808 809 810 ... $ V98 : int 851 852 853 854 855 856 857 858 859 860 ... $ V99 : int 901 902 903 904 905 906 907 908 909 910 ... [list output truncated]
str(DF, list.len = 999)
'data.frame': 50 obs. of 200 variables: $ V1 : int 1 2 3 4 5 6 7 8 9 10 ... $ V2 : int 51 52 53 54 55 56 57 58 59 60 ... $ V3 : int 101 102 103 104 105 106 107 108 109 110 ... $ V4 : int 151 152 153 154 155 156 157 158 159 160 ... $ V5 : int 201 202 203 204 205 206 207 208 209 210 ... ... $ V195: int 701 702 703 704 705 706 707 708 709 710 ... $ V196: int 751 752 753 754 755 756 757 758 759 760 ... $ V197: int 801 802 803 804 805 806 807 808 809 810 ... $ V198: int 851 852 853 854 855 856 857 858 859 860 ... $ V199: int 901 902 903 904 905 906 907 908 909 910 ... $ V200: int 951 952 953 954 955 956 957 958 959 960 ... HTH, Marc Schwartz
On 15/04/2011 8:19 AM, zubin wrote:
Hello.. How do I get str() to show all variables in a data frame? It seems to be "list output truncated" at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show all variables, we see list.len() but again can't seem to figure this out - help will be appreciated. R> str(raw) 'data.frame': 1201 obs. of 626 variables: . . $ varXYZ : int 0 0 0 0 0 0 0 0 0 0 ... [list output truncated]
Use str(raw, list.len=1000). Duncan Murdoch
perfect! thx
On 4/15/2011 8:43 AM, Duncan Murdoch wrote:
On 15/04/2011 8:19 AM, zubin wrote:
Hello.. How do I get str() to show all variables in a data frame? It seems to be "list output truncated" at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show all variables, we see list.len() but again can't seem to figure this out - help will be appreciated. R> str(raw) 'data.frame': 1201 obs. of 626 variables: . . $ varXYZ : int 0 0 0 0 0 0 0 0 0 0 ... [list output truncated]
Use str(raw, list.len=1000). Duncan Murdoch
4 days later
An alternative that you may find interesting is the TkListView function in the TeachingDemos package. This opens a separate window and shows the list structure there with options for scrolling and expanding/collapsing sublists. You will probably need to be a little patient while the display builds for a list of that size.
Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111 > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of zubin > Sent: Friday, April 15, 2011 7:40 AM > To: Duncan Murdoch > Cc: r-help at r-project.org > Subject: Re: [R] str() on a data frame with 600 variables > > perfect! thx > > On 4/15/2011 8:43 AM, Duncan Murdoch wrote: > > On 15/04/2011 8:19 AM, zubin wrote: > >> Hello.. > >> > >> How do I get str() to show all variables in a data frame? It seems > to be > >> "list output truncated" at about 99 variables, the data frame has > over > >> 600 but i can't seem to figure out how to show all variables, we see > >> list.len() but again can't seem to figure this out - help will be > >> appreciated. > >> > >> R> str(raw) > >> > >> 'data.frame': 1201 obs. of 626 variables: > >> > >> . > >> > >> . > >> > >> $ varXYZ : int 0 0 0 0 0 0 0 0 0 0 ... > >> > >> [list output truncated] > >> > > Use str(raw, list.len=1000). > > > > Duncan Murdoch > > > > ______________________________________________ > R-help at r-project.org 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.