Re: [R] Combining text files

2019-12-03 Thread Jeff Newmiller
Do you know for certain that the rows are in the same order? then yes... cbind or bind_cols would do it. I would be surprised to find such files... but it is possible. On December 3, 2019 9:37:34 PM PST, Thomas Subia via R-help wrote: >Colleagues, >I've got several text files which contain dat

[R] Combining text files

2019-12-03 Thread Thomas Subia via R-help
Colleagues, I've got several text files which contain data for each metric I need to report on.One text file contains the serial number data. Another has customer and work order number. Another has test data. All text files have the same number of rows but all have different numbers of columns.

Re: [R] 回复:How to find the best fit of inner cut ellipse to points in polar plot?

2019-12-03 Thread Jim Lemon
Hi vod, Now that I have your data I can do a bit better: # save data as "vv.csv" vv<-read.csv("vv.csv") # order the points in order of theta vv<-vv[order(vv$theta),] oldpar<-polar.plot(vv$r,vv$theta,main="Polar plat of vv.csv",lwd=3,line.col=4, point.symbols=4,rp.type="p",show.centroid=TRUE,radia

Re: [R] undefined columns selected

2019-12-03 Thread Bert Gunter
Basically no clue, but note that C[, 1:length(C[ ,1])] looks suspect -- you are selecting the number of columns equal to the number of rows in C. Is that really what you want to do? Bert On Tue, Dec 3, 2019, 2:36 PM Ana Marija wrote: > Hello, > > I am trying to run this software: > > https://gi

[R] undefined columns selected

2019-12-03 Thread Ana Marija
Hello, I am trying to run this software: https://github.com/eleporcu/TWMR and I have my input files in my current directory: ENSG0154803.matrix, ENSG0154803.ld but when I try to run it: Rscript MR.R ENSG0154803 [1] "ENSG0154803" Error in `[.data.frame`(C, , 1:length(C[, 1])) :

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread David Winsemius
On 12/3/19 12:16 PM, Ana Marija wrote: would this make sense for the previous: mt=na.omit(m, cols = c("V1.1","V1.2","V1.3","V1.4","V1.5")) On Tue, Dec 3, 2019 at 2:09 PM Ana Marija wrote: I can perhaps do this: m=Reduce(function(x, y) merge(x, y, all=TRUE), list(s11, s22, s33,s44,s55)) bu

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
I apologize I would need to reformulate this problem because there will be much more unique genes I have to look up, 381 so all genes or in one data frame > head(r) V1 V2 V3V4 1 ENSG0273172 rs7215271 4.33932e-17 -0.602316 2 ENSG0273172 rs34889101 4

Re: [R] How to find the best fit of inner cut ellipse to points in polar plot?

2019-12-03 Thread Abby Spurdle
(1) There is no csv attached (may have been removed). (2) If you have a "polar plot", then wouldn't the "center" be the origin of the plot/coordinates? (3) If you don't need an exact ellipse, you could transform your coordinates into cartesian coordinates, and then use a periodic form of regression

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
would this make sense for the previous: mt=na.omit(m, cols = c("V1.1","V1.2","V1.3","V1.4","V1.5")) On Tue, Dec 3, 2019 at 2:09 PM Ana Marija wrote: > I can perhaps do this: > > m=Reduce(function(x, y) merge(x, y, all=TRUE), list(s11, s22, s33,s44,s55)) > > but than in the output of this one SNP

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
I can perhaps do this: m=Reduce(function(x, y) merge(x, y, all=TRUE), list(s11, s22, s33,s44,s55)) but than in the output of this one SNP (just for example) > head(m) rsV1.1V3.1 V4.1 V1.2 V3.2 V4.2 V1.3 6 rs1029829 ENSG0154803 1.02519e-11 0.469402NA NA

Re: [R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
the desired output would look like this (example give just for two genes, it should include all 5 from all 5 data frames): where the example is if say only 5 rs are shared between those two genes, what is given after rs# is values from V4 column for each gene GENES ENSG0001629 ENSG0127914

[R] how to merge 5 data frames by one column

2019-12-03 Thread Ana Marija
Hello, I have 5 dataframes (s11,s22,s33,s44,s55) that look like this: > head(s11) V1.1 rs V3.1V4.1 1 ENSG0154803 rs12940868 3.80175e-05 -0.519565 2 ENSG0154803 rs4383187 8.92772e-05 -0.367303 3 ENSG0154803 rs4404112 9.32402e

Re: [R] strange output with merge function

2019-12-03 Thread Ana Marija
HI Jeff, the issue got resolved after I converted data in as.data.frame. Thank you for the useful input! Ana On Tue, Dec 3, 2019 at 12:46 PM Jeff Newmiller wrote: > My guess would be that your key columns are factors with different levels. > You have to be very careful manipulating factors...

Re: [R] strange output with merge function

2019-12-03 Thread Jeff Newmiller
My guess would be that your key columns are factors with different levels. You have to be very careful manipulating factors... I recommend using character data until you are ready to do analysis steps that need factors. You may be able to resolve this by importing your data with the as.is=TRUE o

[R] strange output with merge function

2019-12-03 Thread Ana Marija
Hi, I have two data frames like this: > head(a) V1V2 V3 V4 V5 V6 V7 V8V9 V10 1: ENSG0272636 chr17 181637 181636 - 4924 -769472 rs7216126 chr17 951108 2: ENSG0273172 chr17 191588 191587 - 4978 40553 rs62053745 chr17 151035 3: ENSG

Re: [R] Two geom_bar with counts to put in the same plot

2019-12-03 Thread Francesca
Hi here it is;. THANKS! dput(DATASET) structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1

Re: [R] Two geom_bar with counts to put in the same plot

2019-12-03 Thread Rui Barradas
Hello, Please post the output of dput(DB) in a next e-mail to R-Help, like this it's difficult for us to use the data you posted. And yes, I bet you will need the data in long format. It is a frequent first step to the problem of plotting two or more columns in the same graph. To say more

[R] 回复:How to find the best fit of inner cut ellipse to points in polar plot?

2019-12-03 Thread vod vos via R-help
在 星期二, 03 十二月 2019 04:09:12 -0800 vod vos 撰写 > hi, > > 1. How to find the best fit of inner cut ellipse to points in polar plot? > > 2. How can we find the ellipse passing through most of the points in polar > plot? > > And can we get the center x, center y, major radi

[R] How to find the best fit of inner cut ellipse to points in polar plot?

2019-12-03 Thread vod vos via R-help
hi, 1. How to find the best fit of inner cut ellipse to points in polar plot? 2. How can we find the ellipse passing through most of the points in polar plot? And can we get the center x, center y, major radius, minor radius, and rotation angle of the ellipse? The csv data is attached. Tha

[R] Two geom_bar with counts to put in the same plot

2019-12-03 Thread Francesca
Dear Contributors, I would like to ask help on how to create a plot that is the overlapping of two other plots. It is a geom_bar structure, where I want to count the occurrences of two variables, participation1 and participation2 that I recoded as factors as ParticipationNOPUN and ParticipationPUN