Re: [R] estimate value from simulations

2013-05-15 Thread Pascal Oettli
Hi, You probably should read R documentation and learn how to use "seq" ?seq ?rowMeans HTH, Pascal On 05/16/2013 03:17 PM, Zilefac Elvis wrote: 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

[R] estimate value from simulations

2013-05-15 Thread Zilefac Elvis
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

Re: [R] R help: Batch read files based on names in a list

2013-05-15 Thread arun
HI, You could use: (# with 3 files in my folder) lfiles<-list.files(pattern=".txt")  lfiles #[1] "file1.txt" "file2.txt" "file3.txt" lst1<-lapply(lfiles,function(x) read.table(x,header=TRUE,sep="",stringsAsFactors=FALSE)) lst1 #[[1]] #  col1 col2 #1    1  0.5 #2    2  0.2 #3    3  0.3 #4    4  0.3

Re: [R] matrix - pairwise comparison of columns

2013-05-15 Thread arun
Hi, May be this helps: c1<-combn(seq_len(ncol(m)),2)  mat1<- matrix(0,ncol=3,nrow=3,dimnames=list(colnames(m),colnames(m))) vec1<-unlist(lapply(seq_len(ncol(c1)),function(i) {m1<-m[,c1[,i]]; length(which(m1[,1]!=0 & m1[,2]!=0)) })) mat1[lower.tri(mat1)]<-vec1  mat1 #    rs1 rs2 rs3 #rs1   0   0  

Re: [R] R help: Batch read files based on names in a list

2013-05-15 Thread Enrico Schumann
On Wed, 15 May 2013, Jonathan Dry writes: > * > > I am currently reading in a series of files, applying the same functions to > them one at a time, and then merging the resulting data frames e.g.: > >>MyRows <- c("RowA", "RowB", "RowC")>>File1_DF <- >>read.delim("DirectoryToFiles\\File1_Fold

Re: [R] matrix - pairwise comparison of columns

2013-05-15 Thread Bert Gunter
I believe your query is too vague to coherently (and generally) answer, but have a look at ?outer . -- Bert On Wed, May 15, 2013 at 12:57 PM, Hermann Norpois wrote: > Hello, > > I would like to do something with a matrix: > 1) The columns should be compared pairwise. > 2) And the result should

[R] OFF TOPIC: Report on a conference on "Integrity in research"

2013-05-15 Thread Bert Gunter
For those on this list who are interested in "Reproducible Research" and related issues: http://www.nature.com/news/meeting-targets-lab-lapses-1.12987 Cheers, Bert -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roch

Re: [R] Fw: Request for information

2013-05-15 Thread Bert Gunter
Outrageous! http://www.r-project.org/ On Tue, May 14, 2013 at 11:53 PM, Ravishankar Kandallu < ravishankar.kanda...@tcs.com> wrote: > Dear Sir, > > Greetings. I am Ravishankar from Platform Solutions function of Tata > Consultancy Services, Mumbai India. I am associated with team within >

Re: [R] erreur dans R

2013-05-15 Thread Pascal Oettli
Hello, You should write your email in English rather than French. And you should provide a reproducible example. Regards, Pascal On 05/15/2013 06:14 PM, raymond mélaine taha wrote: Bonjour, dans la computation de mon modèle dans R avec le package deSolve pour des Equations Différentielles Or

[R] Unexpected behavior using `merge' by multiple columns

2013-05-15 Thread Eric DeWitt
I recently started using `merge()' to combine data frames that contained different conditioned subsets of the same master data frame. In some conditions the `by' columns had `NA' values and I was using `incomparables=c(NA, NaN)' to avoid including these rows in the resulting merge. However, the beh

[R] matrix - pairwise comparison of columns

2013-05-15 Thread Hermann Norpois
Hello, I would like to do something with a matrix: 1) The columns should be compared pairwise. 2) And the result should be a matrix. I try to illustrate the problem with a testset. > m rs1 rs2 rs3 [1,] 1 1 1 [2,] 0 1 0 [3,] 2 0 1 > dput (m) structure(c(1, 0, 2, 1, 1, 0, 1,

[R] R help: Batch read files based on names in a list

2013-05-15 Thread Jonathan Dry
* I am currently reading in a series of files, applying the same functions to them one at a time, and then merging the resulting data frames e.g.: >MyRows <- c("RowA", "RowB", "RowC")>>File1_DF <- >read.delim("DirectoryToFiles\\File1_Folder\\File1.txt", >stringsAsFactors=FALSE, check.names=

[R] mosaic plot (vcd)

2013-05-15 Thread Vanessa Vetter
Hello everyone, is there a way to increase the distance between the legend label of the Pearson residuals and the bar, which shows the color of the residuals, in the mosaic plot argument (see picture attached)? The minus signs of the negative scale unfortunately run into the bar. Th

[R] Build R package with libjpeg - Symbol not found: _jpeg_CreateCompress

2013-05-15 Thread DcInfSys1
Hello, I am trying to build an /Image Processing Package/, which has in the src- folder a jpeg.c file which uses the libjpeg for reading/writing jpeg files. I think this causes an error if i try to check my package. After the execution of "R CMD INSTALL ImagePackage" i get the ImagePackage.tar.g

Re: [R] Using Phyper

2013-05-15 Thread arun
Hi Shanthi, May be this link helps you (http://stats.stackexchange.com/questions/10328/using-rs-phyper-to-get-the-probability-of-list-overlap). A.K. From: Shanthi Mulinti To: arun Sent: Wednesday, May 15, 2013 10:25 AM Subject: Re: Displaying median value

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread David Lyon
Thank you very much for your help and time. That works very nicelyThanks again! - Original Message - From: John Kane To: David Lyon ; r-help Cc: Sent: Wednesday, May 15, 2013 9:36 AM Subject: Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates My appologies

Re: [R] NMDS using Vegan

2013-05-15 Thread Suparna Mitra
Dear Prof. Simpson, Thanks a lot for your reply. Yes I know that I can change the labels any time, but I was only worried if I am doing any mistake as default output didn't match with the output shown in the Vegan tutorial output. Thanks, Mitra On 15 May 2013 22:43, Gavin Simpson wrote: > On Wed

[R] Fw: Request for information

2013-05-15 Thread Ravishankar Kandallu
Dear Sir, Greetings. I am Ravishankar from Platform Solutions function of Tata Consultancy Services, Mumbai India. I am associated with team within Platform Solutions group that specializes in statistical modeling solutions to various clients. We are exploring various statistical computing

Re: [R] New quotation

2013-05-15 Thread dvr
Hello my friend, We produce CCTV camera, IP Cameras, DVR and HVR with high quality&very competitive price located in China. Hope to find a way to cooperate with you. Visit us at www.sunivision.com E-catalogues will be sent if needed. Write me back or call me pls, let's talk more in details. B

[R] erreur dans R

2013-05-15 Thread raymond mélaine taha
Bonjour, dans la computation de mon modèle dans R avec le package deSolve pour des Equations Différentielles Ordinaires (ODEs), je rencontre l'erreur suivant: Erreur dans checkFunc(Func2, times, y, rho) :    The number of derivatives returned by func() (1457) must equal the length of the initial

Re: [R] date and time coding question

2013-05-15 Thread Jeff Newmiller
The difference of two POSIXct values is of type difftime. You should not think of difftime as having units. Rather, you should think of the result of converting from difftime to numeric (using as.numeric) as the opportunity (or rather requirement) to specify what time units you want. If you let

Re: [R] x and y lengths differ

2013-05-15 Thread MacQueen, Don
This example illustrates your problem: > plot(1:3,1:3) > plot(1:3,1:4) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ Now all you have to do is figure out which of your plot() commands gives the error, and check the values you are giving to it to find out which have

Re: [R] R update problem

2013-05-15 Thread Emre Sahin
On Wed, May 15, 2013 at 10:42:07AM -0700, carol white wrote: > yes, and here is the output > Executing: gpg --ignore-time-conflict --no-options --no-default-keyring > --secret-keyring /tmp/tmp.DhD6e2Q3Xb --trustdb-name /etc/apt/trustdb.gpg > --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt

Re: [R] date and time coding question

2013-05-15 Thread MacQueen, Don
I think you probably want format='%m/%d/%y %H:%M') (lower case "y") diff() as suggested by Jeff Newmiller is good, except that I don't know how to control the units using diff(). ## so a method that allows specifying units other than hours would be, for example, datetime <-c("1/1/13 00:00","

Re: [R] Problem with convergence in optim

2013-05-15 Thread Luis Felipe Parra
Thanks Rui, i already tried changin the reltol, but it didn't change the outcome On Wed, May 15, 2013 at 1:32 PM, Rui Barradas wrote: > Hello, > > It's impossible to tell what is happening without the function and the > values for the other variables (including the initial parameters) but your

Re: [R] Problem with convergence in optim

2013-05-15 Thread Rui Barradas
Hello, It's impossible to tell what is happening without the function and the values for the other variables (including the initial parameters) but your setting of reltol is too small. Try using the default. It's sqrt(.Machine$double.eps), about 1e-8, you are using 1e-16. Hope this helps, R

[R] animating plots over time with a slider

2013-05-15 Thread Gavin Rudge
I have a population of subjects each with a variable which has been captured at a baseline date. Then for many subjects (but not all) an intervention has occurred and the variable has changed at one or more time points after the baseline date. So my dataset consists of a subject ID (x), which

[R] x and y lengths differ

2013-05-15 Thread catalin roibu
I have a problem with R. I try to compute the confidence interval for my df. When I want to create the plot I have this problem: Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ. I try this code: library(dplR) df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL) write.

Re: [R] R update problem

2013-05-15 Thread carol white
yes, and here is the output Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.DhD6e2Q3Xb --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys E084DA

[R] Problem with convergence in optim

2013-05-15 Thread Luis Felipe Parra
Hello to all, I have been using an optim with the following call: optim(param_ini,fun_errores2,Precio_mercado=Precio,anos_pagosE2=anos_pagos,control=list(maxit=1,reltol=1e-16)) depending on the intial values I'm getting the same solution but once I get the convergence message=10 (no converge

[R] stack object layer names not visible

2013-05-15 Thread Fabio Berzaghi
I use to be able to see the layer names of a RasterStack by just typing its name but now I only get this class : RasterStack dimensions : 70, 180, 12600 (nrow, ncol, ncell) resolution : 0.5, 0.5 (x, y) extent : -80, 10, 50, 85 (xmin, xmax, ymin, ymax) coord. ref. : NA If I do pl

Re: [R] R update problem

2013-05-15 Thread Emre Sahin
On Wed, May 15, 2013 at 07:59:32AM -0700, carol white wrote: > Hi, > I try to update R on Ubuntu > > I added deb http://cran.cnr.Berkeley.edu/bin/linux/ubuntu precise/ in > /etc/apt/sources.list but any mirror site that I take, I get the following > error msg: > > W: GPG error: http://cran.cnr.

Re: [R] how to show a dataset in 3d?

2013-05-15 Thread Chris Campbell
# Hi Maggy # Try the rgl package con <- textConnection(" Subject Time1 Time2 Time3 1 0.385 0.103 -0.488 2 -1.939 0.569 1.370 3 -1.196 -0.051 1.247 4 0.174 -1.163 0.989 5 1.246 0.558 -1.804 6 -1.108 -0.057 1.165

[R] R update problem

2013-05-15 Thread carol white
Hi, I try to update R on Ubuntu I added deb http://cran.cnr.Berkeley.edu/bin/linux/ubuntu precise/ in /etc/apt/sources.list but any mirror site that I take, I get the following error msg: W: GPG error: http://cran.cnr.Berkeley.edu precise/ Release: The following signatures couldn't be verified

Re: [R] Vegan package treatment of zeros

2013-05-15 Thread Gavin Simpson
On Wed, 2013-05-15 at 09:04 -0500, Michael Rentz wrote: > Hello: I have a good size database of plant cover measurements I was > running a Shannon Diversity on. I have every cell as a default of "0" if > it is not present. The tutorials I have looked at all had blanks in cases > of absence. I j

Re: [R] NMDS using Vegan

2013-05-15 Thread Gavin Simpson
On Wed, 2013-05-15 at 12:06 +0800, Suparna Mitra wrote: > Hello R experts, > I am new to Vegan and use trying to follow the tutorial to perform NMDS > for my data. But after performing the metaMDS, when I plotted my results > the default plot shows MDS1 vs MDS2. Thought according to the > tutoria

[R] how to show a dataset in 3d?

2013-05-15 Thread maggy yan
my dataset looks like this in the beginning: Subject Time1 Time2 Time3 1 1 0.385 0.103 -0.488 2 2 -1.939 0.569 1.370 3 3 -1.196 -0.051 1.247 4 4 0.174 -1.163 0.989 5 5 1.246 0.558 -1.804 6 6 -1.108 -0.057 1.165 7 7 -0.609 -0.34

[R] Vegan package treatment of zeros

2013-05-15 Thread Michael Rentz
Hello: I have a good size database of plant cover measurements I was running a Shannon Diversity on. I have every cell as a default of "0" if it is not present. The tutorials I have looked at all had blanks in cases of absence. I just wanted some kind of verification that VEGAN will recognize 0

Re: [R] K Fold CrossValidation

2013-05-15 Thread Kevin Hao
Maybe the following code is helpful for you. At the same time, you can check the ChemometricsWithR package from http://cran.r-project.org/web/packages/available_packages_by_date.html. # product crossvalidation index crossvalind

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread David Lyon
Thanks John for your reply. I did include the data if you scroll down to the end of my original email. Can someone help me on this? Thanks - Original Message - From: John Kane To: David Lyon ; r-help Cc: Sent: Tuesday, May 14, 2013 4:11 PM Subject: RE: [R] Help me please: gplot, f

[R] Empty clusters in k-means - possible solution

2013-05-15 Thread Simon Chamaillé
Hello all, k-means algorithms can at times fail because one of the cluster become emmpty. In this case, the kmeans R function returns: "empty cluster: try a better set of initial centers" This has been discussed several times on several R-lists, and is NOT a bug, but can be annoying when usin

Re: [R] K Fold CrossValidation

2013-05-15 Thread Kevin Hao
Below is the some code, may be helpful for you. [maybe have the finished package which includes mlr with crossvaliation], you can check http://cran.r-project.org/web/packages/available_packages_by_date.html. you can check this "ChemometricsWithR

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread John Kane
My appologies, I was in a rush yesterday and a) completely misread the post and b) did not scroll down far enough. David W is correct that you need to do something with the data set. <.6 is not a number. Also, as David says, it sounds like your coversion using as.Date did not work out. Th

Re: [R] Error in colMeans with multiple column data.frame

2013-05-15 Thread arun
Hi, #dput() dat1<- structure(list(a1 = c(432L, 0L, 1295L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 432L, 0L, 432L, 0L, 0L, 0L, 0L, 432L, 0L, 432L, 0L, 0L, 0L, 0L, 0L, 864L, 0L, 432L, 432L, 1296L, 0L, 432L, 0L, 0L, 432L, 0L, 863L, 432L, 0L, 432L, 432L, 0L, 432L, 0L, 0L, 432L, 864L, 0L, 432L, 0L, 432L, 0L,

Re: [R] data manipulation

2013-05-15 Thread Jim Lemon
On 05/15/2013 04:15 PM, catalin roibu wrote: Hello all! I have a problem with my data. My initial data is a list years and months (see below). I want to transpose my data (12 rows (months) and year values as column). I try t(spi3), but the year values do not appear as column names, but as values.

Re: [R] Error in colMeans with multiple column data.frame

2013-05-15 Thread Simonas Kecorius
Thank you for your help. Appreciate it a lot! I am using appropriate names, just here as an example I used data :) 2013/5/15 Rui Barradas > Hello, > > Try the following. > > aggregate(. ~ interval, data = data, mean) > > > Also, 'data' is an R function, you should use some other name, such a

Re: [R] Error in colMeans with multiple column data.frame

2013-05-15 Thread Rui Barradas
Hello, Try the following. aggregate(. ~ interval, data = data, mean) Also, 'data' is an R function, you should use some other name, such as 'dat'. Hope this helps, Rui Barradas Em 15-05-2013 10:46, Simonas Kecorius escreveu: Dear R users, Here is my data: "a1""a2""a3""a4"

Re: [R] Error in colMeans with multiple column data.frame

2013-05-15 Thread Simonas Kecorius
Thank you so much, it did what I need! 2013/5/15 Pascal Oettli > Hi, > > I renamed your data.frame "df", as "data" is a built-in function. > > You can achieve what you are looking for with: > > > datf.mean <- with(datf, aggregate(datf[,-6], list(interval=interval), > mean)) > > Advice: > Next t

Re: [R] Error in colMeans with multiple column data.frame

2013-05-15 Thread Blaser Nello
It looks like you should use "by" instead of "tapply". Anyway, if you use dput(data) for sharing your data, it is much easier to get help. Best, Nello -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Simonas Kecorius Sent: Mitt

Re: [R] Error in colMeans with multiple column data.frame

2013-05-15 Thread Pascal Oettli
Hi, I renamed your data.frame "df", as "data" is a built-in function. You can achieve what you are looking for with: > datf.mean <- with(datf, aggregate(datf[,-6], list(interval=interval), mean)) Advice: Next time, use "dput" when you submit a data set to R-help. Hope this helps, Pascal

[R] K Fold CrossValidation

2013-05-15 Thread Preetam Pal
Hi all, I want to run the following Cross-validation technique on my data set: Variables: X, Y (each having 50 observations) I want to run a least-squares regression of Y on X. I need to divide the entire data set into 10 groups of size 5 each, keep one of them out as 'test' set and build the mod

[R] Error in colMeans with multiple column data.frame

2013-05-15 Thread Simonas Kecorius
Dear R users, Here is my data: "a1""a2""a3""a4""a5""interval" 432355159930499491 01841579182101201 1295208861104101 0100572910298361 017095842190441 017028963926

Re: [R] Possible bug in 'data.table'

2013-05-15 Thread Manta
As somebody else replied (but for some reason did not get through it) the solution to this is to convert the variable TIME3 from POSIXlt to POSIXct. It works like a charm. Nevertheless, there is a bug in that R should give me a warning/error message, and not simply crash. I reported the bug to the

[R] BASEL II Validation Tests

2013-05-15 Thread Preetam Pal
Hi, I would like to know whether there is any in-built code for the following BASEL II related validation tests: 1>Level Test 2> K-Fold Test 3>Mobility Test Kindly let me know if I need to supply any more information. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year,