Re: [R] colmeans not working

2012-12-23 Thread arun
HI Eliza, The reason why you didn't get the result is because: dat1<-read.csv("elisa.csv",header=TRUE,stringsAsFactors=FALSE) str(dat1) #'data.frame':    506953 obs. of  5 variables: # $ st   : chr  "AGOMO" "AGOMO" "AGOMO" "AGOMO" ... # $ year : int  2004 2004 2004 2004 2004 2004 2004 2004

Re: [R] colmeans not working

2012-12-23 Thread arun
Dear Eliza, It didn't change the result. res<-list(read.table(text=" month  2005  2006  2008  2009   1 1.7360776 0.8095275 1.6369044 0.8195241   2 0.6962079 3.8510720 0.4319758 2.3304495   3 1.0423625 2.7687266 0.2904245 0.7015527   4 2.4158326 1.2315324 1.4287

Re: [R] colmeans not working

2012-12-23 Thread arun
Hi Eliza, I tried with the example you gave.  Couldn't reproduce the error.  res1<-list(read.table(text="     2005  2006  2008  2009   1.7360776 0.8095275 1.6369044 0.8195241   0.6962079 3.8510720 0.4319758 2.3304495   1.0423625 2.7687266 0.2904245 0.7015527   2.4158326 1.2

Re: [R] colmeans not working

2012-12-23 Thread eliza botto
Dear Arun,on having a bird eye view i came to notice that the data you are using dont have month column at the beginning.my initial data was> res $EE month 2005 2006 2008 20091 1 1.7360776 0.8095275 1.6369044 0.81952412 2 0.6962079 3.8510720 0.4319758 2.33044953

Re: [R] axes labeling

2012-12-23 Thread Jim Lemon
On 12/21/2012 07:12 AM, Sam Steingold wrote: * David L Carlson [2012-12-20 13:58:00 -0600]: It is possible, but only by using axis() since you can specify axis breaks in a plot command, but not the labels. You can ignore most of the axis() options so the commands are pretty simple: plot(x=c(1,

Re: [R] colmeans not working

2012-12-23 Thread eliza botto
Thanks arun. that is so kind you. i actually wanted rowMeans. right now i m sitting at dublin airport and as i dont have R in my phone, therefore i cant really apply the command at the moment. i will try and if i get any error i will get back you striaght away.thankyou very much indeed. eliza

Re: [R] colmeans not working

2012-12-23 Thread arun
HI Eliza, Just a doubt: YOu mentioned that  "i then eliminated the first column as i was interested in knowing the row wise mean of each sublist, by using" and "afterwards when i applied the "colMeans" command i was not able to calculate the mean as i got the following error" Do you need colMea

Re: [R] colmeans not working

2012-12-23 Thread eliza botto
Dear Ben,Thanks for replying but its still not working.your code was>lapply(res,colMeans)but i want to use "res1" instead of "res". when i did use it, i got same error.eliza > To: r-h...@stat.math.ethz.ch > From: bbol...@gmail.com > Date: Mon, 24 Dec 2012 00:31:41 + > Subject: Re: [R] colmea

Re: [R] colmeans not working

2012-12-23 Thread Ben Bolker
eliza botto hotmail.com> writes: > Dear useRs,You must all the planning for the christmas, but i am > stucked in my office on the following issue i had a file containg > information about station name, year, month, day, and discharge > information. i opened it by using following command > > dat

[R] colmeans not working

2012-12-23 Thread eliza botto
[text file is also attached in case you find the format of email difficult to understand] Dear useRs,You must all the planning for the christmas, but i am stucked in my office on the following issue i had a file containg information about station name, year, month, day, and discharge informatio

Re: [R] Select maximum subset

2012-12-23 Thread arun
Hi, Just to make it more general. z1<-data.frame(z) z1[colSums(is.na(z1))<=min(colSums(is.na(z1[,-1])))] #  id  a  b #1  1  4  3 #2  2  3 NA #3  3  2  2 #4  4 NA  7 #5  5  1  1 A.K. - Original Message - From: Evgenia To: r-help@r-project.org Cc: Sent: Sunday, December 23, 2012 4:16 P

Re: [R] problem in installing RcppBDT_0.2.1

2012-12-23 Thread Duncan Murdoch
On 12-12-23 5:10 PM, Soyeon Kim wrote: Dear listers, I am trying to install RcppBDT_0.2.1 on my Windows machine using the function install.packages("./RcppBDT_0.2.1.tar.gz", repos=NULL, type="source"). Since this package is not like most of other packages in that it requires Rcpp and boost, I ha

[R] problem in installing RcppBDT_0.2.1

2012-12-23 Thread Soyeon Kim
Dear listers, I am trying to install RcppBDT_0.2.1 on my Windows machine using the function install.packages("./RcppBDT_0.2.1.tar.gz", repos=NULL, type="source"). Since this package is not like most of other packages in that it requires Rcpp and boost, I have installed Rcpp and boost first, and ex

Re: [R] Select maximum subset

2012-12-23 Thread arun
Hi, try this:  z1<-data.frame(z) z1[colSums(is.na(z1))<=1] #  id  a  b #1  1  4  3 #2  2  3 NA #3  3  2  2 #4  4 NA  7 #5  5  1  1 A.K. - Original Message - From: Evgenia To: r-help@r-project.org Cc: Sent: Sunday, December 23, 2012 4:16 PM Subject: [R] Select maximum subset Suppose i

[R] Esttab error while exporting regression results

2012-12-23 Thread Francesco Sarracino
Dear listers, I am trying to export a regression output to a latex document using the R package eststo. I have two variables: an ordered factor: group <- gl(3,5,20, labels=c("Ctl","Trt","prp")) and a continuous variable: weight <- runif(20) I want to regress weight over group, therefore I run:

[R] Select maximum subset

2012-12-23 Thread Evgenia
Suppose i have matrix z id<-c(1,2,3,4,5) a <- c(4, 3, 2, NA, 1) b <- c(3, NA, 2, 7, 1) c <-c(3, NA, NA, 7, NA) z<- cbind(id,a, b,c) id a b c [1,] 1 4 3 3 [2,] 2 3 NA NA [3,] 3 2 2 NA [4,] 4 NA 7 7 [5,] 5 1 1 NA I want to select those columns for which I have the smallest

[R] (no subject)

2012-12-23 Thread Ali Mahmoudi
Hi, what's the function to use 'path analysis' in R?  [[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.h

Re: [R] Spammer radhi

2012-12-23 Thread Duncan Murdoch
On 23/12/2012 1:46 PM, Rui Barradas wrote: This happened two or three weeks ago and it's happening again. Spammers are using Nabble to attack R-Help. The psts are signed radhi and the posts' titles are taken from previous posts and therefore seem authentic but all messages end with "click here".

[R] Spammer radhi

2012-12-23 Thread Rui Barradas
This happened two or three weeks ago and it's happening again. Spammers are using Nabble to attack R-Help. The psts are signed radhi and the posts' titles are taken from previous posts and therefore seem authentic but all messages end with "click here". I suggest you don't. And don't rply to th

Re: [R] wireframe and margins

2012-12-23 Thread David Winsemius
On Dec 23, 2012, at 9:43 AM, krusty the klown wrote: Hi everybody, I'm working with wireframe (and persp) functions, and I'm not able to set the margins between the 3d plot and the R window... It should be easy, innit?, but I can't find out which parameters I have to change... Any help? Than

[R] wireframe and margins

2012-12-23 Thread krusty the klown
Hi everybody, I'm working with wireframe (and persp) functions, and I'm not able to set the margins between the 3d plot and the R window... It should be easy, innit?, but I can't find out which parameters I have to change... Any help? Thanks, ktk -- View this message in context: http://r.789695

Re: [R] ggplot2: setting martin

2012-12-23 Thread Jeff Newmiller
perhaps you should be in communication with the ggplot developers. The ggplot mailing list would be an appropriate place to begin. --- Jeff NewmillerThe . . Go Live... DCN:Bas

Re: [R] help

2012-12-23 Thread David Winsemius
On Dec 23, 2012, at 7:32 AM, aminreza amini wrote: Hi, i want to do a "canonical correlation analysis" with *CCA* package but i am unable to load it coz first of all i need to load *"RCurl"* package butthe problem is *"RCurl"* package is *not available* for windows. so i am ont able to

Re: [R] correction needed in codes

2012-12-23 Thread eliza botto
same to u. :D eliza > Date: Sun, 23 Dec 2012 16:42:03 + > From: ruipbarra...@sapo.pt > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] correction needed in codes > > Merry christmas. > > Rui Barradas > Em 23-12-2012 16:41, eliza botto escreveu: > > Dear Rui,tha

Re: [R] correction needed in codes

2012-12-23 Thread eliza botto
Dear Rui,thankyou very much. it was spot on. :D eliza > Date: Sun, 23 Dec 2012 16:36:46 + > From: ruipbarra...@sapo.pt > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] correction needed in codes > > Hello, > > How about > > > fun <- function(i){ > matp

Re: [R] correction needed in codes

2012-12-23 Thread eliza botto
Dear Rui,First of all, thankyou very much indeed for you kind reply. the problem unfortunately still persists. it does plot and save the yearly curves of all the stations but overlapping of average curve still remains an issue.i am writing the complete code, please see if you can spot error. P

Re: [R] creating a function

2012-12-23 Thread Jeff Newmiller
Sounds like you want to simulate an ARIMA model. Why don't you read up on that topic using RSiteSearch() and then perhaps rephrase your question? --- Jeff NewmillerThe . . Go Live...

Re: [R] correction needed in codes

2012-12-23 Thread Rui Barradas
Merry christmas. Rui Barradas Em 23-12-2012 16:41, eliza botto escreveu: Dear Rui,thankyou very much. it was spot on. :D eliza Date: Sun, 23 Dec 2012 16:36:46 + From: ruipbarra...@sapo.pt To: eliza_bo...@hotmail.com CC: r-help@r-project.org Subject: Re: [R] correction needed in codes

Re: [R] correction needed in codes

2012-12-23 Thread Rui Barradas
Hello, How about fun <- function(i){ matplot(res[[i]][,-1], type="l",col="grey") lines(b[[i]], lwd = 2, col = "black") } for (i in seq(1)){ a <- lapply(seq_along(res), function(x) res[[x]][,-1]) b <- lapply(seq_along(a), function(a) matrix(rowMeans(res[[a]]),ncol=1)) lappl

[R] Renaming column names according to another dataframe

2012-12-23 Thread radhi
Hi, I've got a dataframe having a code as column name. Addtionally I have another dataframe with a two columns (and lots of rows), the first containing the code and the second some Text (real name). Now I'd like to use the information (pairs of code and name) of the second dataframe to rename all t

[R] Removing named objects using rm(..)

2012-12-23 Thread radhi
When I import the library timeSeries I get (at least) the variable USDCHF imported too. I would like to delete it, but I cannot. As you can see below. Clearly I am doing something wrong. What is it? > library(timeSeries) Loading required package: timeDate > class(USDCHF) [1] "timeSeries" attr(,"p

[R] Latitudinal mean of values in a data frame

2012-12-23 Thread radhi
Dear all, I have a big file containing latitude points(-10 to 80) and corresponding values. Example data Lat=c(69.48134, 69.49439, 69.50736, 69.52026, 69.52438, 69.53308, 69.53746, 69.54365, 69.54582, 69.6884, 69.69272, 69.998, 70.00055, 70.00106, 70.00295, 70.00308, 70.00363, 70.00427, 70.00665, 7

[R] small issue with over-zealous clean.

2012-12-23 Thread radhi
Noticed a problem for a while - tests/testit.Rd, tests/ver20.Rd are removed on "make clean" unintentionally. This seems to come from a change in tests/Makefile.in, which adds the line:-@rm -f *.tar.gz *.Rd back in May 2012. --- commit c4d70254e7b7f9d7ed17faecfb3097195d852ddc Author: rip

Re: [R] MLE with R

2012-12-23 Thread radhi
click here This is a link -- View this message in context: http://r.789695.n4.nabble.com/MLE-with-R-tp4653818p4653819.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list ht

[R] MLE with R

2012-12-23 Thread sensei88
Hi everyone, I'm writing a thesis about financial copulas (gaussian and t-student copulas) but i have problems about the R-code. I'll explain better: i downloaded 10 time series about financial indeces and i have to apply the gaussian copula. First i have to divide the ranks of the osservations by

Re: [R] ggplot2: setting martin

2012-12-23 Thread Frans Marcelissen
Hi Ista, Your suggestion is not the solution I need. My problem is that in this way each plot gets another margin. I try to create a presentation with about 10 plots.The presentation does'nt look well if each plot has another marging. Is there way to set the margin manually? Frans   -Oor

Re: [R] Calling a .bat to set environment variables and subsequent .exe execution from within R

2012-12-23 Thread Henrik Bengtsson
If all you need to do is to set environment variables, you can do that from within R, e.g. > shell("echo %FOO%") %FOO% > Sys.setenv("FOO"="42"); > shell("echo %FOO%") 42 My $.02 On Sun, Dec 23, 2012 at 11:14 AM, Ludwig Hilger wrote: > Dear list, > > I have found a thread dealing with similar pr

Re: [R] creating a function

2012-12-23 Thread Rui Barradas
Hello, If I understand it correctly, a simple change to my previous code will do. I have also change the name of function 'x' to 'FUN', to make it more readable. Yfun <- function(Y, p, FUN, epsilon){ for (i in 2:length(Y)) { Y[i] <- Y[i-1] + (1/p)*sum(FUN(Y[1:(i-1)])) + epsilon[i]

Re: [R] correction needed in codes

2012-12-23 Thread Rui Barradas
Hello, Can't you simply lapply(b, lines, lwd = 2) ? Hope this helps, Rui Barradas Em 23-12-2012 02:19, eliza botto escreveu: Dear useRs,while trying to plot the yearly curves of 1000 stations and overlapping each set of curves with mean curve and then saving it automatically in a pdf file,

[R] help

2012-12-23 Thread aminreza amini
Hi, i want to do a "canonical correlation analysis" with *CCA* package but i am unable to load it coz first of all i need to load *"RCurl"* package butthe problem is *"RCurl"* package is *not available* for windows. so i am ont able to load *CCA* package. ** what can i do? thanks in advance for a

[R] Installing Packages from a Local Repository

2012-12-23 Thread radhi
Hi everyone, I've followed the instructions from R-Admin Section 6.6 for creating a local repository. I've modified my Rprofile.site file to add the local repository to my repos, but I haven't been able to successfully install my package from the repo. Here's the code that I've run. ###

[R] Calling a .bat to set environment variables and subsequent .exe execution from within R

2012-12-23 Thread Ludwig Hilger
Dear list, I have found a thread dealing with similar problems with a Mac, but somehow I cannot get it to work and the problem is slightly different: I am using the shell() command to execute a program from within R. The problem is that I need to execute SDKShell.bat file first that sets the envir

Re: [R] creating a function

2012-12-23 Thread Simone Gogna
Hi, thank you Rui for your reply. I understand I haven’t made it clear enough. What I do want to make is a kind of autoregressive process where Y_t+1 depends on its lagged value Y_t. If I wanted to simulate a simple AR(1) process I would have done something as follows: n<-500 Y_init_cond<-0 E

[R] outlier color change in lattice bwplot()

2012-12-23 Thread sc
Hi, Is there any way to change the outlier color in a plot by bwplot()? The code I use is the following. grs = list(col=1:2,lty=1:2,pch=c(1,16)) n=90 set.seed(12) sda=data.frame(x=rnorm(n)+20*rbinom(n,1,1/3),g=as.factor(rbinom(n,1,prob=1/2)), t=as.factor(rep(1:3,n/3))) bwplot(x~g|t,