[R] Splitting strings in data files R

2016-01-20 Thread Zilefac Elvis via R-help
Please I need help processing files with strings in R. All the files have two patterns (thus,examine separately): Pattern 1 (see file1 below): Delete Lines 1,2 & 4 in file1. Line 3 contains the column names. Then find anything as.character and delete. Please do not delete any values (e.g. de

Re: [R] Apply t-test on list in R

2015-02-25 Thread Zilefac Elvis via R-help
Many thanks, Petr.You solved my problem.AT. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

[R] Apply t-test on list in R

2015-02-17 Thread Zilefac Elvis via R-help
I have a list object in R with dataframe names as: "pav_DJF_histo.csv""pav_DJF_rcp26_2040s.csv" "pav_DJF_rcp26_2080s.csv" "pav_DJF_rcp45_2040s.csv""pav_DJF_rcp45_2080s.csv" "pav_DJF_rcp85_2040s.csv" "pav_DJF_rcp85_2080s.csv" "pav_JJA_histo.csv" "pav_JJA_rcp26_2040s.csv" "pav_JJ

Re: [R] split dataframe to several dataframes in R

2015-02-17 Thread Zilefac Elvis via R-help
ion(x) {as.data.frame(t(iris1.csv))}) #Get the data.frames in the list to the global environment list2env(lst4 ,.GlobalEnv) Regards On 17 February 2015 at 09:23, Zilefac Elvis via R-help wrote: > Hi All,I have a dataframe called 'means' as shown below:iris1.csv <- iris > iri

Re: [R] split dataframe to several dataframes in R

2015-02-17 Thread Zilefac Elvis via R-help
may be that storing your > # data objects as a single object, such as a list, is more useful. > > Chris Campbell, PhD > > Tel. +44 (0)1249 705 450 | Mobile. +44 (0) 7929 628 349 > www.mango-solutions.com > Mango Solutions > 2 Methuen Park, Chippenham, Wiltshire. SN14 OGB UK > &g

[R] split dataframe to several dataframes in R

2015-02-16 Thread Zilefac Elvis via R-help
Hi All,I have a dataframe called 'means' as shown below:iris1.csv <- iris iris2.csv <- iris names <- c("iris1.csv", "iris2.csv") dat <- mget(names) lst4 <- lapply(dat, function(x) apply(x[,-5], 2, mean)) # Build the new data frame means <- as.data.frame(do.call(rbind, lst4)) means$source <- names(

Re: [R] Angle brackets ?plotmath

2014-12-10 Thread Zilefac Elvis via R-help
Perfect! # italic(symbol("\341")*T[min]*symbol("\361")) Thanks, Uwe. Asong. On 10.12.2014 04:49, Zilefac Elvis via R-help wrote: > Hi All, > Please, I would like to enclose T[min] using angle brackets in R. > I have tried something like: > > mtext(text=e

[R] Angle brackets ?plotmath

2014-12-09 Thread Zilefac Elvis via R-help
Hi All, Please, I would like to enclose T[min] using angle brackets in R. I have tried something like: mtext(text=expression(Winter(DJF)~daily~minimum~temperature~bold((italic(symbol("\341")T[min]symbol("\361"), side=3, line=1, cex=1.3, col="black") but did not succeed. I learnt that adobe-

Re: [R] add symbol above letter in R

2014-12-09 Thread Zilefac Elvis via R-help
I got the right answer: mtext(text=expression(Winter(DJF)~mean~daily~precipitation~bar(italic(P))), side=3, line=1, cex=1.3, col="black") Thanks. On Tuesday, December 9, 2014 1:28 PM, Zilefac Elvis wrote: Hi, I would like to add a dash (—) on a letter in R. How can I add a dash on letter P

[R] add symbol above letter in R

2014-12-09 Thread Zilefac Elvis via R-help
Hi, I would like to add a dash (—) on a letter in R. How can I add a dash on letter P in the following: mtext(text=expression(Winter(DJF)~mean~daily~precipitation~italic(P)), side=3, line=1, cex=1.3, col="black") ?plotmath could not provide an answer to my problem. many thanks for your solutio

Re: [R] Rename multiple files in a directory and write renamed files back to directory

2014-12-05 Thread Zilefac Elvis via R-help
6.dat" >> >> new_names <- paste("new_example_", > + formatC(seq(length(file_names)), width=2, flag="0"), > + ".dat", sep="") >> new_names > [1] "new_example_01.dat" "new_example_02.dat" "new_example_0

Re: [R] Rename multiple files in a directory and write renamed files back to directory

2014-12-05 Thread Zilefac Elvis via R-help
>> new_names <- paste("new_example_", > + formatC(seq(length(file_names)), width=2, flag="0"), > + ".dat", sep="") >> new_names > [1] "new_example_01.dat" "new_example_02.dat" "new_example_03.dat" > [4]

Re: [R] Rename multiple files in a directory and write renamed files back to directory

2014-12-04 Thread Zilefac Elvis via R-help
dat" "new_example_03.dat" [4] "new_example_04.dat" "new_example_05.dat" "new_example_06.dat" > > file.rename(from=file_names, to=new_names) [1] TRUE TRUE TRUE TRUE TRUE TRUE > list.files(pattern="*.dat") [1] "new_example_01.dat&qu

[R] Rename multiple files in a directory and write renamed files back to directory

2014-12-04 Thread Zilefac Elvis via R-help
Hello, I would like to rename multiple files in a directory. Filenames are read using: lfile <- list.files(pattern="rcp45_Daily_") files <- paste(paste(getwd(),lfile,sep="/"), list.files(lfile),sep="/")# getwd of these files dput(lfile) c("rcp45_Daily_Sim001.dat", "rcp45_Daily_Sim002.dat")

[R] How to fill rainbow colors under curves in R

2014-12-02 Thread Zilefac Elvis via R-help
Hi All, I have a tricky problem here. The short code below plots some percentiles from a simulation. The percentiles are indicated in different colors. Problem: - How can I fill the area under the curve using the same colors as for the percentiles-1? - Also, I would like the rainbow intensity t