Re: [R] merging multiple .csv files

2020-12-15 Thread PIKAL Petr
Hi. merge has parameters all, all.x and all.y which should specify if you want to use common or all values from the data frame. Cheers Petr > -Original Message- > From: R-help On Behalf Of pooja sinha > Sent: Tuesday, December 15, 2020 11:14 PM > To: Bert Gunter > Cc: r-help mailing

Re: [R] get a month where max value is

2020-12-15 Thread ani jaya
Duh.. I should know that.. That was excellent. Didn't realize that. Need rest(or practice) for my brain maybe. Thank you Jim... On Wed, Dec 16, 2020 at 3:27 PM Jim Lemon wrote: > > Hi Ani, > Not sure about this, but is this what you want? > >

Re: [R] get a month where max value is

2020-12-15 Thread Jim Lemon
Hi Ani, Not sure about this, but is this what you want? ann10<-aggregate(mon10[3:12],list(mon10$Group.1),which.max) Jim On Wed, Dec 16, 2020 at 4:55 PM ani jaya wrote: > > Dear R-Help, > > I have a data frame containing monthly maxima of rainfall in 10 > locations for 30 year and want to look

Re: [R] How to specify year-month-day for a plot

2020-12-15 Thread Jim Lemon
Hi Greg, I think this does what you want: gcdf$date<-as.Date(gcdf$date,"%Y-%m-%d") grid_dates<-as.Date(paste(2014:2020,1,1,sep="-"),"%Y-%m-%d") plot(gcdf$date, gcdf$gallons, main="2014 Toyota 4Runner", xlab="Date", ylab="Gallons",type="l",col="blue",yaxt="n") abline(h=seq(4,20,by=2),lty=4)

[R] get a month where max value is

2020-12-15 Thread ani jaya
Dear R-Help, I have a data frame containing monthly maxima of rainfall in 10 locations for 30 year and want to look at a month where an annual maxima happens. I can get the annual maxima using aggregate. I try to extract the month using the code below.

Re: [R] making code (loop) more efficient

2020-12-15 Thread Jim Lemon
Hi Ana, Back on the job. I'm not sure how this will work in your setup, but here is a try: a<-read.table(text="top1 blup lasso enet rs4980905:184404:C:A 0.07692622 -1.881795e-04 00 rs7978751:187541:G:C 0.62411425 9.934994e-04 00 rs2368831:188285:C:T 0.69529158 1.211028e-03

Re: [R] making code (loop) more efficient

2020-12-15 Thread Ana Marija
Hi Jim, as always you're completely right, this is what is happening: > head(a) top1 blup lasso enet rs4980905:184404:C:A 0.07692622 -1.881795e-04 00 rs7978751:187541:G:C 0.62411425 9.934994e-04 00 rs2368831:188285:C:T 0.69529158

Re: [R] making code (loop) more efficient

2020-12-15 Thread Jim Lemon
Hi Ana, I would look at "data" in your second example and see if it contains a column named "blup" or just the values that were extracted from a$blup. Also, I assume that weight=blup looks for an object named "blup", which may not be there. Jim On Wed, Dec 16, 2020 at 1:20 PM Ana Marija wrote:

Re: [R] making code (loop) more efficient

2020-12-15 Thread Ana Marija
Hi Jim, Maybe my post is confusing. so "dd" came from my slow code and I don't use it again in parallelized code. So for example for one of my files: if i="retina.ENSG0120647.wgt.RDat" > a <- get(load(i)) > head(a) top1 blup lasso enet

Re: [R] making code (loop) more efficient

2020-12-15 Thread Jim Lemon
Hi Ana, My guess is that in your second code fragment you are assigning the rownames of "a" and the _values_ contained in a$blup to the data.table "data". As I don't have much experience with data tables I may be wrong, but I suspect that the column name "blup" may not be visible or even present

[R] making code (loop) more efficient

2020-12-15 Thread Ana Marija
Hello, I made a terribly inefficient code which runs forever but it does run. library(dplyr) library(splitstackshape) datalist = list() files <- list.files("/WEIGHTS1/Retina", pattern=".RDat", ignore.case=T) for(i in files) { a<-get(load(i)) names <- rownames(a) data <-

[R] Need recommendation for hash table which accepts integer keys

2020-12-15 Thread Robert Dodier
Hi, I'd like to use integers as keys in a hash table. Can someone recommend a hash table implementation? I would like to avoid doing something like substituting "123" for 123. Here's what I know about different implementations so far: env (built-in) -- integer keys not allowed Dict (CRAN) --

Re: [R] merging multiple .csv files

2020-12-15 Thread Spencer Graves
Did you work the examples in help("merge")? Also, have you looked at the "dplyr" package? It has 9 different vignettes. The lead author is Hadley Wickham, who won the 2019 COPSS Presidents' Award for work like this. Alternatively, you could manually read all 10 files, then figure

Re: [R] merging multiple .csv files

2020-12-15 Thread pooja sinha
I know that but I do not want to merge them sequentially because I may lose some rows which are present in one file while the other doesn't have. I googled and found something called multmerge but the code is not working for me. I used the following: path <-"P:/Documents/Puja Desktop

Re: [R] merging multiple .csv files

2020-12-15 Thread Bert Gunter
?read.csv to read your csv files in data frames ?merge to merge them (sequentially). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Dec 15, 2020 at 1:36

[R] merging multiple .csv files

2020-12-15 Thread pooja sinha
Hi All, I have 10 .csv files containing 12 to 15 columns but have some columns in common. I need to join all of my .csv files into one using one common column ‘Pos’. The header portion of my .csv files looks as shown below: Chrom Pos Avg Stdev A15_3509.C A31_3799.C A32_3800.C A35_3804.C Gene ID

Re: [R] Meta: R-Help reply-to

2020-12-15 Thread Jeff Newmiller
For the record: this is not nearly as cut-and-dried as you imply. The current settings actually make replying off-list rather tricky for some mail clients... I have tried and failed a few times to reply off-list due to this. The next level of invasiveness is to make it appear that the original

Re: [R] Meta: R-Help reply-to

2020-12-15 Thread Patrick (Malone Quantitative)
Thanks, Kevin. But as I said in the original message, I did that some months ago and never received a reply. Pat On Tue, Dec 15, 2020 at 12:26 PM Kevin Thorpe wrote: > You could send the request to r-help-ow...@r-project.org. That goes to > the moderators and administrator. > > Kevin > > -- >

Re: [R] Meta: R-Help reply-to

2020-12-15 Thread Kevin Thorpe
You could send the request to r-help-ow...@r-project.org. That goes to the moderators and administrator. Kevin -- Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public

Re: [R] multiple t-test with different species and treatments

2020-12-15 Thread Jeff Newmiller
Dear Lingling Wen: Bert has forwarded your message to the list because one person cannot usually answer every question... so many heads are better than one. However, you seem to have neglected his other advice about providing a complete example including data. Further, you are using several

Re: [R] Meta: R-Help reply-to

2020-12-15 Thread Patrick (Malone Quantitative)
Ok. If this is a desirable change, of whom would we request it? I was unable to find a name, and as I said, I got no response from the generic address. Pat On Tue, Dec 15, 2020 at 11:43 AM Pär Leijonhufvud via R-help < r-help@r-project.org> wrote: > Unless I am getting senile that should be an

Re: [R] Meta: R-Help reply-to

2020-12-15 Thread Pär Leijonhufvud via R-help
Unless I am getting senile that should be an option in Mailman... https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/handlers/docs/reply-to.html /Pär -- Pär Leijonhufvud . par.leijonhuf...@regionjh.se Sjukhuskemist

Re: [R] Help with connection issue for R (just joined, leading R for our agency)

2020-12-15 Thread Jan van der Laan
Alejandra, If it was initially working ok, I would first check with the IT department if there has been a change to the configuration of the firewall, virus scanners, file system etc. as these can affect the performance of R-studio. R-studio uses a client-server setup on your machine, so a

[R] Meta: R-Help reply-to

2020-12-15 Thread Patrick (Malone Quantitative)
Greetings. Something I've wondered for some time--is mailman configurable to have a default reply-to be set to the list or to reply-all? Many newcomers who reply to individual R-Help participants may not notice that they are doing so, and it seems a source of vexation to some of the more

Re: [R] multiple t-test with different species and treatments

2020-12-15 Thread Bert Gunter
Unless there is good reason not to, always cc r-help, which I have done here. Bert Gunter On Tue, Dec 15, 2020 at 1:16 AM Lingling Wen wrote: > Dear Bert Gunter, > Good day, > Thank you for your comments about the posting policy. I am sorry for > bothering you with the text against the

Re: [R] space between bars of a group in ggplot2

2020-12-15 Thread PIKAL Petr
Hi Your code is not reproducible, however you could follow this advice. https://stackoverflow.com/questions/6085238/adding-space-between-bars-in-ggplot2 Cheers Petr > -Original Message- > From: R-help On Behalf Of azam jaafari via > R-help > Sent: Monday, December 14, 2020 9:16 PM >