[Bioc-devel] Problem with merge
1
0
Entering edit mode
Julie Zhu ★ 4.3k
@julie-zhu-3596
Last seen 11 months ago
United States
Dear Michael, Thanks for the quick response! I converted z1 to a data frame but still have the same issue. Any suggestions? Thanks! Best regards, Julie On 5/24/10 12:28 PM, "Michael Lawrence" <lawrence.michael@gene.com> wrote: On Mon, May 24, 2010 at 9:25 AM, Zhu, Julie <julie.zhu@umassmed.edu> wrote: Dear developers, I encountered a strange merge problem and hope you can help me to understand why this is happening and how to resolve it. r3 and z1 are both data frames produced inside a function, when I try to merge these two (R.2.10 and R.2.11), chr 1 [19000000, 19000300], chr1 [30000000, 30000300] and chr2 [ 100000, 100300] in r3 failed to merge with the corresponding rows in z1. Is this related to the precision on auto conversion of character to numeric? Thanks so much for your help in advance! r3 feature_id name chr PeakLoc peakStart peakEnd start_position end_position strand FeatureLoc 1 1 1 chr1 2000160 2000010 2000310 1000000 2000000 + 1000000 2 2 2 chr1 19000150 19000000 19000300 10000000 20000000 - 20000000 3 2 3 chr1 30000150 30000000 30000300 10000000 20000000 - 20000000 4 4 4 chr2 450 300 600 1000 5000 + 1000 5 5 5 chr2 5650 5500 5800 6000 7000 - 7000 6 6 6 chr2 100150 100000 100300 10000 15000 + 10000 z1 name chr peakStart peakEnd PeakLoc [1,] "1" "chr1" "2000010" "2000310" "2000160" [2,] "2" "chr1" "19000000" "19000300" "19000150" [3,] "3" "chr1" "30000000" "30000300" "30000150" [4,] "4" "chr2" "300" "600" "450" [5,] "5" "chr2" "5500" "5800" "5650" [6,] "6" "chr2" "100000" "100300" "100150" Not sure if this question belongs on this list, but anyway, it looks like z1 is a character matrix, not a data.frame. Better convert it to a data.frame with the correct types. Best regards, Julie ******************************************* Lihua Julie Zhu, Ph.D Research Associate Professor Program in Gene Function and Expression Program in Molecular Medicine University of Massachusetts Medical School 364 Plantation Street, Room 613 Worcester, MA 01605 508-856-5256 http://www.umassmed.edu/pgfe/faculty/zhu.cfm _______________________________________________ Bioc-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel [[alternative HTML version deleted]]
convert convert • 814 views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 7 weeks ago
United States
On Mon, May 24, 2010 at 12:43 PM, Zhu, Julie <julie.zhu@umassmed.edu> wrote: > Dear Michael, > > Thanks for the quick response! I converted z1 to a data frame but still > have the same issue. Any suggestions? Thanks! > > Hi, Julie. Please provide a reproducible example and the output of sessionInfo(). Also, if there is an error, provide the error. I agree with Michael that it looks like your z1 object is not a data.frame. You could check this by typing "class(z1)". That could be part of your example if it is difficult to provide a reproducible data set for your example. Sean > > On 5/24/10 12:28 PM, "Michael Lawrence" <lawrence.michael@gene.com> wrote: > > > > On Mon, May 24, 2010 at 9:25 AM, Zhu, Julie <julie.zhu@umassmed.edu> > wrote: > Dear developers, > > I encountered a strange merge problem and hope you can help me to > understand > why this is happening and how to resolve it. > > r3 and z1 are both data frames produced inside a function, when I try to > merge these two (R.2.10 and R.2.11), chr 1 [19000000, 19000300], chr1 > [30000000, 30000300] and chr2 [ 100000, 100300] in r3 failed to merge > with the corresponding rows in z1. Is this related to the precision on auto > conversion of character to numeric? Thanks so much for your help in > advance! > > r3 > feature_id name chr PeakLoc peakStart peakEnd start_position > end_position strand FeatureLoc > 1 1 1 chr1 2000160 2000010 2000310 1000000 > 2000000 + 1000000 > 2 2 2 chr1 19000150 19000000 19000300 10000000 > 20000000 - 20000000 > 3 2 3 chr1 30000150 30000000 30000300 10000000 > 20000000 - 20000000 > 4 4 4 chr2 450 300 600 1000 > 5000 + 1000 > 5 5 5 chr2 5650 5500 5800 6000 > 7000 - 7000 > 6 6 6 chr2 100150 100000 100300 10000 > 15000 + 10000 > > z1 > name chr peakStart peakEnd PeakLoc > [1,] "1" "chr1" "2000010" "2000310" "2000160" > [2,] "2" "chr1" "19000000" "19000300" "19000150" > [3,] "3" "chr1" "30000000" "30000300" "30000150" > [4,] "4" "chr2" "300" "600" "450" > [5,] "5" "chr2" "5500" "5800" "5650" > [6,] "6" "chr2" "100000" "100300" "100150" > > > Not sure if this question belongs on this list, but anyway, it looks like > z1 is a character matrix, not a data.frame. Better convert it to a > data.frame with the correct types. > > Best regards, > > Julie > > ******************************************* > Lihua Julie Zhu, Ph.D > Research Associate Professor > Program in Gene Function and Expression > Program in Molecular Medicine > University of Massachusetts Medical School > 364 Plantation Street, Room 613 > Worcester, MA 01605 > 508-856-5256 > http://www.umassmed.edu/pgfe/faculty/zhu.cfm > > _______________________________________________ > Bioc-devel@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/bioc-devel > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 255 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6