Spencer Brackett
2019-Jul-08 14:06 UTC
[R] Using options(max.print = 1000000) to read in data
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 [[alternative HTML version deleted]]
> On Jul 8, 2019, at 10:06 AM, Spencer Brackett <spbrackett20 at 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 at 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 at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
Spencer Brackett
2019-Jul-08 14:26 UTC
[R] Using options(max.print = 1000000) to read in data
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? On Mon, Jul 8, 2019 at 10:16 AM Kevin Thorpe <kevin.thorpe at utoronto.ca> wrote:> > > On Jul 8, 2019, at 10:06 AM, Spencer Brackett < > spbrackett20 at 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 at 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 at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016 > >[[alternative HTML version deleted]]
Richard O'Keefe
2019-Jul-09 09:41 UTC
[R] Using options(max.print = 1000000) to read in data
The obvious question is "what do you mean, FORMATTED AS a matrix?" Once you have read an object into R, you have no information about how it was formatted. Another question is "what do you mean, MATRIX"? Do you mean the kind of R object specifically recognised by is.matrix, or do you mean "rectangular arrangement of numbers", which would include data frames as well? Another obvious question is "how, EXACTLY, are you reading it?" Why don't you *know* what you read it as? If you use read.table or any of the other functions listed by ?read.table you will always get a data frame, which is a rectangular arrangement that *acts like* a matrix in many ways, but without actually being one. If you want to read *part* of a file using one of those functions, skip=M says to ignore the first M lines, and nrows=N says to read the next N lines, but the only way one of these functions would read less than all of the input would be if memory ran out or the input was malformed. On Tue, 9 Jul 2019 at 02:07, Spencer Brackett < spbrackett20 at 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 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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]]