Re: [R] To map population of European countries from Eurostat

2014-02-07 Thread Jon Olav Skoien
Michel, I am no expert on ggplot2 and cannot explain why, but it seems the NAs in map.df.l$value cause some problems. Try to remove them before plotting or examine your code to figure out why you get them. They seem to be on the borders between NUTS2-level objects. Best wishes, Jon On

[R] Legend text populated with calculated values and super script?

2014-02-07 Thread Douglas M. Hultstrand
Hello, I am trying to generate a plot legend that contains calculated summary statistics, one statistic is R^2. I have tried several variations using the commands expression and bqoute as stated on the R help pages. I have not been able to get the R^2 super script correct along with the

Re: [R] R help

2014-02-07 Thread arun
Hi, YOu could use ?cut().  dat2 - read.table(text=1    2   Mal    1 Ram    1000 Ramesh  12344,sep=,header=TRUE,stringsAsFactors=FALSE,check.names=FALSE) res - setNames(as.data.frame(table(cut(dat2[,2],breaks=c(0,1000,10),labels=c(0-1000,1000-10,c(Bins,count))  res #

Re: [R] R help

2014-02-07 Thread arun
Hi, The pattern is not very clear.  Try: dat - read.table(text=Emails mal...@gmail.com mah...@gmail.com x...@gmail.com ravi_...@yahoo.com lavk@rediff.com xy@12_g.com,sep=,header=TRUE,stringsAsFactors=FALSE)  vec1 - gsub(\\.[[:alnum:]]+$,,gsub(^([[:alpha:]]+)(\\d+.*),\\1_\\2,dat$Emails))

Re: [R] repeating rows in R

2014-02-07 Thread arun
Hi, Use ?rep() df1 - read.table(text=Site  Scientific.name  value   size 'Flat Cay'    'S. iserti' 3 2.5 'Flat Cay'    'S. iserti' 2 8 'Flat Cay'    'S. iserti' 1 25 'Flat Cay'   'S.

Re: [R] Remove duplicate rows based on condition

2014-02-07 Thread arun
Hi, If I understand it correctly, you could use ?unique() or ?duplicated()  unique(mydf) #or mydf[!duplicated(mydf),] A.K. Hello everyone. I am very new to R and very bad in programming. I need to remove some rows based on multiple conditions. For example, I have this table: Id =

Re: [R] Missval in netCDF and its handling by the ncdf package

2014-02-07 Thread David W. Pierce
On Fri, Feb 7, 2014 at 1:25 AM, Dusterhus, Andre and...@noc.ac.uk wrote: My problem is not really to get the right missvals into a file. I have some trouble with the fact (?) that obviously a missval is given within the ncdf object, when there is no such thing in the original file. As a

[R] Send html body email in R

2014-02-07 Thread Bo Yan
Hi, I have managed to send emails with plain text message in the mail body using sendmailR. However, this package currently doesn't allow you to send html body email unless the source code is hacked. http://stackoverflow.com/questions/19844762/how-to-send-html-email-using-r Could anyone

Re: [R] Missval in netCDF and its handling by the ncdf package

2014-02-07 Thread Dusterhus, Andre
Hi David, thanks for this extensive answer. My problem is not really to get the right missvals into a file. I have some trouble with the fact (?) that obviously a missval is given within the ncdf object, when there is no such thing in the original file. As a consequence, ncdf do not make a

Re: [R] Send html body email in R

2014-02-07 Thread Duncan Murdoch
On 07/02/2014 12:47 PM, Bo Yan wrote: Hi, I have managed to send emails with plain text message in the mail body using sendmailR. However, this package currently doesn't allow you to send html body email unless the source code is hacked.

Re: [R] Send html body email in R

2014-02-07 Thread Bo Yan
Would be my last resort if a cleaner solution cannot be found. -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Friday, February 07, 2014 11:57 AM To: Bo Yan; r-help@r-project.org Subject: Re: [R] Send html body email in R On 07/02/2014 12:47 PM, Bo Yan

Re: [R] Passing vectors through a dataframe

2014-02-07 Thread arun
Hi, Try:   mylist - list(F4087=F4087, F4287=F4287) #or mylist - list(F4087, F4287)  names(mylist) - dxnames  mylist[[maxr2]] #[1] 3423  543 6768  867  945 3456 5634 6543  345 mylist[dxnames] $F4087 [1]  234 1234   65   34  624  345 $F4287 [1] 3423  543 6768  867  945 3456 5634 6543  345 A.K.

[R] rsm package

2014-02-07 Thread li li
Hi all, I fit a complete second order model for my response with three predictors. However, the lack of fit of the model is still significant. I wish to add the third order terms also. Is there a way to do that using rsm function? Thanks. Hanna [[alternative HTML version

Re: [R] R help

2014-02-07 Thread arun
Hi, If there are multiple max values, you will get only the first value with ?which.max(). Using dataset `a` as an example: a - structure(list(`1` = c(Mal, Mahesh, Tarak, Pawan, Charan, Prabhas, Arjun, Naresh, Nithin, Puri), `2` = 1:10,     `3` = c(Layer, Actor, Actor, Actor, Actor, Actor,  

Re: [R] Passing vectors through a dataframe

2014-02-07 Thread Jeremy Clark
## Many thanks ! - the list idea almost works - but I can't find the indexing ## needed to extract an element from the list using an object created from ## the dataframe. ## maxr2[[1]] doesn't seem to work despite being the correct character ## string. ## I've now added a list to the example

Re: [R] Merge two data frames on date field

2014-02-07 Thread arun
Hi,You haven't provided any example dataset.  set.seed(42)  dat1 - data.frame(dates=seq(as.POSIXct(2009-01-01 00:00:00,format=%Y-%m-%d %H:%M:%S),by= '12 hour', length=12),Field1=rnorm(12),Field2=LETTERS[1:12]) set.seed(395)  dat2 - data.frame(dates=seq(as.POSIXct(2009-01-01

Re: [R] Why does a date frame returning date with a time zone sometimes?

2014-02-07 Thread arun
I may have misunderstood your question.  vec1 - seq(as.POSIXct(2009-01-01 00:00:00,format=%Y-%m-%d %H:%M:%S),by= '12 hour', length=12) vec1[1:3] #returns with time zone #[1] 2009-01-01 00:00:00 EST 2009-01-01 12:00:00 EST #[3] 2009-01-02 00:00:00 EST If you don't want the time zone info:,

Re: [R] Legend text populated with calculated values and super script?

2014-02-07 Thread Jim Lemon
On 02/08/2014 02:54 AM, Douglas M. Hultstrand wrote: Hello, I am trying to generate a plot legend that contains calculated summary statistics, one statistic is R^2. I have tried several variations using the commands expression and bqoute as stated on the R help pages. I have not been able to

Re: [R] Legend text populated with calculated values and super script?

2014-02-07 Thread David Winsemius
On Feb 7, 2014, at 7:54 AM, Douglas M. Hultstrand wrote: Hello, I am trying to generate a plot legend that contains calculated summary statistics, one statistic is R^2. I have tried several variations using the commands expression and bqoute as stated on the R help pages. I have not

Re: [R] Categorizing and displaying excel data in tabular format

2014-02-07 Thread Patrick Connolly
On Wed, 05-Feb-2014 at 08:20AM -0800, ashrafali wrote: | Thank you David. | | I tried the Table function with two columns | | table(R_format$Client.Mnemonic,R_format$Tasks) | | and got something like the one I have attached in this word file | Task_Summary_for_Clients.docx |

Re: [R] Legend text populated with calculated values and super script?

2014-02-07 Thread Dennis Murphy
Here's a bquote version: x=c(1,2,3,4); y=c(1,2,3,4); z=c(1.25,1.5,2.5,3.5) # first stats based on data, used to populate legend wdt_n = 50; wdt_mbias = 0.58 wdt_mae = 2.1; wdt_R2 = 0.85 # second stats based on data, used to populate legend spas_n = 50; spas_mbias = 0.58 spas_mae = 2.1;

Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an R-beginners list?)

2014-02-07 Thread Patrick Connolly
On Tue, 04-Feb-2014 at 01:11AM +0100, Liviu Andronic wrote: | Dear Don and Bert, | Allow me to address some of your concerns below. | Which you do very clearly by positioning your responses underneath what you're commenting on. That doesn't seem to be possible on SE. [...] | On Mon, Feb 3,

Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an R-beginners list?)

2014-02-07 Thread Yihui Xie
For those defending mailing lists over StackOverflow, can you merge these threads so later readers do not have to move between multiple conversations? 1. Re: Should there be an R-beginners list? 2. Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an

Re: [R] Handling special characters in reading and writing to CSV

2014-02-07 Thread Venkata Kirankumar
Hi Ista, I tried its working fine for me. thank you Regards, D V Kiran Kumar On Thu, Feb 6, 2014 at 11:13 PM, Ista Zahn istaz...@gmail.com wrote: Hi Venkata, That example reads into R fine for me. I copied and saved it as tmp.csv and simply read it in with dat - read.csv(tmp.csv)