[BioC] sum of columns

chris Jhon cjhon217 at gmail.com
Thu Jul 11 11:22:13 CEST 2013


Thank you very much ,However, I got an error
Error: cannot allocate vector of size 290 Kb

> sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.14.0

On 7/11/13, Alessandro Brozzi <alessandro.brozzi at gmail.com> wrote:
> D[ rowSums( D[ , -c(1,2) ] ) > 0 , ]
>
> where 1 and 2 are the indices of the non-numerical columns
>
>
> On Thu, Jul 11, 2013 at 11:12 AM, chris Jhon <cjhon217 at gmail.com> wrote:
>
>> Hi Alex,
>>
>> Thank you.
>>
>> However , i got error due to memory limit
>>
>> Error: memory exhausted (limit reached?)
>>
>> In addition i have one col that have no numerical vlaue (e.g gene
>> name) row sums will work only for numerical value columns?
>>
>> On 7/11/13, Alessandro Brozzi <alessandro.brozzi at gmail.com> wrote:
>> > let call D your dataframe then:
>> >
>> > D[ rowSums(D) > 0 , ]
>> >
>> > alex
>> >
>> >
>> > On Thu, Jul 11, 2013 at 10:56 AM, chris Jhon <cjhon217 at gmail.com>
>> > wrote:
>> >
>> >> Hi All,
>> >>
>> >> I have a data frame like this
>> >>
>> >>
>> >> gene         symbol    sample1 sample2 sample3 sample4
>> >>
>> >> gene1             A          0          0                0
>> >> 0
>> >> gene2             B          0          10              2            0
>> >> gene3             C          0         0                0
>> >> 0
>> >>
>> >> and i would like to subset the data frame to have only genes that have
>> >> sum in all samples greater than zero.
>> >>
>> >> How to do this in R
>> >>
>> >> Thank you for any help
>> >>
>> >> _______________________________________________
>> >> Bioconductor mailing list
>> >> Bioconductor at r-project.org
>> >> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> >> Search the archives:
>> >> http://news.gmane.org/gmane.science.biology.informatics.conductor
>> >>
>> >
>>
>



More information about the Bioconductor mailing list