Re: [R] Importing, renaming columns and exporting mulitple csv files in R

2013-09-25 Thread Jacquomo Monk
A.K. Thanks for the reply. Will give it a try... Jac -- View this message in context: http://r.789695.n4.nabble.com/Importing-renaming-columns-and-exporting-mulitple-csv-files-in-R-tp4676951p4676959.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Importing, renaming columns and exporting mulitple csv files in R

2013-09-25 Thread arun
Hi, Try: If the files are all in the same working directory, #for example list.files() # 3 files in my WD #[1] "file1.csv" "file2.csv" "file3.csv"  lapply(list.files(),function(x) {names1<-read.csv(x,header=TRUE); names(names1)[c(19,23)]<- c("Redundant","Reef % cover"); dat1<- subset(names1,

[R] Importing, renaming columns and exporting mulitple csv files in R

2013-09-25 Thread Jacquomo Monk
Hi All, I have 1029 *.csv files that I would like read individually into R, delete some columns and rename others, and then export individually using the original file names. I have written some script to do this for an individual file (script below), but cannot get it to loop through all the fi

Re: [R] MaxLik estimation issues

2013-09-25 Thread Arne Henningsen
Dear Filipe On 25 September 2013 14:23, Filipe Ribeiro wrote: > Hello everybody! > > I'm having some trouble to compute maximum likelihood > estimations using maxLik package and I hope that you > could give me a hint. > The main problem is that I'm not able to get a result not > even close to the

[R] table of contents link style in R's PDF docs

2013-09-25 Thread Ben Harrison
Hello, I am mildly annoyed each time I use a PDF doc of an R package that the table of contents hyperlinks are *only* on the page numbers. To activate a hyperlink, one must carefully scan sideways from the text item wanted to the far right of the page and click on a tiny box. Multiply that mild

Re: [R] Less than equal to symbol in ggplot2 legend text

2013-09-25 Thread Pascal Oettli
Hello, Please post in plain text, as kindly requesting by the R-help posting guide. Your code is completely messy. Regards, Pascal 2013/9/26 mahesh samtani > Hello, > I am trying to add a less than equal to symbol in a ggplot2 legend text. > See sample code below. I have tried using the expre

[R] Less than equal to symbol in ggplot2 legend text

2013-09-25 Thread mahesh samtani
Hello, I am trying to add a less than equal to symbol in a ggplot2 legend text. See sample code below. I have tried using the expression function and \u2264. I also tried adding labels to legend.text under theme. Neither of these 3 options work. Please help, Mahesh ++ Extra.column

Re: [R] Missing value handling for felm function in lfe package

2013-09-25 Thread sgaure
megha patnaik wrote > Dear All, > > I am trying to use the felm function in the lfe package. However it does > not seem to deal with missing values the way the lm function does. I wish > to tell it na.omit or na.action = na.omit but it does not recognize this. > I > need to allow for missing value

[R] Besag endive data

2013-09-25 Thread Marco Bee
Dear all, a few weeks ago I have seen a package containing the so called "endive dataset" first appeared in Besag (1978) "Some Methods of Statistical Analysis for Spatial Data," Bulletin of the International Statistical Institute, 47, 77-92. Now I would need to use the dataset, but I can no lo

Re: [R] Checking a large data set for normality

2013-09-25 Thread David Winsemius
On Sep 25, 2013, at 5:55 AM, steric wrote: It was just a question to see if it was possible on a large data set. I wasn't looking for a flame war. New strategy is simply new strategy. Half of my time spent on R is trying to find a better way. If you say why you want to do a global test wit

Re: [R] Best and worst values for each date

2013-09-25 Thread arun
Ira, You may try also with ?ddply() dat2<- data.frame(S1=rep(Pred1[,1],ncol(Pred1)-1),variable=rep(colnames(Pred1)[-1],each=nrow(Pred1)),Predict=unlist(Pred1[,-1],use.names=FALSE),Actual=unlist(Actual1[,-1],use.names=FALSE),stringsAsFactors=FALSE)  identical(dat,dat2) #[1] TRUE dat2New<- dat2[!(

Re: [R] Cosine window in r

2013-09-25 Thread Rolf Turner
I'm pretty sure that your answer has nothing to do with what the OP was asking about. OTOH it's up to the OP to make it clear what he ***is*** asking and he did not do that. cheers, Rolf Turner On 09/26/13 01:00, João Pedro Alves wrote: x<-seq(0,2*pi,by=0.01) y<-cos(x) plot(x,y,

Re: [R] Checking a large data set for normality

2013-09-25 Thread Rolf Turner
On 09/25/13 16:10, David Winsemius wrote: There is quite a bit of misinformation about the "need for normality", some of it presented by Six Sigma "experts" or even by college professors who should know better. One might even say that if you don't know how to check for normality then there i

Re: [R] Slight misinformation in OSX version of R

2013-09-25 Thread Prof Brian Ripley
On 25/09/2013 22:29, Ben Bolker wrote: Erich Neuwirth univie.ac.at> writes: I just installed R on a Mac without any traces of earlier versions. It exhibited a well know problem: Not 'well known' (sic) at all: most of us do not break our OS X. We don't have reproduction instructions (see t

Re: [R] Slight misinformation in OSX version of R

2013-09-25 Thread Ben Bolker
Erich Neuwirth univie.ac.at> writes: > > I just installed R on a Mac without any traces of earlier versions. > It exhibited a well know problem: > > WARNING: You're using a non-UTF8 locale, therefore only ASCII > characters will work. > Please read R for Mac OS X FAQ (see Help) section 9 and

[R] weighting in glmmadmb(family='nbinom') with RE

2013-09-25 Thread Trevor Davies
Hello, I was wondering if weighting has been added to glmmadmb as of yet? I found a post about a year ago that it it hadn't been implemented yet but I was hoping the documentation may just have not yet caught up. Thanks, Trevor Davies [[alternative HTML version deleted]] ___

Re: [R] Best and worst values for each date

2013-09-25 Thread arun
Hi, May be you can try this: obj_name<- load("arun.RData") Pred1<- get(obj_name[1]) Actual1<- get(obj_name[2]) library(reshape2) dat<-cbind(melt(Pred1,id.vars="S1"),value2=melt(Actual1,id.vars="S1")[,3])  # to reshape to long form colnames(dat)[3:4]<- c("Predict","Actual") dat$variable<- as.cha

[R] Slight misinformation in OSX version of R

2013-09-25 Thread Erich Neuwirth
I just installed R on a Mac without any traces of earlier versions. It exhibited a well know problem: WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work. Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system preferences accordingly. The infor

[R] Re: Multiple vector elements into one character element

2013-09-25 Thread Lietz, Haiko
Hi A.K., This is exactly what I needed: x <- data.frame(Month = airquality$Month, Day = as.character(airquality$Day)) y <- aggregate(x$Day ~ x$Month, data = x, paste, collapse = ", ") write.table(y, "y.txt", row.names = FALSE, quote = FALSE, sep = '\t') The trick is to use collapse in the aggreg

[R] How to fix col.regions mapping in multiple spplot?

2013-09-25 Thread Rui Wang
Hello, I have a question on sp package. I drew pixel heat maps of continental U.S. using insurance litigation data. If an insurance claim is litigated at a certain location, 1 is assigned; otherwise 0 is assigned. I have assigned a value between 0 and 1 to each pixel on my map using inverse-dista

[R] drc - package

2013-09-25 Thread sahnerolle
Hi, my english is not the best, i hope its comprehensible. Can i ask here in german too? my problem: I have plottet a curve with weibull1.4. I want to define a value on the y-axis and get the value of the x-axis for the plotted curve. This is my command: library(drc) effect<-c(0,22.84,40.74,54.

[R] error when using ps() function on categorical variables - re propensity score matching

2013-09-25 Thread Andrew Kemp
Dear List, I am having difficulty running the ps() function when variables are stored as factors and was hoping someone could provide some advice on how to proceed. I am running propensity score matching as outlined in: Greg Ridgeway, Dan McCarey, Andrew Morral, Lane Burgette and Beth A

Re: [R] Computing calculation among two vectors

2013-09-25 Thread arun
I guess you meant something like: res2<- sapply(y,function(i) outer(x,x,i)) row.names(res2)<- row.names(res)  identical(res2,res) #[1] TRUE #or is there any shorter way? A.K. From: Bert Gunter To: arun Cc: R help Sent: Wednesday, September 25, 2013 11:46 AM

[R] Animate dataframe

2013-09-25 Thread Bart Joosen
Hi, sorry for the double posting, but it seems my text was gone... I'm running a code which does some alignment between data. Now I want to follow the alignment while looping over the data. I'm aware of the animation package, and saw the (easy) example where a plot is animated by calling 100 t

[R] animate dataframe

2013-09-25 Thread Bart Joosen
Hi, I'm running a code which does some alignment between data. Now I want to follow the alignment while looping over the data. I'm aware of the animation package, and saw the (easy) example where a plot is animated by calling 100 times plot. Is it possible to use this trick also for printing

Re: [R] Computing calculation among two vectors

2013-09-25 Thread Bert Gunter
A cute problem. Is it homework? Hint: ?outer (will provide a much simpler solution than those given below) -- Bert On Wed, Sep 25, 2013 at 8:34 AM, arun wrote: > Hi, > You could also try: > res1<-sapply(y,function(i) {x1<- expand.grid(x,x);fun1<- function(a,op,b){ > f1<- match.fun(FUN=op); f1(

Re: [R] Computing calculation among two vectors

2013-09-25 Thread arun
Hi, You could also try: res1<-sapply(y,function(i) {x1<- expand.grid(x,x);fun1<- function(a,op,b){ f1<- match.fun(FUN=op); f1(a,b)};fun1(x1[,1],i,x1[,2])}) row.names(res1)<- row.names(res)  identical(res1,res) #[1] TRUE A.K. - Original Message - From: arun To: R help Cc: Sent: Wedne

Re: [R] Multiple vector elements into one character element

2013-09-25 Thread arun
Hi, May be this helps: y<- aggregate(Day~Month,data=x,paste,collapse=",") write.table(y,"file.txt",quote=FALSE) A.K. - Original Message - From: "Lietz, Haiko" To: "'r-help@r-project.org'" Cc: Sent: Wednesday, September 25, 2013 9:10 AM Subject: [R] Multiple vector elements into one

Re: [R] Multiple vector elements into one character element

2013-09-25 Thread Bert Gunter
Perhaps ?dput -- Bert On Wed, Sep 25, 2013 at 6:10 AM, Lietz, Haiko wrote: > Hi all, > > I want to collapse multiple elements of a vector into a single > comma-separated character element. I only know how to create a list of the > original elements, but I have not managed to write this into a

Re: [R] Cosine window in r

2013-09-25 Thread João Pedro Alves
x<-seq(0,2*pi,by=0.01) y<-cos(x) plot(x,y,type='l') On 25-09-2013 13:22, Babak Bastan wrote: Hi experts Can some one tell me, how can I implement Cosine window in r? Is there a function for that? [[alternative HTML version deleted]] __ R-hel

Re: [R] Creating a new column to a data frame using a formula from another variable

2013-09-25 Thread Bert Gunter
DO NOT DO THIS! This is a complete misuse of R. R is not a macro/scripting language that constructs language expressions to be evaluated (although it can do this). Rather, it is a functional language that uses functions that build new objects from inputted objects and parameters. I would strongly

Re: [R] Checking a large data set for normality

2013-09-25 Thread steric
It was just a question to see if it was possible on a large data set. I wasn't looking for a flame war. New strategy is simply new strategy. Half of my time spent on R is trying to find a better way. -- View this message in context: http://r.789695.n4.nabble.com/Checking-a-large-data-set-for-no

[R] grImport problems in Windows

2013-09-25 Thread Mills, Frederick
Hello all, I'd like to use the Bioconductor motifStack function to align multiple DNA sequence motifs as PWMs (Position Weight Matrices). 1.Requires both ghostscript, and the R function grImport for converting. postscript files. - Have 64 bit GS 9.10 and R 3.01 is installed in 64 bit Windows

[R] MaxLik estimation issues

2013-09-25 Thread Filipe Ribeiro
Hello everybody! I'm having some trouble to compute maximum likelihood estimations using maxLik package and I hope that you could give me a hint. The main problem is that I'm not able to get a result not even close to the ones given by glm() directly, and the second one is: "Error in maxNRComput

[R] Multiple vector elements into one character element

2013-09-25 Thread Lietz, Haiko
Hi all, I want to collapse multiple elements of a vector into a single comma-separated character element. I only know how to create a list of the original elements, but I have not managed to write this into a text file, which is necessary. To illustrate, let's use the airquality dataset and ext

Re: [R] Confusing behaviour in data.table: unexpectedly changing variable

2013-09-25 Thread Jonathan Dushoff
Thanks for your help, and sorry for mis-posting. JD On Wed, Sep 25, 2013 at 3:18 AM, Matthew Dowle wrote: > Very sorry to hear this bit you. If you need a copy of names before > changing them by reference : > oldnames <- copy(names(DT)) > This will be documented and it's on the bug list

Re: [R] Creating a new column to a data frame using a formula from another variable

2013-09-25 Thread arun
Also, Instead of ?attach, you could try ?with or ?within aa$z<- with(aa,eval(parse(text=bb))) aa$z #[1]  3  7 11 aa<- within(aa,z<- eval(parse(text=bb))) aa #  x y  z #1 2 3  3 #2 4 5  7 #3 6 7 11 A.K. - Original Message - From: arun To: R help Cc: Sent: Wednesday, September 25, 201

Re: [R] Creating a new column to a data frame using a formula from another variable

2013-09-25 Thread arun
Hi, Change: aa$z<-  eval(parse(text=bb))  aa #  x y  z #1 2 3  3 #2 4 5  7 #3 6 7 11 A.K. I want to create a new column to a data frame using a formula from another variable: Example: I have a data set "aa" is; x    y 2    3 4    5 6    7 My R code is; >bb <- "x+y-2" >attach(aa) >aa$

[R] Cosine window in r

2013-09-25 Thread Babak Bastan
Hi experts Can some one tell me, how can I implement Cosine window in r? Is there a function for that? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

[R] R 3.0.2 is released

2013-09-25 Thread Peter Dalgaard
The build system rolled up R-3.0.2.tar.gz (codename "Frisbee Sailing") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.0.2.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries

Re: [R] Space between x-axis ticks

2013-09-25 Thread PIKAL Petr
Hi If you did PLEASE do read the posting guide http://www.R-project.org/posting- guide.html you could find No binary attachments except for PS, PDF, and some image and archive formats (others are automatically stripped off because they can contain malicious software). Files in other formats and

Re: [R] Rmpfr question

2013-09-25 Thread Martin Maechler
> Martin Maechler > on Wed, 25 Sep 2013 11:08:07 +0200 writes: > Michel > on Tue, 24 Sep 2013 12:22:10 +0200 writes: >> Hello, Thanks for your answer The file does not contains >> numbers in high precision but all the calculation applied >> to these data wil

Re: [R] Space between x-axis ticks

2013-09-25 Thread mohan . radhakrishnan
Looks like graph cannot be attached. Mohan From: mohan.radhakrish...@polarisft.com To: r-help@r-project.org Date: 09/25/2013 12:41 PM Subject:[R] Space between x-axis ticks Sent by:r-help-boun...@r-project.org Hi, I am trying to clearly show the values in t

Re: [R] Rmpfr question

2013-09-25 Thread Martin Maechler
> Michel > on Tue, 24 Sep 2013 12:22:10 +0200 writes: > Hello, Thanks for your answer The file does not contains > numbers in high precision but all the calculation applied > to these data will be > In attachment a text file containing some lines And her > few va

Re: [R] Confusing behaviour in data.table: unexpectedly changing variable

2013-09-25 Thread Matthew Dowle
Very sorry to hear this bit you. If you need a copy of names before changing them by reference : oldnames <- copy(names(DT)) This will be documented and it's on the bug list to do so. copy is needed in other circumstances too, see ?copy. More details here : http://stackoverflow.com/q

Re: [R] Graph is without line

2013-09-25 Thread PIKAL Petr
Hi It is mostly question of personal preference. Factors have some nice features when manipulating with levels, sorting, and/or using numeric annotation. However when you want to add some new value to factor it is trickier than with plain string vectors. Maybe it is time to look into R-intro ex

[R] Space between x-axis ticks

2013-09-25 Thread mohan . radhakrishnan
Hi, I am trying to clearly show the values in the x-axis in the attached graph. The tick marks are too close and the labels are blurred. plot(as.numeric(data$Var1),data$Freq,ylim=c(0,700),col="green",type="o",ylab="Number of connections",las=2,lwd=2.5,xaxt="n",xlab="IP") axis(1,at

Re: [R] Computing calculation among two vectors

2013-09-25 Thread arun
Hi, Try: x<- 1:4  y<- c("*","/","-","+") res<-sapply(y,function(i) {x1<-expand.grid(x,x); unlist(lapply(paste0(x1[,1],i,x1[,2]),function(u) eval(parse(text=u}) row.names(res)<- as.character(interaction(expand.grid(x,x),sep="_")) head(res) #    *   /  - + #1_1 1 1.0  0 2 #2_1 2 2.0  1 3 #3_1 3