Announcement
Collapse
No announcement yet.
X
-
Originally posted by gwilymh View PostI am analyzing large datasets in R. To analyze data, my current practice is to import the entire dataset into the R workspace using the read.table() function. Rather than importing the entire dataset, however, I was wondering if it is possible to import, analyze and export each line of data individually so that the analysis would take up less computer memory.
Can this be done? And if so, how?
Code:totlines<- 10000000 ## Number of lines in your big input. Get it from wc -l skip<- 0 chunkLines= 10000 ## No. of lines to read in one go. Set to 1 to really read one line at a time. while (skip < totlines){ df<- read.table(myinput, skip= skip, nrows= chunkLines, stringsAsFactors= FALSE) skip<- skip + chunkLines [...do something with df...] }
A better alternative might be to use packages designed for dealing with data larger than memory, ff (http://cran.r-project.org/web/packages/ff/index.html) is one of them.
Hope this helps!
Dario
Leave a comment:
-
Importing and processing data in R line by line
I am analyzing large datasets in R. To analyze data, my current practice is to import the entire dataset into the R workspace using the read.table() function. Rather than importing the entire dataset, however, I was wondering if it is possible to import, analyze and export each line of data individually so that the analysis would take up less computer memory.
Can this be done? And if so, how?Tags: None
Latest Articles
Collapse
-
by seqadmin
At the intersection of cytogenetics and genomics lies the exciting field of cytogenomics. It focuses on studying chromosomes at a molecular scale, involving techniques that analyze either the whole genome or particular DNA sequences to examine variations in structure and behavior at the chromosomal or subchromosomal level. By integrating cytogenetic techniques with genomic analysis, researchers can effectively investigate chromosomal abnormalities related to diseases, particularly...-
Channel: Articles
09-26-2023, 06:26 AM -
-
by seqadmin
Cancer research has been transformed through numerous molecular techniques, with RNA sequencing (RNA-seq) playing a crucial role in understanding the complexity of the disease. Maša Ivin, Ph.D., Scientific Writer at Lexogen, and Yvonne Goepel Ph.D., Product Manager at Lexogen, remarked that “The high-throughput nature of RNA-seq allows for rapid profiling and deep exploration of the transcriptome.” They emphasized its indispensable role in cancer research, aiding in biomarker...-
Channel: Articles
09-07-2023, 11:15 PM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 09-29-2023, 09:38 AM
|
0 responses
10 views
0 likes
|
Last Post
by seqadmin
09-29-2023, 09:38 AM
|
||
Started by seqadmin, 09-27-2023, 06:57 AM
|
0 responses
12 views
0 likes
|
Last Post
by seqadmin
09-27-2023, 06:57 AM
|
||
Started by seqadmin, 09-26-2023, 07:53 AM
|
0 responses
30 views
0 likes
|
Last Post
by seqadmin
09-26-2023, 07:53 AM
|
||
Multiplexed Biomarker Detection with Nanopore Technology: A Leap in Precision Diagnostics
by seqadmin
Started by seqadmin, 09-25-2023, 07:42 AM
|
0 responses
18 views
0 likes
|
Last Post
by seqadmin
09-25-2023, 07:42 AM
|
Leave a comment: