5 Useful R Commands for Working with Big Data

BY IN Code, R, Tutorials NO COMMENTS YET ,

5 useful R commands for working with big data 1. View a large object (big RData file called object for example) in a manner similar to less in command line. page(object, method=”print”) 2. Listing top n objects in memory. rev(sort(sapply(ls(envir=globalenv()), function(x) { object.size(get(x,env=globalenv())) })))[1:n] 3. Remove all objects except for those contained in a set


5 Useful Python One Liners for Lists

BY IN Code, Python, Tutorials NO COMMENTS YET

Five useful Python one liners for making and manipulating lists: 1. From text file to list: code: [line.strip() for line in open(file)] example file proteins_list.txt: Q8N465 O95452 Q14524 Q86YC2 P11413 Q8IWV7 example: >>> [line.strip() for line in open(‘proteins_list.txt’)] [‘Q8N465’, ‘O95452’, ‘Q14524’, ‘Q86YC2’, ‘P11413’, ‘Q8IWV7’] 2. Get a list of strings from list that contains a