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
I have data for 90 climate stations. For each station, I have made 100+
simulations using a statistical model. So, in R, I have 90 dataframes, each
dataframe has 100+ simulations arranged column-wise.
Now, I would like to fit an extreme value distribution (EVD) to each climate
station. That is
Hello, I have a list object with many dataframes (example provided below). Each
coulmn in a dataframe represents a simluation and each dataframe represents a
clmate station. I want to fit an extreme value distribution on each coulmn of a
dataframe and then average the confidence intervals and es
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
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
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
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
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(
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
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-
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 o
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
Hi Chel,
I got it right.
Many thanks.
file.rename(file_names, to=paste0("rcp45_Daily_Sim", 200:210))
list.files(pattern="rcp45_Daily_Sim")
[1] "rcp45_Daily_Sim200" "rcp45_Daily_Sim201" "rcp45_Daily_Sim202"
On Friday, December 5, 2014 9:35 AM
ur code.
> format(c(1,5,32,100), width=3, flag="0")
[1] " 1" " 5" " 32" "100"
> formatC(c(1,5,32,100), width=3, flag="0")
[1] "001" "005" "032" "100"
I hope this helps.
Chel Hee Lee
On 12/0
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
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")
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
Many thanks Jean for the clarification.Zilefac.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
an
Hi Adam,I was not sure if my solution was correct.This is what I got using
ArcGIS to convert the same coordinates:
+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +datum=NAD83
+units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"
structure(list(Long = c(662843L, 303344L, 634922L, 63417
Hi Admas,Sorry I missed out the reproducible example.Here it is:
dput(xy)structure(list(ID = 1:120, X = c(-102.6, -101.9, -97.1, -97, -95.7,
-99.1, -100.1, -97.2, -97, -99.3, -96, -95.2, -98.8, -98.1, -99.6, -97.8,
-96.1, -98.3, -95.6, -96.8, -101.2, -101.1, -97.2, -111.1, -111.2, -116,
-117.6,
Hi,
I am trying to convert lat/lon to UTM but my results are extremely flawed.
Is it because of wrong UTM zone or my lon points are negative?
I read a shapefile from ESRI using:
library(rgdal)
stations <- readOGR(".","stations")
print(proj4string(stations))
## +proj=longlat +ellps=WGS84 +datum=WG
Hello,
I have two spatial map objects (reproducible example further down) which I
would like to overlay in R. The ESRI shapefiles were read using:
library(rgdal)
Prairie.Boundaries <- readOGR(".", "boundaries")
watersheds<-readOGR(".","watersheds")
The two objects have same projection:
print(
Hello,
I have two spatial map objects (reproducible example further down) which I
would like to overlay in R. The ESRI shapefiles were read using:
library(rgdal)
Prairie.Boundaries <- readOGR(".", "boundaries")
watersheds<-readOGR(".","watersheds")
The two objects have same projection:
print(p
Thanks John.
AT.
On Wednesday, October 22, 2014 5:23 PM, John McKown
wrote:
On Wed, Oct 22, 2014 at 10:37 AM, Zilefac Elvis wrote:
Hi,
>I have fixed width data that I would like to split into columns. Here is a
>sanpshot of the data (actual data is a list object):
>
>
ate=as.Date(substr(x,1,8), format="%Y%m%d"),
Site=substr(x, 9,12),
Precipitation=as.numeric(substring(x,13)))
}
decode.lst(lst1Sub)
S Ellison
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Hi,
I have fixed width data that I would like to split into columns. Here is a
sanpshot of the data (actual data is a list object):
lst1Sub<-
"20131124GGG1 23.00"
"20131125GGG1 15.00"
"20131128GGG1 0.00"
"201312 1GGG1 0.00"
"201312 4GGG1 0.00"
"201312 7GGG1 10.00"
"20131210GGG1 0.00"
"20
Hi,
I have a plotting issue which I am trying to resolve in R. Please load my
attached sample data (I used dput(lapply(sim.summary,head,1)) but the data are
too large) to R, install "Rglimclim" package and run this code which shows an
example plot I would like to change. My main function, "myplo
Great! Thanks.
AT.
On Monday, August 4, 2014 8:59 PM, rhelpmaillist wrote:
Try this:
lapply(a,function(x) apply(x[,-c(1,2)],2,quantile,probs=0.95))
# a is your example list
At 2014-08-05 09:17:23, "Zilefac Elvis" wrote:
>Hello,
>I would like to calculate for each num
Hello,
I would like to calculate for each numeric column in a dataframe,
quantile(x,probs=o.95).
My list object has 120 dataframes, each dataframe has 102 columns.
Here is an example as well as a reproducible example:
[[120]]
Year Site Sim001 Sim002 Sim003 Sim004 Sim005 Sim006 Sim007 Sim008 Si
Great! Thanks, John.
For the eye sees not itself, but by reflection and someother things
On Sunday, August 3, 2014 4:54 PM, John McKown
wrote:
On Sun, Aug 3, 2014 at 5:12 PM, Zilefac Elvis wrote:
> Dear All,
> I have a List in R and would like to convert it to data.frame.
> B
g 3, 2014 at 5:43 PM, John McKown
wrote:
> On Sun, Aug 3, 2014 at 5:12 PM, Zilefac Elvis wrote:
>> Dear All,
>> I have a List in R and would like to convert it to data.frame.
>> Below is a reproducible example. I can do something like:
>>
>> x1<-do.ca
Dear All,
I have a List in R and would like to convert it to data.frame.
Below is a reproducible example. I can do something like:
x1<-do.call(cbind.data.frame, lst3) #OR
x1<-as.data.frame(lst3).
However, my output looks like this:
Year Site x Year Site x
2001 G101 33.1 2001 G102 34
I wo
Great! Thanks very much Uwe.
AT.
On Sunday, August 3, 2014 2:12 PM, Uwe Ligges
wrote:
On 03.08.2014 21:23, Zilefac Elvis wrote:
> Hi Uwe,
> Thanks for replying.
> Here is a reproducible example.
> I would like to extract data for the Months of c(6,7,8).
> Output files shoul
.Names = c("Year",
"Month", "Day", "Site", "Tmax"), class = "data.frame", row.names = c(NA,
-243L)))
----------
On Sunday, August 3, 2014 1:47 AM, Uwe Ligges
wrote:
On 03.08.2014 07:17, Zilefac Elvis wrote:
> Hi ALL,
> I hav
Hi ALL,
I have a List object in R. The dataframes in the List have equal rows and
columns.
How can I extract from the List, data corresponding to say c(June, July ,
August)?
Remember, it is a List object, containing 100 dataframes, with daily data
arranged by YYMMDD.
Thanks for your thoughtful s
Hi,
I would like to create a nice looking bubble map in R.
Here is what I have done so far (the data is found below):
#
library(ggplot2)
if (dev.cur() == 1) x11(width=8,height=6)
par(mfcol=c(1,1))
ggplot
Hi,
I will like to free up memory in R and make my program execute faster. At the
moment, MY PROGRAM IS VERY SLOW probably due to memory issues. Here is sample
data (Rcode is found at the end) from one simulation(I have 1000 such files to
process):
list(c("1971 1 1GGG1 0.00 -3.68 -0.29", "1
Hi AK,
Thanks very much for the updated code.
My simulated results are even more consistent with observations after apply the
updated version of the code.
Cheers,
Atem.
On Wednesday, April 16, 2014 11:31 PM, Zilefac Elvis
wrote:
Hi AK,
Thanks very much.
Atem.
On Wednesday, April 16
rs = FALSE))
names(ReadOut2) <- gsub(".*\\/(.*)\\.csv","\\1",list.files(recursive =
TRUE)[grep("Indices", list.files(recursive = TRUE))])
ReadOut2$pint_DJF[1:3,1:3]
# Percentiles G100_pint_DJF G101_pint_DJF
#1 0% 0.982001 1.020892
#2 1%
gth(lst3)),sep="_"));
write.csv(dat1,paste0(paste(getwd(), "Indices", gsub(" ",
"_",rownames(lstNew)[i]), sep="/"),".csv"),row.names=FALSE, quote=FALSE)})
## Output2:
ReadOut2 <- lapply(list.files(recursive = TRUE)[grep("Indices&
Hi AK,
All codes for simulation files work great.
I will try the code for observations and let you know.
Thanks very much.
Atem.
On Tuesday, April 15, 2014 12:01 AM, arun wrote:
Yes,
my new solution ignores such cases.
On Monday, April 14, 2014 11:58 PM, Zilefac Elvis
wrote:
Hi AK
rep("Indices",
list.files(recursive = TRUE))], function(x) read.csv(x, header = TRUE,
stringsAsFactors = FALSE))
length(ReadOut2)
# [1] 257
head(ReadOut2[[1]], 2)
# Percentiles G100_pav_ANN G101_pav_ANN
#1 0% 1.054380 1.032740
#2 1% 1.069457 1.045689
o suit the new data set. Attached.
The attached dataset has 5 columns instead of 104 columns for which the program
was developed. I was unable to edit lst1NEW<-.
-- Original Message --
From : arun
>To : Zilefac Elvis;
>Sent : 10-04-2014 22:02
>Subject : Re: Re: Split
Thanks, Rui.
It works great.
Atem.
On Saturday, April 5, 2014 4:46 AM, Rui Barradas wrote:
Hello,
Maybe the following will do.
dat <- structure(...)
aggregate(dat[5:8], dat[c(1, 2, 4)], FUN = mean)
Hope this helps,
Rui Barradas
Em 05-04-2014 06:37, Zilefac Elvis escreveu:
> Hi,
Hi,
I have daily data arranged by date and site. Keeping the number of columns as
there are, I will like to aggregate (FUN=mean) from daily to monthly the
following data (only part is shown here) which starts in 1971 and ends in 1980.
structure(list(Year = c(1971, 1971, 1971, 1971, 1971, 1971,
Hi,
I have daily data arranged by date and site. Keeping the number of columns as
there are, I will like to aggregate (FUN=mean) from daily to monthly the
following data (only part is shown here) which starts in 1971 and ends in 1980.
Year Month Day Site Sim001 Sim002 Sim003 Sim004
1 1971
;Tmin", "Tmax");dat2 <- cbind(dat1,Sims1)})
lapply(lst2,tail,3)
[[1]] Year Month Day Site Precipitation Tmin Tmax
25 1971 1 1 GG25 0.36 -14.32 3.87
26 1971 6 5 G107 144.09 11.25 30.44
27 1971 6 5 G108 0.66 9.33 32.96
A.K.
On Mon
Hi,
I have a dataframe in R and would like to split the data (1900-1980) into two
sets.
For example, one dataframe should have data from 1900-1960 and the other from
1961-1980.
Thanks for your help.
AT.
[[alternative HTML version deleted]]
__
R
Hi Jim,
I tried as you described but did not succeed.
Can I send you sample data?
Thanks,
Zilefac.
On Tuesday, December 3, 2013 4:19 PM, Jim Lemon wrote:
On 12/04/2013 08:59 AM, Jim Lemon wrote:
> On 12/04/2013 05:26 AM, Zilefac Elvis wrote:
>> Hi,
>> I have rainfall data fro
Hi,
I have rainfall data from 100 locations, with coordinates for each location
available.
Now, I have a correlation matrix showing the correlation between rainfall at a
single location against all other locations and so on for the 100 locations.
How can I visualize this correlation matrix using
"month","day"))
dat2M1 <- dat2M[with(dat2M,order(year,month,day,variable)),]
dim(dat2M1)
#[1] 1972320 5
row.names(dat2M1) <- 1:nrow(dat2M1)
colnames(dat2M1)[4:5] <- c("site","rain")
16436*120
#[1] 1972320
A.K.
On Saturday, N
t="%d%b%Y"),by="day")
dates2<- as.character(dates1)
sldat<- split(dates2,list(gsub("-.*","",dates2)))
lst12<-lapply(sldat,function(x) lapply(split(x,gsub(".*-(.*)-.*","\\1",x)),
function(y){x1<-as.numeric(gsub(".*-.*-(.*)&
already know the names what is the
problem to select the files by names?
If you have the names but not inside of R you have to find a name pattern to
avoid typing them in. Is there a pattern, e.g. da.txt, db.txt, dc.txt?
On 08 Nov 2013, at 18:33, Zilefac Elvis wrote:
> Hi,
> I ha
Hi,
I have 300 .txt files in a directory. Out of this 300, I need just 100 of the
files.
I have the names of the 100 .txt files which are also found in the 300 .txt
files.
How can I extract only the 100 .txt files from the 300 ,txt files?
e.g given d1.txt, ds.txt, dx.txt, df.txt...d300.txt, how
data length is not a multiple of split variable"
AE.
____
From: arun
To: Zilefac Elvis
Cc: R help
Sent: Sunday, June 23, 2013 11:41 AM
Subject: Re: [R] Apply acf to data frame containing 'NA'
Hi,
May be this helps:
set.seed(24)
A <- mat
Hi,
I have a data frame with each column representing a separate site.
Following this code, I can apply acf to all columns in A. 'A' contains randomly
generated data.
A <- matrix(rnorm(1500),nrow=500)
par(mfrow=c(ncol(A),1))
lapply(split(A,col(A)), acf)
#OR
lapply(split(A,col(A)), function(snow
Hi A.K,
I go an error on line 24 when processing all the 100 files:
res<-fun1(lstf1)
Error in read.table(x, sep = "", header = TRUE, stringsAsFactors = FALSE) :
more columns than column names
There seem to be a difference between lstf and lstf1.
Thanks,
Atem.
___
.
From: arun
To: Zilefac Elvis
Cc: R help
Sent: Wednesday, May 22, 2013 8:47 PM
Subject: Re: [R] Sort data by month
Hi,
May be this helps.
date1<-seq.Date(as.Date("01/01/2000",format="%d/%m/%Y"),as.Date("31/12/2010",format="%d/%m/%Y&q
Hello,
I have a 'zoo' object containing dates [dd/mm/yr] in the first column and
values in the second column.
I tried as.Date but did not succeed.
Here is an example of date format
01/01/2000
01/02/2000
...
01/12/2000
01/01/2001
01/02/2001
...
01/12/2000
etc.
I would like to sort all Jans fro
Thanks AK. It works as expected.
Atem.
From: arun [smartpink...@yahoo.com]
Sent: Thursday, May 16, 2013 11:16 AM
To: Zilefac, Elvis
Cc: R help
Subject: Re: Loop through a simulation
Hi,
May be this is what you meant.
dat1<- read.csv("data2.csv
Hello,
I need your help on this matrix:
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
5 5 5 5 5 5
2 2 2 2 2 2
3 3 3 3 3 3
6 6 6 6 6 6
2 2 2 2 2 2
3 3 3 3 3 3
1 1 1 1 1 1
2 2 2 2 2 2
3 3 3 3 3 3
First three rows represent first simulation, next three rows = second
simulation etc.
I would
Hi,
I have 1000 simulations each arranged beneath another. The attached data is on
monthly basis. First column is number of simulation, second is year and the
rest, months.
Problem:
1) Take sim 1 for example to be my original data from 1961-2005 with twelve
months. You can delete the years. I
ent: Saturday, April 27, 2013 11:14 PM
Subject: Re: Re: [R] Help
Hi A.K,
Attached are example files. I have 110 of such and would like to
perform the analysis as described before. I would find T, F, Y, A, C, etc and
delete them. The letters are affixed to values in the data just to communi
Hello,
I have a question and need your help urgently. I am new to R but want to learn
it.
I have several files in a folder which I have imported to R using :
temp = list.files(pattern="*.txt")
>myfiles = lapply(temp, read.delim)
The resulting files are on the workspace stored as List[110]. So
Hello,
I have a question and need your help urgently. I am new to R but want to learn
it.
I have several files in a folder which I have imported to R using :
temp = list.files(pattern="*.txt")
>myfiles = lapply(temp, read.delim)
The resulting files are on the workspace stored as List[110]. So
65 matches
Mail list logo