[R] Using options(max.print = 1000000) to read in data

Spencer Brackett @pbr@ckett20 @end|ng |rom @@|ntjo@ephh@@com
Tue Jul 9 16:45:26 CEST 2019


 My apologies! I made this much to complicated and allowed myself to become
confused with the straightforward advice given. I tried running the lines
Mr. Barradas suggested after receiving the output for as.matrix() and I
understand now. Thank you all again for your patience.

Best,

Spencer

On Tue, Jul 9, 2019 at 9:48 AM Michael Friendly <friendly using yorku.ca> wrote:

> You continue to labor under false conceptions, starting with your subject
> line indicating that you should be able to *see* your huge data set in
> the R console.
> Take a pause, have a coffee or tea and re-read the helpful advice various
> people have tried to offer before continuing this thread.
>
> -Michael
>
> On 7/09/19 2:44 p.m., Spencer Brackett wrote:
>
> So even though a number of rows were omitted  during the ‘print in’ or
> visualization of the dataset into my console, the data frame is now set as
> a matrix? I believe so, per Mr. Barradas’s last email. Sorry for the
> confusion, I was expecting the whole dataset to load into my console and
> was concerned that perhaps if I had to set the data in the data frame as a
> matrix (if not already), then I would not achieve this result.
>
> Thanks,
>
> Spencer
>
> On Tue, Jul 9, 2019 at 6:21 AM Michael Friendly <friendly using yorku.ca> wrote:
>
>> Why do you need it to be a matrix? A data.frame is like a matrix, but
>> allows columns of mixed types.
>>
>> as.matrix() will coerce your data frame to a matrix if you really need
>> this.
>>
>> On 7/08/19 4:43 p.m., Spencer Brackett wrote:
>> > Using str(GBM.txt) produced the same output as last time, which lists
>> the
>> > number of objects acting on a particular number of variables for the
>> said
>> > dataset and a few rows read from the original file.
>> >
>> > The result of class(GBM.txt) generates the following..
>> >
>> >> class(GBM.txt)
>> > [1] "data.frame"
>> >
>> > Is this to say that the object is set as a 'data frame', opposed to a
>> > 'matrix' ?
>> >
>> > I will try running ?is.matrix now
>> >
>> >
>> >
>> > On Mon, Jul 8, 2019 at 10:33 AM Rui Barradas <ruipbarradas using sapo.pt>
>> wrote:
>> >
>> >> Hello,
>> >>
>> >> Inline.
>> >>
>> >> Às 15:26 de 08/07/19, Spencer Brackett escreveu:
>> >>> Thank you,
>> >>>
>> >>> Here is a summary of the resulting output....
>> >>>
>> >>>> nrow(GBM.txt)
>> >>> [1] 20530
>> >>>> ncol(GBM.txt)
>> >>> [1] 173
>> >>>
>> >>> This corresponds with the info found in my global environment for the
>> >>> object indicated. Now, how do I go about determining if the dataset
>> is a
>> >>> matrix?
>> >>
>> >> Try any of
>> >>
>> >> str(GBM.txt)
>> >> class(GBM.txt)
>> >>
>> >> Also, like Kevin said, max.print only affects how much is printed, not
>> >> the read functions. Why change max.print at all? The default value
>> >> (1000) is large enough, I have never needed to see more than this at a
>> >> time. In fact, to have an idea of the data I would rather further limit
>> >> the number of matrix lines printed with
>> >>
>> >> head(object)
>> >> tail(object)
>> >>
>> >>
>> >>
>> >> Hope this helps,
>> >>
>> >> Rui Barradas
>> >>>
>> >>>
>> >>> On Mon, Jul 8, 2019 at 10:16 AM Kevin Thorpe <
>> kevin.thorpe using utoronto.ca>
>> >>> wrote:
>> >>>
>> >>>>
>> >>>>> On Jul 8, 2019, at 10:06 AM, Spencer Brackett <
>> >>>> spbrackett20 using saintjosephhs.com> wrote:
>> >>>>>
>> >>>>> Hello,
>> >>>>>
>> >>>>>    I am trying to reload some data into R in order to check to see
>> if
>> >> it is
>> >>>>> formatted as a matrix. I used the command options(max.print =
>> 10000000)
>> >>>> to
>> >>>>> account for the 20,000 some rows omitted previously when just using
>> the
>> >>>>> basic version of this function. After entering this command, the
>> >> dataset
>> >>>>> mostly loaded into R, but 14717 rows were still omitted.
>> >>>>>
>> >>>>>    Can I simply increase the number indicted after 'max.print =' to
>> >> read in
>> >>>>> the remaining rows, or should I use 'bigfile.sample <-' or
>> >>>>> 'bigfile.colclass <-' instead? Do I even need to read in all of the
>> >> rows
>> >>>> to
>> >>>>> test for a matrix?
>> >>>>>
>> >>>>> Best,
>> >>>>>
>> >>>>> Spencer
>> >>>>>
>> >>>>
>> >>>> I don’t think this option affects how much data is read in, just how
>> >> much
>> >>>> is printed to the screen. Use the function str() on your imported
>> >> object to
>> >>>> see how many rows, among other things, were brought in.
>> >>>>
>> >>>>
>> >>>>>         [[alternative HTML version deleted]]
>> >>>>>
>> >>>>> ______________________________________________
>> >>>>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> >>>>> 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.
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Kevin E. Thorpe
>> >>>> Head of Biostatistics,  Applied Health Research Centre (AHRC)
>> >>>> Li Ka Shing Knowledge Institute of St. Michael's
>> >>>> Assistant Professor, Dalla Lana School of Public Health
>> >>>> University of Toronto
>> >>>> email: kevin.thorpe using utoronto.ca  Tel: 416.864.5776  Fax:
>> 416.864.3016
>> >>>>
>> >>>>
>> >>>
>> >>>        [[alternative HTML version deleted]]
>> >>>
>> >>> ______________________________________________
>> >>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> >>> 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]]
>> >
>>
>>
> --
> Michael Friendly     Email: friendly AT yorku DOT ca
> Professor, Psychology Dept. & Chair, ASA Statistical Graphics Section
> York University      Voice: 416 736-2100 x66249 Fax: 416 736-5814
> 4700 Keele Street    Web:   http://www.datavis.ca   Twitter: @datavisFriendly
> Toronto, ONT  M3J 1P3 CANADA
>
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list