Re: [R] a question to transform a dataframe empty 0/1

2013-06-20 Thread Arnaud Michel
Thank you arun ! I don't know the library reshape2 Michel Le 20/06/2013 19:55, arun a écrit : Hi, Not sure if you wanted the entries with "0". library(reshape2) dfMelt<-melt(df,id.var=c("Country","Iso")) #subset those with "1" dfNew<- subset(dfMelt,value==1,select=-4) row.names(dfNew)<- 1:

Re: [R] Help with line graph

2013-06-20 Thread Jim Lemon
Hi Tinus, Given your read.csv commands, the names of the seamounts will be read as factors, so col=as.numeric(All$Seamount) should get you started. Jim > Hi > > Struggling to get this correct today. There is 6 seamounts and I would > like > each seamount to be a different line colour. > > The par

Re: [R] Generalized Cholesky Inverse

2013-06-20 Thread Pascal Oettli
Hi, Did you load "bdsmatrix"? Regards, Pascal 2013/6/21 Tjun Kiat Teo > What are the possible options I have for Generalized choleksy Inverse in > R. I tried to use the package bdsmatrix and and was given the error message > function solve.gchol does not exist. Thanks > > Tjun Kiat > >

Re: [R] canonical AR1 w/ measurement error -> pointers?

2013-06-20 Thread ivo welch
thanks, mark. these are excellent starting pointers. I will get to them asap. I hope I won't need to bother you more. regards, /iaw [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] canonical AR1 w/ measurement error -> pointers?

2013-06-20 Thread Mark Leeds
Hi: see andrew harvey's books for the detailed discussion. His earlier one ( I forget the title names ) is more comprehensive. But I bet they both talk about it. what you have is an "almost" random walk with noise model but the coefficient on the ar(term) is not 1. you can estimate that using the

[R] canonical AR1 w/ measurement error -> pointers?

2013-06-20 Thread ivo welch
dear R and stats wizards: I would like to estimate an AR1 model with constant and measurement noise: true[t] = a + b*true[t-1] + noise1[t] observed[t] = true[t] + noise2[t] (true is never observed.) I am very interested in forecasting observed[t+1]., and modestly interested in inferring b a

Re: [R] Choosing subset of data.frame

2013-06-20 Thread arun
HI, You could also use: beta_results[!is.na(match(beta_results[,1],instru)),] #  instrument beta_values #3    JKL   0.529 #6    STU  -1.080 #8    XYZ   0.420 #If there are no duplicates, this could also work beta_results[match(instru,beta_results[,1]),] #  instrument bet

[R] Generalized Cholesky Inverse

2013-06-20 Thread Tjun Kiat Teo
What are the possible options I have for Generalized choleksy Inverse in R. I tried to use the package bdsmatrix and and was given the error message function solve.gchol does not exist. Thanks Tjun Kiat [[alternative HTML version deleted]] __

Re: [R] BINARY traits GENETIC CORRELATION

2013-06-20 Thread Jeff Newmiller
Re-posting, particularly without referencing your earlier post, is bad mailing-list etiquette. Posting in HTML is particularly frowned upon here also. Nor is this a statistical methods support forum... it is about R. I for one am finding your question very jargonish and obscure. If your question

Re: [R] Difference between Lloyd and Forgy algorithms used in R built-in kmeans clustering function

2013-06-20 Thread Safiye Celik
Hi, I searched for a long time and I read this website before asking the question. But it does not answer my issue. Thanks anyway. I digged unto the source code and realized that there is no difference between the implementations of Lloyd and Forgy. In fact, in kmeans.R, the method number is set t

Re: [R] Choosing subset of data.frame

2013-06-20 Thread andrija djurovic
Hi. Try this: beta_results[beta_results$instrument%in%instru, ] and see help page ?"%in%" Hope this helps Andrija On Thu, Jun 20, 2013 at 12:45 PM, Katherine Gobin wrote: > Dear R Forum > > I have a data frame as > > beta_results = data.frame(instrument = c("ABC", "DEF", "JKL", "LMN", > "

[R] how to run copula-based quantile regression

2013-06-20 Thread tong
Hi, I want to run a quantile regression (Y=a+bX+e) using normal and t copula for my dissertation. I 've read the documentation of "copula" and "copBasic". However, I still have difficulty to deal with my data. Details are as following: I've already loaded xls data into r using "XLConnect" packa

Re: [R] R-help Digest, Vol 124, Issue 21

2013-06-20 Thread Prof J C Nash (U30A)
And it could be that you should try nlmrt or minpack.lm. I don't think you were at my talk in Jena May 23 -- might have been very helpful to you. JN On 13-06-20 06:00 AM, r-help-requ...@r-project.org wrote: Message: 47 Date: Wed, 19 Jun 2013 13:17:29 -0500 From: "Adams, Jean" To: pakoun Cc:

Re: [R] help with text patterns in strings

2013-06-20 Thread Crombie, Burnette N
Thanks, Arun. I will study this as soon as possible. I really appreciate your time and R mentoring. Try this: res1<-sapply(vec3,function(x) length(vec2New[grep(x,vec2New)]) ) dat1<-data.frame(res1,Name=names(vec3)) dat1$Name<-factor(dat1$Name,levels=c(

[R] Combining Affy data

2013-06-20 Thread Budhu, Anuradha (NIH/NCI) [E]
Hello, I am running R to combine data from three Affy platforms using the following libraries (Affy, hgu133a2.db, and hgu133plus2.db). After loading the libraries and reading in the data, I run the following to output a combined dataset with the common probes on all three Affy platforms but ge

[R] Problem with "dea.boot" under R 3.0.1

2013-06-20 Thread Vera
Hi all, we conducted a DEA and wanted to correct our efficiency for bias by bootstrapping with R version 3.0.1. With this version, the package "FEAR" does not work anymore. Therefore, we used "dea.boot" for bootstrapping. This, however, returns us negative bias-corrected efficiencies. In the pas

[R] Help with line graph

2013-06-20 Thread Tinus Sonnekus
Hi Struggling to get this correct today. There is 6 seamounts and I would like each seamount to be a different line colour. The part of data set looks like this Seamount Group.1 DepthmNO3 SiO4 PO4NO2 1 Atlantis Below 177.257182 4.90729821 4.402966 0.4059566 0.06

[R] Choosing subset of data.frame

2013-06-20 Thread Katherine Gobin
Dear R Forum I have a data frame as beta_results = data.frame(instrument = c("ABC", "DEF", "JKL",  "LMN", "PQR", "STU", "UVW", "XYZ"), beta_values = c(1.27, -0.22, 0.529, 0.011, 2.31, -1.08, -2.7, 0.42)) > beta_results   instrument beta_values 1    ABC   1.270 2    DEF  -0.220

[R] help - transforming closure to vector

2013-06-20 Thread Viana, Joana
Hi, I'm trying to extract the information from a dataset. I'm doing: dmr<-which(is.element(iDMR, data)) iDMR is an object on the package I'm using that has a list that I want to extract from my dataset. The problem is that iDMR is of type "closure" and to perform the above I need a vector. I've

[R] How to make a test for linearity of a Passing-Bablok Regression

2013-06-20 Thread Annette Timm
Hi All I am having some trouble making a test for linearity of my passing bablok regression.As far as I am concerned i need to make cusum test for linearity to get a p-value. I can make a cusum plot, but I can not figure out how to test for linearity. I hope that my question is clear and that so

[R] compiling Rcpp with 3.0.1 on Solaris 10

2013-06-20 Thread MAYER Hans
Hello My colleagues asked me to install "R" with module "shiny". R version 3.0.1 compiled fine on Solaris 10 and is running well. I tried to install "shiny". With the dependencies "Rcpp" should be installed before. But the compile step did fail. See below. The initial error message is "Error in

[R] BINARY traits GENETIC CORRELATION

2013-06-20 Thread Vallejo, Roger
Dear R Users, I have always used ASReml, MTDFREML, SAS, etc. to estimate genetic correlation (Rg) between two continuous quantitative traits (also continuous and binary trait) but I have never used R package to estimate Rg. However, I use R package for many of my other statistical analysis needs

Re: [R] adding by categories in a data frame???

2013-06-20 Thread arun
Hi, dat1<- read.table(text=" name   number a    2 a    3 b    5 b    7 c 9 c 1 ",sep="",header=TRUE,stringsAsFactors=FALSE) aggregate(number~name,data=dat1,sum) #  name number #1    a  5 #2    b 12 #3    c 10 #or library(plyr)

[R] [SOLVED] Re: "Error: cannot allocate vector of size 1.9 Gb" when loading xtable help

2013-06-20 Thread Dan Keshet
Solved on my end. Turned out to be caused by cyclic dependencies in our (internal) packages. Attempts to install/load them all caused wonky things to happen later on. On Sat, Jun 15, 2013 at 6:18 AM, Duncan Murdoch wrote: > On 13-06-14 7:02 PM, Dan Keshet wrote: >> >> I am using xtable version

Re: [R] a question to transform a dataframe empty 0/1

2013-06-20 Thread arun
Hi, Not sure if you wanted the entries with "0". library(reshape2)  dfMelt<-melt(df,id.var=c("Country","Iso")) #subset those with "1" dfNew<- subset(dfMelt,value==1,select=-4) row.names(dfNew)<- 1:nrow(dfNew)  dfNew #    Country Iso   variable #1  Zimbabwe  ZW  Abaco #2  South Afri

Re: [R] errorest slow

2013-06-20 Thread Uwe Ligges
On 20.06.2013 16:46, David martin wrote: Hi , When using errorest on a large dataset (12000 variables) it performs very slow. By looking at the randomforest package it says that for largedatasets the use of the formula is discouraged. So it's better to use the x and y terms as the example belo

Re: [R] Reading a Vector into R

2013-06-20 Thread arun
HI, You could save it in a .txt file. (e.g. "vec1.txt")  source("vec1.txt")  length(drg_470) [1] 4495  head(drg_470) #[1]  7558  9485 10481 10609 10650 10891 str(drg_470) # num [1:4495] 7558 9485 10481 10609 10650 ... A.K. Hi there, I am having trouble successfully reading this vector into R:

[R] a question to transform a dataframe empty 0/1

2013-06-20 Thread Arnaud Michel
Hello I have the following dataframe : df <- data.frame( Country=c("Zimbabwe","Burkina Faso","South Africa","Madagascar","Tanzania", "Mali","Mozambique","Madagascar","Ghana","Nigeria","Kenya","Burkina Faso", "South Africa","Tanzania","Kenya","Ethiopia" ) , Iso=c("ZW","BF","ZA","MG","TZ","ML","M

[R] C symbol name "psmirnov2x" not in load table

2013-06-20 Thread David Reiner
I'm working with some old code that worked under R 2.15.3 but gives an error under 3.0.0 and 3.0.1 : > 1.0 - .C("psmirnov2x", p = as.double(10.0), as.integer(1000), > as.integer(1000))$p Error in .C("psmirnov2x", p = as.double(10), as.integer(1000), as.integer(1000)) : C symbol name "psmirnov

Re: [R] Determining the maximum memory usage of a function

2013-06-20 Thread Jonathan Greenberg
Jim: Thanks, but I'm looking for something that can be used somewhat automatically -- the function in question would be user-provided and passed to my "chunking" algorithm, so in this case it would be the end-user (not me) who would have to embed these -- would Rprof(memory.profiling=TRUE) # my fu

Re: [R] Determining the maximum memory usage of a function

2013-06-20 Thread Prof Brian Ripley
On 20/06/2013 15:45, Jonathan Greenberg wrote: Folks: I apologize for the cross-posting between r-help and r-sig-hpc, but I figured this question was relevant to both lists. I'm writing a function to be applied to an input dataset that will be broken up into chunks for memory management reasons

Re: [R] Determining the maximum memory usage of a function

2013-06-20 Thread jim holtman
What I would do is to use "memory.size()" to get the amount of memory being used. Do a call at the beginning of the function to determine the base, and then at other points in the code to see what the difference from the base is and keep track of the maximum difference. I am not sure if just gett

[R] errorest slow

2013-06-20 Thread David martin
Hi , When using errorest on a large dataset (12000 variables) it performs very slow. By looking at the randomforest package it says that for largedatasets the use of the formula is discouraged. So it's better to use the x and y terms as the example below: rf<-randomForest(x=df[trainindices,-1]

[R] Determining the maximum memory usage of a function

2013-06-20 Thread Jonathan Greenberg
Folks: I apologize for the cross-posting between r-help and r-sig-hpc, but I figured this question was relevant to both lists. I'm writing a function to be applied to an input dataset that will be broken up into chunks for memory management reasons and for parallel execution. I am trying to dete

Re: [R] p values of lmer

2013-06-20 Thread peter dalgaard
On Jun 19, 2013, at 15:02 , R. Michael Weylandt wrote: > On Wed, Jun 19, 2013 at 10:27 AM, meng wrote: >> Hi all: >> I met a question about lmer. >> >> fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy) >> summary(fm1) >> >> ... >> >> Fixed effects: >>Estimate Std. Error t

[R] BINARY traits GENETIC CORRELATION

2013-06-20 Thread Vallejo, Roger
Dear R Users, I have always used ASReml, MTDFREML, SAS, etc. to estimate genetic correlation (Rg) between two continuous quantitative traits (also continuous and binary trait) but never used R to estimate Rg. However, I use R for many of my other statistical analysis needs; the R package is a gr

Re: [R] knitr: side-by-side figures in R markdown

2013-06-20 Thread Michael Friendly
On 6/19/2013 5:31 PM, Yihui Xie wrote: You need to remove out.extra='style="display:block; margin: auto"'. In CSS, display:block; means this element stands in its own line, and no other elements can sit by its side. This is applied to individual images, so the two images will not be arranged side

[R] New book: Beginner's Guide to GLM and GLMM with R

2013-06-20 Thread Highland Statistics Ltd
Members of this mailing list may be interested in the following new book: Beginner's Guide to GLM and GLMM with R. - A frequentist and Bayesian perspective for ecologists - Zuur AF, Hilbe JM and Ieno EN This book is only available from: http://www.highstat.com/BGGLM.htm This book presents

Re: [R] showing error line

2013-06-20 Thread Duncan Murdoch
On 13-06-20 7:42 AM, Jannis wrote: Dear R users, i am trying to get the line number of the code where an error is produced. With the options: options(keep.source = TRUE, show.error.locations = TRUE, keep.source.pkgs = TRUE) I have managed to get the error locations to show up when i source th

Re: [R] showing error line

2013-06-20 Thread Pascal Oettli
Hi, What is the error message? You don't provide it. Regards, Pascal 2013/6/20 Jannis > Dear R users, > > > i am trying to get the line number of the code where an error is produced. > With the options: > > options(keep.source = TRUE, show.error.locations = TRUE, keep.source.pkgs > = TRUE) >

[R] showing error line

2013-06-20 Thread Jannis
Dear R users, i am trying to get the line number of the code where an error is produced. With the options: options(keep.source = TRUE, show.error.locations = TRUE, keep.source.pkgs = TRUE) I have managed to get the error locations to show up when i source the respective files. They do not

Re: [R] deSolve question

2013-06-20 Thread Chris Campbell
Dear Andras In algebra (and computing) terms are operated upon in order of priority. Terms in brackets are evaluated first. In your original code, - pars$k * state[1] is not divided by pars$v since division happens before addition. When you use the brackets that expression becomes part of the t

Re: [R] installation problems from an Rstudio server

2013-06-20 Thread Prof Brian Ripley
On 20/06/2013 09:53, Erin Hodgess wrote: Dear R People: I'm not sure if this is an R problem or a Centos 5 problem, but here it goes: It is not an R problem. Your message is garbled (don't send HTML?), but the essence is gcc: error trying to exec 'as': execvp: Permission denied That is a

Re: [R] how to get growth rate of a (time series) data?

2013-06-20 Thread peter dalgaard
On Jun 20, 2013, at 00:16 , Rolf Turner wrote: > This is yet another illustration of the rule that if there is a 50-50 chance > of > getting things the wrong way around, then there is actually a probability > of one of getting things the wrong way around. Isn't that suppposed to be ... Oh, wait

[R] installation problems from an Rstudio server

2013-06-20 Thread Erin Hodgess
Dear R People: I'm not sure if this is an R problem or a Centos 5 problem, but here it goes: I'm running Rstudio from a Centos 5 server. When I try to install packages from a non-root account, I get the following: > Sys.umask()[1] "22"> install.packages("maps")Installing package into > ‘/home/

Re: [R] Problems with R package building

2013-06-20 Thread jpm miao
Hi, What do you mean by "Windows in a Windows console window"? Is it the black screen of DOS? I change the directory of the DOS window to D:\R\pkgtest D:\R\pkgtest\test1pkg and run the command R CMD build test1pkg under each of the two paths, and the error message remains. Miao 2013

Re: [R] Problems with R package building

2013-06-20 Thread Berend Hasselman
On 20-06-2013, at 10:01, jpm miao wrote: > Hi, > > Following your advice, I install R tools from > http://cran.r-project.org/bin/windows/Rtools/ > Rtools215.exe > > Files are automatically installed here: > C:\Rtools > > I run t

Re: [R] Problems with R package building

2013-06-20 Thread jpm miao
I ran it in a common window of R. It's said that I need to run it under DOS. I also open the command window of DOS C:\Documents and Settings\miao ,where miao is my username, and ran it, but it doesn't work either. An error message emerges. Miao 2013/6/20 Pascal Oettli > Hi, > > Did you run "

Re: [R] Problems with R package building

2013-06-20 Thread Pascal Oettli
Hi, Did you run "R CMD build test1pkg" in a command prompt window? Regards, Pascal On 20/06/13 17:01, jpm miao wrote: Hi, Following your advice, I install R tools from http://cran.r-project.org/bin/windows/Rtools/ Rtools215.exe

[R] Produce HTML reference in knitr using rmd

2013-06-20 Thread AlexPiche
Hello guys, I'm new to knitr and to R in general. I'm using RStudio and knitr, both the latest version. I am trying to produce an html page with multiple graph, which has a url reference to each of them that bring us lower on the page. For those produce separately it is pretty easy, since I just

Re: [R] Problems with R package building

2013-06-20 Thread jpm miao
Hi, Following your advice, I install R tools from http://cran.r-project.org/bin/windows/Rtools/ Rtools215.exe Files are automatically installed here: C:\Rtools I run the code again and get the message Creating directories ... Er

Re: [R] knitr without R studio

2013-06-20 Thread AlexPiche
Thank you for your time guys, I solve my issue. Regards, Alex -- View this message in context: http://r.789695.n4.nabble.com/knitr-without-R-studio-tp4669841p4669951.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.o

[R] Installing Jags on 64 Bit Fedora

2013-06-20 Thread Tjun Kiat Teo
I know this has been covered before but I have read all the posts on this subject but I still cannot resolve it. I tried to install rjags on a 64bit Fedora 17 and I got this error message Error : .onLoad failed in loadNamespace() for 'rjags', details: call: dyn.load(file, DLLpath = DLLpath, ...)

Re: [R] Difference between Lloyd and Forgy algorithms used in R built-in kmeans clustering function

2013-06-20 Thread Pascal Oettli
Hi, A 5-second search on Internet brought me here: http://en.wikibooks.org/wiki/Data_Mining_Algorithms_In_R/Clustering/K-Means Regards, Pascal On 20/06/13 15:57, Safiye Celik wrote: Hi, Does anybody know the difference between the Lloyd and Forgy algorithms specified for R's kmeans clusteri

[R] Difference between Lloyd and Forgy algorithms used in R built-in kmeans clustering function

2013-06-20 Thread Safiye Celik
Hi, Does anybody know the difference between the Lloyd and Forgy algorithms specified for R's kmeans clustering options? I know how Lloyd works, but I cannot access Forgy's paper and could not find any specific information on the web about how it really differs from Lloyd's method. I appreciate y