[R] How to get a running mean result by R?

2013-06-12 Thread Jie Tang
Hi R users: I have a big data and want to calculate the running mean of this data . How can I get this kind of result ? I have check the command "mean" it seems "mean" could not get the running mean? -- TANG Jie [[alternative HTML version deleted]]

[R] change factor to mtrix

2013-06-12 Thread Gallon Li
i wish to change a column of factor variable to multiple columns of zero-ones for example, my factor could be ff=c('a','a','b','b','c','c') then I want to have two columns (for three levels) that are 0 0 0 0 1 0 1 0 0 1 0 1 how can i do this fast? [[alternative HTML version deleted]]

[R] Instant search for R documentation

2013-06-12 Thread jonathan cornelissen
Hi, I just wanted to share with you that we made a website over the weekend that allows "instant search" of the R documentation on CRAN, see: www.Rdocumentation.org. It's a first version, so any feedback/comments/criticism most welcome. Best regards, Jonathan

Re: [R] Question on Simple Repeated Loops

2013-06-12 Thread Berend Hasselman
On 12-06-2013, at 04:53, Abdul Rahman bin Kassim (Dr.) wrote: > > Dear R-User, > > Appreciate any helps. It looks simple, but I don't have a clue. > > Given that I have a dataframe of tree population with three variables: > > sp=species , > d0=initial_size > grow=growth increment from initi

Re: [R] help using code

2013-06-12 Thread Rui Barradas
Hello, Simply assign the output of a function to a variable: xyzuvw <- importdata(...) and then use that output. In this case, a data.frame with, among others, vectors 'x' and 'y'. You need to read an R introductory text. I recommend An Introduction to R, file R-intro.pdf in your doc director

Re: [R] change factor to mtrix

2013-06-12 Thread Jim Lemon
On 06/12/2013 05:47 PM, Gallon Li wrote: i wish to change a column of factor variable to multiple columns of zero-ones for example, my factor could be ff=c('a','a','b','b','c','c') then I want to have two columns (for three levels) that are 0 0 0 0 1 0 1 0 0 1 0 1 how can i do this fast? H

[R] loops for matrices

2013-06-12 Thread maggy yan
I have to use a loop (while or for) to return the result of hadamard product. now it returns a matrix, but when I use is.matrix() to check, it returns FALSE, whats wrong? Matrix.mul <- function(A, B) { while(is.matrix(A) == FALSE | is.matrix(B) == FALSE ) {print("error") bre

[R] Version 1.3.2 of apcluster package (+ last announcement of Webinar)

2013-06-12 Thread Ulrich Bodenhofer
Dear colleagues, This is to inform you that Version 1.3.2 of the R package *apcluster* has been released on CRAN yesterday (note that it may still take a few more hours until the Windows binary will be available). We added a plotting function that also allows for plotting clustering results al

Re: [R] loops for matrices

2013-06-12 Thread Rainer Schuermann
The comments on StackOverflow are fair, I believe... Please dput() your matrices, so that your code becomes reproducible! On Wednesday 12 June 2013 11:14:35 maggy yan wrote: > I have to use a loop (while or for) to return the result of hadamard > product. now it returns a matrix, but when I use i

Re: [R] Caret train with glmnet give me Error "arguments imply differing number of rows"

2013-06-12 Thread Ferran Casarramona
Hi Max, I think I get the cause of this error. I left unintentionally some NA's in the y parameter of train(). Here is the example to reproduce it: X <- matrix(seq(1:100, 10, 10) Y <- seq(1:10) Y[1] <- NA fit <- train(X, Y, method="glmnet", preProcess=c("center","scale")) Regards, Ferran 201

Re: [R] How to get a running mean result by R?

2013-06-12 Thread Rui Barradas
Hello, You can use, for instance, function ma() in package forecast. # if not yet installed #install.packages('forecast', dependencies = TRUE) library(forecast) ?ma Hope this helps, Rui Barradas Em 12-06-2013 08:21, Jie Tang escreveu: Hi R users: I have a big data and want to calculate

Re: [R] Bytes to Numeric/Float conversion

2013-06-12 Thread Bikash Agrawal
Actually I am using rJava, running some map-reduce using R. The data send is in bytes, but actually it is floating-point number. On R side, I need to convert this byte into Float. But I couldn't find any function. I am try using rawToChar() which convert into character. And later on as.double to c

Re: [R] Instant search for R documentation

2013-06-12 Thread Spencer Graves
On 6/12/2013 1:03 AM, jonathan cornelissen wrote: Hi, I just wanted to share with you that we made a website over the weekend that allows "instant search" of the R documentation on CRAN, see: www.Rdocumentation.org. It's a first version, so any feedback/comments/criticism most welcome.

Re: [R] Add a column to a dataframe based on multiple other column values

2013-06-12 Thread Keith S Weintraub
Tom, Here is my solution. Note that I assume the columns are interleaved as you describe below. I'm sure others will have better replies. Note that using dput helps the helpers. # From dput(mdat) mdat<-structure(list(x1 = c(2L, 2L, 2L, 3L, 3L, 30L, 32L, 33L, 33L), y1 = c(100L, 100L, 100L,

Re: [R] Bytes to Numeric/Float conversion

2013-06-12 Thread Duncan Murdoch
On 13-06-12 6:54 AM, Bikash Agrawal wrote: Actually I am using rJava, running some map-reduce using R. The data send is in bytes, but actually it is floating-point number. On R side, I need to convert this byte into Float. But I couldn't find any function. I am try using rawToChar() which conver

Re: [R] QR factorization for aov

2013-06-12 Thread peter dalgaard
On Jun 11, 2013, at 20:26 , Mimi Celis wrote: > I am looking at the aov function in R. I see that it uses a modified QR > factorization routine dqrdc2 based on the Linpack routine dqrdc. Pivoting is > done different than the original Linpack function. > > My questions: > > * Why is it nece

Re: [R] change factor to mtrix

2013-06-12 Thread peter dalgaard
On Jun 12, 2013, at 09:47 , Gallon Li wrote: > i wish to change a column of factor variable to multiple columns of > zero-ones > > for example, my factor could be > > ff=c('a','a','b','b','c','c') > > then I want to have two columns (for three levels) that are > > 0 0 > 0 0 > 1 0 > 1 0 > 0 1

Re: [R] Big, complex, well-structured .R file for demonstration?

2013-06-12 Thread Jeff Newmiller
Just because you have an editor that can let you see the organization within the file does not mean the code itself is well-structured. If you do put a lot of code in one file, you will be more likely in your next project that builds on this one to load code you do not need (bloat), and that is

Re: [R] Combining CSV data

2013-06-12 Thread Shreya Rawal
Great, thanks Arun, but I seem to be running into this error. Not sure what did I miss. > result<-data.frame(final_ouput[,-5],read.table(text=as.character(final_output$comment),sep="|",fill=TRUE,na.strings=""),stringsAsFactors=FALSE)colnames(result)[5:7]<-paste0("DataComment",1:3) Error: unexpecte

Re: [R] agnes() in package cluster on R 2.14.1 and R 3.0.1

2013-06-12 Thread Martin Maechler
> Hugo Varet > on Tue, 11 Jun 2013 15:15:36 +0200 writes: > Dear Martin, > Thank you for your answer. Here is the exact call to agnes(): > setwd("E:/Hugo") > library(cluster) > load("mydata.rda") > tableauTani<-dist.binary(mydata, method = 4, diag = FALSE, uppe

[R] GGally installation problems

2013-06-12 Thread Tim Smith
Hi, I was trying to install the GGally package, but was getting errors. Here is what I get: > install.packages("GGally") Installing package(s) into ‘/Users/ts2w/Library/R/2.15/library’ (as ‘lib’ is unspecified) Warning in install.packages :   package ‘GGally’ is not available (for R

Re: [R] Combining CSV data

2013-06-12 Thread arun
HI Shreya, #Looks like you run the two line code as a single line. result3<- data.frame(result2[,-5],read.table(text=as.character(result2$comment),sep="|",fill=TRUE,na.strings=""),stringsAsFactors=FALSE) colnames(result3)[5:7]<- paste0("DataComment",1:3)  result3 #  Row_ID_CR D

Re: [R] Combining CSV data

2013-06-12 Thread Shreya Rawal
Ah that makes sense. This looks perfect now. Thanks for your help on this! On Wed, Jun 12, 2013 at 9:10 AM, arun wrote: > HI Shreya, > #Looks like you run the two line code as a single line. > > result3<- > > data.frame(result2[,-5],read.table(text=as.character(result2$comment),sep="|",fill=TR

Re: [R] survreg with measurement uncertainties

2013-06-12 Thread Andrews, Chris
survreg allows interval censored data, if that is how you want to represent measurement uncertainty. See ?Surv -Original Message- From: Kyle Penner [mailto:kpen...@as.arizona.edu] Sent: Tuesday, June 11, 2013 8:02 PM To: r-help@r-project.org Subject: [R] survreg with measurement uncert

Re: [R] help using code

2013-06-12 Thread John Kane
Have a look at http://www.burns-stat.com/documents/tutorials/impatient-r/ . I think the section on blank screen syndrome may help. John Kane Kingston ON Canada > -Original Message- > From: montana3...@gmail.com > Sent: Tue, 11 Jun 2013 16:59:34 -0700 > To: ruipbarra...@sapo.pt > Subject

Re: [R] survreg with measurement uncertainties

2013-06-12 Thread Terry Therneau
I will assume that you are talking about uncertainty in the response. Then one simple way to fit the model is to use case weights that are proprional to 1/variance, along with +cluster(id) in the model statement to get a correct variance for this case. In linear models this would be called the

Re: [R] ggpairs in GGally replaces plotmatrix in ggplot2

2013-06-12 Thread John Kane
Thanks, I obviously read the help incorrectly. It does give the same results as plotmatrix(dat1) I take back "some" of the nasty thoughts I was thinking about ggpairs(). Any idea of the problem with RSudio? Keith notices the same speed difference (but no crash) on a Mac while I'm runnng Ubuntu

Re: [R] Add a column to a dataframe based on multiple other column values

2013-06-12 Thread arun
HI, You could also try: dat2<- dat1[-ncol(dat1)] fun1<- function(dat,value){     datNew<- dat     n1<- ncol(datNew)     indx1<- seq(1,n1,by=2)     indx2<- indx1+1     datNew[indx2][datNew[indx1]< value]<-NA     dat$output<-rowMeans(datNew[indx2],na.rm=TRUE)     dat     }     fun1(dat2,10)  # x1  y

[R] Windows R_LIBS_USER confusion under R-3.0.1

2013-06-12 Thread Paul Johnson
I would appreciate ideas about MS Windows install issues. I'm at our stats summer camp and have been looking at a lot of Windows R installs and there are some wrinkles about R_LIBS_USER. On a clean Win7 or Win8 system, with R-3.0.1, we see the user library for packages defaulting to $HOME/R/win-l

Re: [R] assigning global columns selection for all subset functions in script

2013-06-12 Thread bcrombie
Thanks very much, John. This is very helpful. Burnette From: John Kane [via R] [mailto:ml-node+s789695n4669297...@n4.nabble.com] Sent: Tuesday, June 11, 2013 5:35 PM To: Crombie, Burnette N Subject: Re: assigning global columns selection for all subset functions in script index the columns to

Re: [R] [R-SIG-Mac] problem with the installation of r commander on a mac

2013-06-12 Thread Susanne.Ettinger
Dear all, I am trying to install R and the Rcmdr package on a MacOSX 10.8.4. It appears that I keep getting the error message "Erreur : le chargement du package ou de l'espace de noms a échoué pour 'Rcmdr'" no matter what my approach is. Even downloading XQuartz-2.7.4 did not help. I found the

[R] Permutation test for GLM with proportional data

2013-06-12 Thread Kota Hattori
Dear all, I am trying to run permutation tests for GLM using the glmperm package. When I created my model, I followed The R book and Mixed effects models and extensions in ecology with R. In both books, response variables were specified by using cbind(). That is, response variable is in a matri

Re: [R] assigning global columns selection for all subset functions in script

2013-06-12 Thread bcrombie
Thanks, David. I appreciate your help. Your solution is the idea I also had but wasn't quite sure if it was allowed in this case. That's a simple fix. Burnette From: David Winsemius [via R] [mailto:ml-node+s789695n4669295...@n4.nabble.com] Sent: Tuesday, June 11, 2013 5:31 PM To: Crombie, Bur

Re: [R] odds ratio per standard deviation

2013-06-12 Thread Greg Snow
Without context this is a shot in the dark, but my guess is this is referring to something like a logistic regression where the odds ratio (exponential of the coefficient) refers to the change in odds for the outcome for a 1 unit change in x. Now often a 1 unit change in x is very meaningful, but

[R] Fw: Hi, can you supply tablet pc?

2013-06-12 Thread lv
Hi, Kejora here. I didn't get your reply. Tq, Kejora --- From: l...@asquote.com To: r-h...@stat.math.ethz.ch Date: 2013-06-07 Subject: Hi, can you supply tablet pc? Hi. Kejora here. I find you on google. Aere you doing distributing business? We hav

[R] Proper way to implement package internal functions

2013-06-12 Thread Bryan Hanson
[previously posted on Stack Overflow: http://stackoverflow.com/questions/17034309/hiding-undocumented-functions-in-a-package-use-of-function-name ] I've got some functions I need to make available in a package, and I don't want to export them or write much documentation for them. I'd just hide

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Duncan Murdoch
On 12/06/2013 10:44 AM, Bryan Hanson wrote: [previously posted on Stack Overflow: http://stackoverflow.com/questions/17034309/hiding-undocumented-functions-in-a-package-use-of-function-name ] I've got some functions I need to make available in a package, and I don't want to export them or wri

Re: [R] [R-SIG-Mac] problem with the installation of r commander on a mac

2013-06-12 Thread John Fox
Dear Susanne, Installation instructions for the Rcmdr are at , but you've apparently done what you normally need to do to get it to work. Though you don't say so, I assume that you have the latest versions of R (3.0.1) and

Re: [R] simulation from truncated skew normal

2013-06-12 Thread Mikhail Umorin
I am not aware of any such command so, I think, you may have to write one yourself: invert the CDF and use uniform random variable (runif) to sample Mikhail On Tuesday, June 11, 2013 16:18:59 cassie jones wrote: > Hello R-users, > > I am trying to simulate from truncated skew normal distributi

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Bryan Hanson
Thanks Duncan... Silly me, it's section 1.6.1 not version 1.6.1! So this warning from check is not a problem in the long run: * checking for missing documentation entries ... WARNING Undocumented code objects: ‘ang0to2pi’ ‘dAB’ ‘doBoxesIntersect’ ... All user-level objects in a package should

Re: [R] How to get a running mean result by R?

2013-06-12 Thread William Dunlap
Look at the filter() function. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Jie Tang > Sent: Wednesday, June 12, 2013 12:21 AM > To: r-help@r-project.org > Subject:

Re: [R] odds ratio per standard deviation

2013-06-12 Thread Ted Harding
[Replies transposed so as to achieve bottom-posting ... ] On 12-Jun-2013 14:53:02 Greg Snow wrote: > > On Tue, Jun 11, 2013 at 7:38 PM, vinhnguyen04x wrote: > >> Hi all >> i have a question: >> >> why and when do we use odds ratio per standard deviation instead of odds >> ratio? >> -- >> View t

Re: [R] agnes() in package cluster on R 2.14.1 and R 3.0.1

2013-06-12 Thread Hugo Varet
Dear Martin, Thank you for your answer. I got the dist.binary() function in the ade4 package. It gives several distances for binary data. I agree with you, some individuals probably share the same profile in my data. Regards, Hugo [[alternative HTML version deleted]] _

[R] Default colors for barplot() XXXX

2013-06-12 Thread Dan Abner
Hi everyone, I have the following call to the barplot() function which produces the desired stacked bar chart. HOWEVER, barplot() chooses 4 different shades of gray for the stacks. If I want to use the legend=NULL argument in combination with a separate call to legend() to customize the legend, ho

[R] Functions within functions - environments

2013-06-12 Thread Rik Verdonck
Dear list, I have a problem with nested functions and I don't manage to get it solved. I know I should be looking in environments, and I have tried a lot, but it keeps on erroring. An easy version of the problem is as follows: innerfunction<-function() { print(paste(a, " from inner functi

[R] How to cast a numeric argument to a two-dimensional array in an inline C function?

2013-06-12 Thread Mikhail Umorin
Hello -- For convenience, I would like to use a two dimensional array inside an inline C function. However, any numeric array in R is passed to C code as double *. So, how can I cast a (double *) to a double[][]? thank you for your time, Mikhail [[alternative HTML version deleted]]

Re: [R] Functions within functions - environments

2013-06-12 Thread Rui Barradas
Hello, See the help page for parent.frame, and use its argument to go back to the frames of variables 'a' and 'b': innerfunction<-function() { env1 <- parent.frame(1) # for 'b' env2 <- parent.frame(2) # for 'a' print(paste(env2$a, " from inner function")) print(paste(env1$b,

Re: [R] Default colors for barplot() XXXX

2013-06-12 Thread Marc Schwartz
On Jun 12, 2013, at 12:37 PM, Dan Abner wrote: > Hi everyone, > > I have the following call to the barplot() function which produces the > desired stacked bar chart. HOWEVER, barplot() chooses 4 different shades of > gray for the stacks. If I want to use the legend=NULL argument in > combination

Re: [R] Functions within functions - environments

2013-06-12 Thread William Dunlap
A function looks up free variables in the environment in which the function was defined, not in the environment in which the function was called. The latter is called something like 'dynamic scoping' and usually leads to trouble, the former is 'lexical scoping' and leads to predictable results. Y

[R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Bryan Hanson
grDevices::convertColor has arguments 'from' and 'to' which can take on value 'XYZ'. Can someone confirm that 'XYZ' is the same as the CIE chromaticity coordinates that are also sometimes refered to as 'xyY' in the literature? Or are these the CIE tristimulus values? It looks to me like the f

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Duncan Murdoch
On 12/06/2013 2:45 PM, Bryan Hanson wrote: grDevices::convertColor has arguments 'from' and 'to' which can take on value 'XYZ'. Can someone confirm that 'XYZ' is the same as the CIE chromaticity coordinates that are also sometimes refered to as 'xyY' in the literature? Or are these the CIE t

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Ken Knonlauch
Bryan Hanson depauw.edu> writes: > > grDevices::convertColor has arguments 'from' and 'to' which can take on value 'XYZ'. Can someone confirm > that 'XYZ' is the same as the CIE chromaticity coordinates are also sometimes refered to as 'xyY' in > the literature? Or are these the CIE trist

[R] Fetching and Saving warnings from a function

2013-06-12 Thread Christofer Bogaso
Hello again, Let say I have following user defined function: Myfn <- function(x) { if (x < 0) { warning("Negative value") } return(x) } Now I want to create some function which will save the Warnings from 'Myfn', so that I can use those warnings later for more analysis. Therefore I was thinking

[R] How to fit the cumulative probability distributive functiion with the gamma distribution?

2013-06-12 Thread Kaptue Tchuente, Armel
Hello everyone, I'm trying to fit the PDF of time series datasets with the gamma distribution. Nonetheless, this isn't possible for several datasets since the gamma distribution can only been used to fit continuous distribution. For instance, gam<-fitdrib(hist<-c(24,7,4,1,2,1,0,0,0,1,0,0),"ga

Re: [R] Fetching and Saving warnings from a function

2013-06-12 Thread William Dunlap
?withCallingHandlers E.g., R> f <- function(expr) { warnings <- character() withCallingHandlers(expr, warning=function(e){ warnings <<- c(warnings, conditionMessage(e)) invokeRestart("muffleWarning") }) warnings } R> f(1:10) character(0) R> f(warning("Hmm"

Re: [R] survreg with measurement uncertainties

2013-06-12 Thread Kyle Penner
Hi Terry, Thanks for your quick reply. I am talking about uncertainty in the response. I have 2 follow up questions: 1) my understanding from the documentation is that 'id' in cluster(id) should be the same when the predictors are not independent. Is this correct? (To be more concrete: my dat

Re: [R] Creating a new var from conditional values in other vars

2013-06-12 Thread arun
Hi, Try this: set.seed(25) dat1<- data.frame(A=sample(1:30,100,replace=TRUE),B=sample(1:35,100,replace=TRUE),C=sample(1:25,100,replace=TRUE)) dat1$pattern<-with(dat1,ifelse(A>20 & B<=2.5 & C<=20,"Normal",ifelse(A <20 & B >2.5 & C >20,"Increased",ifelse(A >=20 & B >2.5 & C <=20,"Low","Other"

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Bryan Hanson
Ken, I followed your suggestion and perhaps I don't understand what to expect from convertColor or maybe I'm not using it correctly. Consider the following tests: D65 <- c(0.3127, 0.329, 0.3583) # D65 chromaticity coordinates X <- D65[1]*D65[3]/D65[2] # conversion per brucelindbloom.com Y <- D6

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Ken Knoblauch
You seem to treating the input values as xyY when they should be XYZ (case matters). So, I would do something like this D65 <- c(0.3127, 0.329, 0.3583) X <- 100 * D65[1] Y <- 100 * D65[2] Z <- 100 * D65[3] XYZ <- data.frame(X = X, Y = Y, Z = Z) convertColor(XYZ, from = "XYZ", to = "sRGB")

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Bryan Hanson
Thank you Ken. 90% of my problem was missing the factor of 100. I was just inputing xyY as a test, I wasn't sure whether the docs were being clear about nomenclature. Speaking thereof, the D65 values used in the example: I thought they were chromaticity coordinates, but apparently they are tr

Re: [R] grDevices::convertColor XYZ space is it really xyY?

2013-06-12 Thread Ken Knoblauch
If they sum to 1 then they are one and the same. Look at how chromaticity coordinates are defined in terms of the tristimulus values. Quoting Bryan Hanson : Thank you Ken. 90% of my problem was missing the factor of 100. I was just inputing xyY as a test, I wasn't sure whether the docs we

Re: [R] [R-SIG-Mac] problem with the installation of r commander on a mac

2013-06-12 Thread John Fox
Dear Susanne, You started this thread on r-help (though R-SIG-Mac would have been more appropriate), and so I'm copying my response to the r-help list. People will find it confusing if the messages are simply kept private. It's not obvious to me exactly what your problem is now. In particular, is

[R] how to maximize the log-likelihood function with EM algorithm

2013-06-12 Thread Anhai Jin
Hi R users, I am trying to fit a Mixed Markov Model and ran into trouble with maximizing the log-likelihood function. I attached my R codes and the problem I have right now is that the maximization may end in some local maximum by specifying different start values. I am thinking if we can impro

[R] Cannot install RPostgreSQL

2013-06-12 Thread Drew
Hello everyone, I am extremely new to R. I have yet to write any complicated code myself, however I have been learning largely by reading code that has already been written. Long story short, I have been running a code that makes use of the RPostgreSQL package for some time now. For some reason I

[R] rewrite script to eliminate constant object reference

2013-06-12 Thread bcrombie
I'm adding a column (region) to a data frame (devUni8), and the (region) column will be populated by a numeric code that is a function of another column (state) in that data frame. See part of the script below. How can I rewrite this so that I could apply the conditions to any data frame without

Re: [R] [R-SIG-Mac] problem with the installation of r commander on a mac

2013-06-12 Thread Milan Bouchet-Valat
Le mercredi 12 juin 2013 à 16:52 -0400, John Fox a écrit : > Dear Susanne, > > You started this thread on r-help (though R-SIG-Mac would have been more > appropriate), and so I'm copying my response to the r-help list. People will > find it confusing if the messages are simply kept private. > > I

Re: [R] rewrite script to eliminate constant object reference

2013-06-12 Thread Greg Snow
If you want an easy way to change the name of the data frame for assignment then you may want a macro. There is an article in the R journal ( http://cran.r-project.org/doc/Rnews/Rnews_2001-3.pdf) on creating macros and there are tools that help with creating macros in the gtools package. Though w

Re: [R] rewrite script to eliminate constant object reference

2013-06-12 Thread Jim Holtman
Check out 'with' and 'within'. Sent from my Verizon Wireless 4G LTE Smartphone Original message From: bcrombie Date: 06/12/2013 16:36 (GMT-05:00) To: r-help@r-project.org Subject: [R] rewrite script to eliminate constant object reference I'm adding a column (region) to

Re: [R] rewrite script to eliminate constant object reference

2013-06-12 Thread Ista Zahn
Hi, Here are some examples using the mtcars dataset that you can modify to work with your data. ## Here is my first try using within. ## Somehow the elements of region that ## should be zero are converted to NA mtcars <- within(mtcars, { region <- 0 region[gear==4&carb==4] <- 1 regio

Re: [R] new data

2013-06-12 Thread arun
Hi, Try this: final3New<-read.table(file="real_data_cecilia.txt",sep="\t") final3New1<-read.csv("real_data_cecilia_new.csv") fun2<-function(dat){         indx<- duplicated(dat)|duplicated(dat,fromLast=TRUE)            dat1<- subset(dat[indx,],dummy==1)         dat2<- dat1[order(dat1$dimension),]

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Rolf Turner
On 13/06/13 03:34, Bryan Hanson wrote: So this warning from check is not a problem in the long run: * checking for missing documentation entries ... WARNING Undocumented code objects: ‘ang0to2pi’ ‘dAB’ ‘doBoxesIntersect’ ... All user-level objects in a package should have documentation

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Michael Weylandt
On Jun 12, 2013, at 16:34, Bryan Hanson wrote: > Thanks Duncan... > > Silly me, it's section 1.6.1 not version 1.6.1! > > So this warning from check is not a problem in the long run: > > * checking for missing documentation entries ... WARNING > Undocumented code objects: > ‘ang0to2pi’ ‘dAB

Re: [R] Creating a new var from conditional values in other vars

2013-06-12 Thread arun
Hi `Bangali`, You can type in the R Console ?with()  ?ifelse() The details and some examples are there. In addition to ?with(), you can use: ?within dat1<-within(dat1,pattern<-ifelse(A>20 & B<=2.5 & C<=20,"Normal",ifelse(A <20 & B >2.5 & C >20,"Increased",ifelse(A >=20 & B >2.5 & C <=20,"Low","

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Bryan Hanson
Hi Rolf... Thanks. I discovered the approach you described by looking at the source for spatstat, which as it turns out does exactly that. I also discovered by testing that if you don't export a pattern, but rather export the specific names, not including the functions one wants to hide, that

[R] identify data points by certain criteria

2013-06-12 Thread Ye Lin
Hey I want to identify data points by criteria, here is an example of my 1min data Time Var1 Var2 00:001 0 00:010 0 00:021 0 00:031 0 00:040 0 00:051 0 00:061 0 00:07

Re: [R] identify data points by certain criteria

2013-06-12 Thread David Winsemius
On Jun 12, 2013, at 5:55 PM, Ye Lin wrote: > Hey I want to identify data points by criteria, here is an example of my > 1min data > > Time Var1 Var2 > 00:001 0 > 00:010 0 > 00:021 0 > 00:031 0 > 00:040

Re: [R] Cannot install RPostgreSQL

2013-06-12 Thread Pascal Oettli
Hello, If you carefully check the error message, it is clearly written: RS-PostgreSQL.h:23:26: fatal error: libpq-fe.h: No such file or directory Some header files are missing. Here is the result of a quick search on the web: "libpq-dev" for Ubuntu. If I may suggest, you should upgrade the ver

Re: [R] odds ratio per standard deviation

2013-06-12 Thread vinhnguyen04x
L. Snow, Ted, Many thanks, I am sorry to made a question without context. I use three parameters of facial temperature, heart rate, and respiratory rate to distinguish infectious patients from healthy subjects. So I use logistic regression to generate a classification model and calculate the odds

Re: [R] identify data points by certain criteria

2013-06-12 Thread arun
Hi, Not clear about the 'Time' column. dat1<- read.table(text=" Time    Var1  Var2 00:00    1  0 00:01    0  0 00:02    1  0 00:03    1  0 00:04    0  0 00:05    1  0 00:06    1  0 00:07    1  0 00:0

[R] Plotting gps coordinates on Shapefile

2013-06-12 Thread L S
Hi, I am new to doing spatial analysis. I am interested in trying many things in R, but one of the first things I would like to do is plot all of my lat, lon points in a csv file within a window defined by a shapefile. I have read in the shape file by doing the following: border <-readShapePoly(

[R] Need help with installing gplots

2013-06-12 Thread Derek Serianni
Hi, I am new to linux so please bear with me. OS is CentOS 5.9 - This cannot be changed I am following a guide given to me to setup a server. I am told to do the following: To Install R: sudo yum install gcc sudo yum install make sudo yum install telnet sudo rpm -Uvh http://download.fedorapr

[R] Lattice different colours for bars

2013-06-12 Thread Andrew McFadden (Andy)
Hi all Perhaps this is torturous methodology. I was trying to use lattice to produce a barchart showing the number positive and negative over time. I wasn't quite sure how create a different colour for values of arbo$Ikeda in the example below ie red for ikeda and green for neg. library(resha

Re: [R] odds ratio per standard deviation

2013-06-12 Thread David Winsemius
On Jun 12, 2013, at 4:58 PM, vinhnguyen04x wrote: > L. Snow, > Ted, > > Many thanks, I am sorry to made a question without context. I use three > parameters of facial temperature, heart rate, and respiratory rate to > distinguish infectious patients from healthy subjects. So I use logistic > reg

Re: [R] Lattice different colours for bars

2013-06-12 Thread David Winsemius
On Jun 12, 2013, at 6:43 PM, Andrew McFadden (Andy) wrote: > Hi all > > Perhaps this is torturous methodology. I was trying to use lattice to produce > a barchart showing the number positive and negative over time. I wasn't quite > sure how create a different colour for values of arbo$Ikeda in

[R] useR! 2013 conference schedule and data analysis contest

2013-06-12 Thread Virgilio Gómez-Rubio
Dear all, This is an announcement that the final schedule for the useR! 2013 conference is available at http://www.r-project.org/useR-2013 . This year we will be having a Data Analysis Contest open to all participants. You can find more information here: http://www.edii.uclm.es/~useR-2013/#conte