[R] calling the function which is stored in a list

2012-02-09 Thread arunkumar1111
Hi I'm storing two functions in a list # creating two function function1 <- function(n) { return(sum(n)) } function2 <- function(n) { return(mean(n)) } #storing the function function3 =c(function1,function2) is it possible to call the stored function and used it ? x=c(10,29) funtion3[

Re: [R] Error in Rd[[which]] : subscript out of bounds

2012-02-09 Thread Uwe Ligges
On 08.02.2012 22:10, Martin Morgan wrote: On 02/08/2012 12:13 PM, Ben Ganzfried wrote: Hi Uwe, Thanks for the help. R version 2.14.0 (2011-10-31). The file in question looks like this (w/ a few minor edits for privacy): There are two 'description' entries; the second might be combined with

Re: [R] dropterm in MANOVA for MLM objects

2012-02-09 Thread Vickie S
Thanks for nice explanation. Unfortunately, matrix in my question is exactly similar to the one I posted earlier : mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140),sep="_"), c("A", "B", "C", "D", "E"))) Question here is which of the 140 characteristics (i.e. f_1...f_140

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/02/12 00:01, Peter Langfelder wrote: > Hi all, in particular package developers, > > I'm exploring using a version control system to keep better track > of changes to the packages I maintain. I'm leaning towards git > (although mercurial also lo

Re: [R] calling the function which is stored in a list

2012-02-09 Thread Uwe Ligges
On 09.02.2012 08:54, arunkumar wrote: Hi I'm storing two functions in a list # creating two function function1<- function(n) { return(sum(n)) } function2<- function(n) { return(mean(n)) } #storing the function function3 =c(function1,function2) is it possible to call the stored

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/02/12 00:33, Tom Roche wrote: > > Peter Langfelder Thu Feb 9 00:01:31 CET 2012 >> I'm exploring using a version control system > > +1! welcome to the new millenium :-) > >> to keep better track of changes to the [R] packages I maintain. >> I'm

[R] width and alignment of Latex table columns

2012-02-09 Thread n.via...@libero.it
Dear all, I'm using xtable package in order to produce Latex table. There is a way to specify not only the alignment but also the width of table colums?? Thanks for your attention. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread baptiste auguie
Once upon a time r-forge had the option to sync from an external svn repository, e.g. hosted on googlecode. I haven't seen it available for some time, sadly. I'm sure many users would appreciate if this feature came back with the new interface. Not sure if it could work with git as well, though. b

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/02/12 10:09, baptiste auguie wrote: > Once upon a time r-forge had the option to sync from an external > svn repository, e.g. hosted on googlecode. I haven't seen it > available for some time, sadly. I'm sure many users would > appreciate if t

Re: [R] fixed effects linear model in R

2012-02-09 Thread Francesco
Dear Andrew, Thanks for your suggestion. I will indeed have a look at Allison's booklet... Best, On 7 February 2012 23:39, Andrew Miles wrote: > Based on Paul Allison's booklet "Fixed Effect Regression Models" (2009), the > FE model can be estimated by person-mean centering all of your variable

Re: [R] Force printing of excluded axis annotations

2012-02-09 Thread Jim Lemon
Justin Fincher wrote: > Howdy, > This should be simple, but I am finding that I can't find a simple > solution. I have a plot to which I am manually adding the annotations > to the y-axis with this command: > > axis(2, c(-4,-3,-2,-1,0,1,2,3,4,5,6,7),labels=c(-4,-3,-2,-1,0,1,2,3,4,5,6,7),cex.

[R] Hotelling T2 test extension for multigroup data

2012-02-09 Thread Vickie S
Hi all, I've got the following matrix :   mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140), sep="_"), c("A", "B", "C", "D", "E"))) I can see that currently most of the multivariate Hotelling T2 tests are limited for application on two groups/samples. I wud appreciate if so

Re: [R] "unsparse" a vector

2012-02-09 Thread Petr Savicky
On Wed, Feb 08, 2012 at 05:01:01PM -0500, Sam Steingold wrote: > loop is too slow. > it appears that sparseMatrix does what I want: > > ll <- lapply(l,length) > i <- rep(1:4, ll) > vv <- unlist(l) > j1 <- as.factor(substring(vv,1,1)) > t <- table(j1) > j <- position of elements of j1 in names(t) >

Re: [R] width and alignment of Latex table columns

2012-02-09 Thread Ista Zahn
Hi, You can set the width of the columns the same way you would in any other LaTeX table, e.g., by setting align to p{width}. http://www.giss.nasa.gov/tools/latex/ltx-68.html has a good summary of LaTeX tables that you may find helpful. Best, Ista On Thursday, February 09, 2012 10:08:32 AM n.

[R] how to exclude rows with not-connected coalitions

2012-02-09 Thread Schumacher, G.
Dear all, I have question but cannot explain without providing some context first: I want to calculate how many policy-connected coalitions between 7 parties are possible. I have positions on an one-dimensional scale for each party and I have sorted the parties on the positions (it is sorted fr

[R] factor level for non-existing value

2012-02-09 Thread David Studer
Hello everybody! Let's assume I have the following factor with it's levels: a<-factor(c(2,3,3,2,4,2,3,2,2,2,3,2,3)) mydata<-data.frame(a) When I plot the vector "a" using barplot(table(mydata$a) unfortunately the value "1" does not show up, as it does not appear in my data. But still, it theor

Re: [R] width and alignment of Latex table columns

2012-02-09 Thread Duncan Mackay
Hi Here is an example with something at hand if you use Sweave. Using Sweave you can embed the R in a chunk and properly format the headers and sometimes the table. the D{.}{.}{4.0} requires the use of \usepackage{dcolumn} \begin{table}[h] \caption[DNO and \rdate]% {DNO and \rdate with row to

Re: [R] factor level for non-existing value

2012-02-09 Thread Petr PIKAL
Hi > > Hello everybody! > > Let's assume I have the following factor with it's levels: > > a<-factor(c(2,3,3,2,4,2,3,2,2,2,3,2,3)) > mydata<-data.frame(a) > > When I plot the vector "a" using > > barplot(table(mydata$a) > > unfortunately the value "1" does not > show up, as it does not appea

[R] Workflow when using git (e.g. github) as SVN repo for package

2012-02-09 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi This question is towards development of packages, but I think it does not fit into R-devel mailing list, so I post it here. I would like to use git as the VCS for my packages, but still be able to use the "magic" of R-forge. I know how to mgrate

Re: [R] how to exclude rows with not-connected coalitions

2012-02-09 Thread Petr Savicky
On Thu, Feb 09, 2012 at 12:18:06PM +, Schumacher, G. wrote: > Dear all, > > I have question but cannot explain without providing some context first: > > I want to calculate how many policy-connected coalitions between 7 parties > are possible. I have positions on an one-dimensional scale for

Re: [R] factor level for non-existing value

2012-02-09 Thread Ista Zahn
Hi David, On Thursday, February 09, 2012 01:21:48 PM David Studer wrote: > Hello everybody! > > Let's assume I have the following factor with it's levels: > > a<-factor(c(2,3,3,2,4,2,3,2,2,2,3,2,3)) > mydata<-data.frame(a) #You need to specify levels and labels here, like this: a <- factor(c(2

Re: [R] search tutorial for function "tt" in cox.zph

2012-02-09 Thread Terry Therneau
> It seems there is a function ?tt? in R which can help to find this > function and integrate it in my Cox model. > I am searching a good tutorial (or book reference) with example(s) to > understand and apply the function ?tt? in R; There is a vignette describing the tt function. Due to an overs

Re: [R] Hotelling T2 test extension for multigroup data

2012-02-09 Thread peter dalgaard
On Feb 9, 2012, at 12:11 , Vickie S wrote: > > Hi all, > I've got the following matrix : > > mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140), > sep="_"), c("A", "B", "C", "D", "E"))) > > I can see that currently most of the multivariate Hotelling T2 tests are > limited

Re: [R] how to exclude rows with not-connected coalitions

2012-02-09 Thread ONKELINX, Thierry
This can be done without nested loops. a <- expand.grid(rep(list(c(0,1)),7)) tmp <- apply(a, 1, function(x){ var(cumsum(x == 0)[x == 1]) }) a[is.na(tmp) | tmp == 0, ] ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwalit

Re: [R] how to exclude rows with not-connected coalitions

2012-02-09 Thread Schumacher, G.
Thanks Thierry and Petr for your solutions. I can continue now (until the next problem arises ;). From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of ONKELINX, Thierry [thierry.onkel...@inbo.be] Sent: Thursday, February 09, 2012

[R] how to pass weka classifier options with a meta classifier in RWeka?

2012-02-09 Thread Kari Ruohonen
Hi, I am trying to replicate a training of AttributeSelectedClassifier with CFsSubsetEval, BestFirst and NaiveBayes that I have initially done with Weka. Now, I am trying to use RWeka in R. I have a problem of passing arguments to the CfsSubsetEval, BestFirst and NaiveBayes. I have first created a

Re: [R] Tr: Re: how to pass weka classifier options with a meta classifier in RWeka?

2012-02-09 Thread Kari Ruohonen
On Thu, 2012-02-09 at 14:52 +0100, Milan Bouchet-Valat wrote: > Le jeudi 09 février 2012 à 15:31 +0200, Kari Ruohonen a écrit : > > > > And then I am trying to run the classifier with: > > > > nb.model<-AS(class~.,data=ex, > > control=Weka_control( > >E="weka.attributeSelect

[R] How to compare optimized models ?

2012-02-09 Thread Diane Bailleul
Good afternoon everybody, I'm using optimization routines like optimix or nlminb to optimize the parameters of my dispersal curves which are "working" with different kernels : /anlb2002z1b <- nlminb(c(0.5,2), objective=LogLiketot,lower=c(0,0), upper=c(1,200))/ where /LogLiketot/ contains my dis

Re: [R] coxme with frailty--variance of random effect?

2012-02-09 Thread Thomas Chadefaux
Thank you very much for taking the time to answer. This pointed me in the right direction. For those interested, I found a useful explanation of the derivation of the estimated variance of the random effect in Hosmer & Lemeshow's Applied Survival Analysis (1999), pp.321-26 (I love your book, Dr. T

Re: [R] Rearanging Data

2012-02-09 Thread David Winsemius
On Feb 8, 2012, at 9:48 PM, kevin123 wrote: Hi, This is only a small portion of the Data i am working on I want to make a subset of this data set( Data Set=Claims) MemberID ProviderID Vendor PCPYear Specialty 1 422869788013252 172193 37796 Y1Surgery 2 979032483316066 7

Re: [R] Hotelling T2 test extension for multigroup data

2012-02-09 Thread Vickie S
Hey Peter, I agree that Hotelling's T test, although technically possible for two groups but rejecting the Ho in this case is not going to convey any meaning. But I am sure there is a possibility. My assumption is based on using simulated reference set for each comparison. -- Vickie

Re: [R] dropterm in MANOVA for MLM objects

2012-02-09 Thread John Fox
Dear Vickie, No one will be able to wave a magic wand over your data to allow you to usefully estimate linear models with 0 df for error, and you certainly can't perform statistical tests. As Peter Dalgaard pointed out, the same confusion was reflected in your subsequent question about Hotellin

Re: [R] dropterm in MANOVA for MLM objects

2012-02-09 Thread Vickie S
Anywez, I have figured out a solution. Whether it is a magic wand or something else, that I don't know but I wish it would work. Thx for the critical stand. -- Vickie > From: j...@mcmaster.ca > Subject: Re: [R] dropterm in MANOVA for MLM objects > T

[R] Question about measurment invariance in a multigroup SEM

2012-02-09 Thread Paul Miller
Hello All, I have a question about measurement invariance in a multigroup SEM. I am of the impression that one cannot test the equality of structural paths across groups without demonstrating measurement invariance of latent factors first. At a minimum, this would involve demonstrating that cor

[R] February-March 2012 ***R/S-PLUS Courses***by XLSolutions Corp at 9 USA locations

2012-02-09 Thread s...@xlsolutions-corp.com
Happy New Year ! XLSolutions February-March 2012 R/S-PLUS courses schedule is now available online at 9 USA cities for with 13 new courses: *** Suggest a future course date/city (1) R-PLUS: A Point-and-Click Approach to R (2) S-PLUS / R : Programming Essentials. (3) R/S+ Fundamentals and Programm

Re: [R] Any R course in New York or Washington DC in March?

2012-02-09 Thread s...@xlsolutions-corp.com
Good day Eugene and R-useRs ! We have a few course coming up in New York City and Washington DC during the week of March 11th, 2012. http://www.xlsolutions-corp.com/rplus.asp R Rocks ! Sue From: eugene dalt To: "r-help@r-project.org" Sent: Monday, February 6, 2012 11:57 AM Subject: [R

[R] Java heap space Error while reading table from postgres database using RJDBC

2012-02-09 Thread aajit75
Hi List, I am reading table from postgres database into R session using RJDBC, table contains 150 columns and 20 rows. Sample code is as below, which works fine with smaller tables. db_driver <- mydir$db_driver db_jar_fi

Re: [R] calling the function which is stored in a list

2012-02-09 Thread arunkumar1111
Thanks it works - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/calling-the-function-which-is-stored-in-a-list-tp4372131p4372557.html Sent from the R help mailing list archive at Nabble.com. __ R-help

[R] ifelse

2012-02-09 Thread Arnaud Gaboury
Hello, I need to print a screen message after a test. >list<-c("10","1","100","10") >ifelse(all(list %in% c(1,10,100)==TRUE),cat("YES\n"),cat("NO\n")) YES Error in ifelse(all(l %in% c(1, 10, 100) == TRUE), cat("YES\n"), cat("NO\n")) : replacement has length zero I have the correct answer, YE

[R] generate matrices

2012-02-09 Thread Blaz Simcic
Dear all, I would like to generate 500 matrices of 20 numbers from standard normal distribution with names x1,x2,x3,….x500.   I tried with loop for, but I don’t know how to name matices : for (i in 1:500)  {    x[[i]] <- matrix(rnorm(20), 4)     } Any suggestion? Thanks,  Blaž

Re: [R] fixed effects with clustered standard errors

2012-02-09 Thread John L
Dear Giovanni, Many thanks for your interesting suggestions. Your guess is indeed right, I only use the 'within' fixed effects specification. I will soon send to this list all the additional information you requested in order to understand what might cause this problem, but I would say as a first

[R] Row-wise kronecker product with Matrix package

2012-02-09 Thread Ally
I'm trying to calculate the row-wise kronecker product A \Box B of two sparse matrices A and B, and am struggling to find a quick way to do this that takes advantage of sparseness. I thought a good idea would be to use "rep" to construct 2 matrices of the same dimension of the end product, and m

[R] Cumulative R2 and Q2 values?

2012-02-09 Thread Charles Determan Jr
Greetings R users, I have been working on running plsda and I would like to have the R2 and Q2 values. I know the function R2 from the 'pls' package will generate both R2 and Q2 but they are for each separate class. Is there a way to get the cumulative R2 and Q2 for the whole model? R2(pls.new,

Re: [R] computing scores from a factor analysis

2012-02-09 Thread francesca
William, I had a problem similar to Wolfgang and I solved it through your help. Many thanks! Just an observation which sounded strange to me ( I am not a statistician, just a wildlife biologist) I have noticed that running the pca using principal with raw data (and therefore using scores=TRUE i

[R] Subset a datafram according to time

2012-02-09 Thread NickNz125
PREFERED WAY OF DOING IT I have a data set of observations every second for a month long period, I want to extract the observations according to the date & time of another data frame ( the other data frame is in the same format). I want to do this to match these observations to my test observa

Re: [R] generate matrices

2012-02-09 Thread Jorge I Velez
What about this? B <- 500 X <- matrix(rnorm(B*20), ncol = B) colnames(X) <- paste('x', 1:B, sep = "") head(X) Thus, each column correspond to a sample of 20 numbers from a standard normal distribution. HTH, Jorge.- On Thu, Feb 9, 2012 at 8:38 AM, Blaz Simcic <> wrote: > Dear all, > I would li

[R] Outlier removal techniques

2012-02-09 Thread mails
Hello, I need to analyse a data matrix with dimensions of 30x100. Before analysing the data there is, however, a need to remove outliers from the data. I read quite a lot about outlier removal already and I think the most common technique for that seems to be Principal Component Analysis (PCA). H

[R] poLCA and conditional dependence

2012-02-09 Thread Suranga Kasthurirathne
Dear all, I'm an Sri Lankan undergraduate student. I'm also a total newbie to R. My aim is to use the poLCA package to do a latent class analysis. I found the documentation very helpful, but need to make a small clarification that has stumped me awhile. In my work, I need to make provision for c

[R] GLM - guess the distribution of the response variable

2012-02-09 Thread wonko
Dear all, I have question regarding GLMs: I have a discrete response variable and a continuous explaining variable. Like this: http://www.myimg.de/?img=example1db0f.jpg I want to use a GLM to investigate. I have to specify the "familiy of the distribution of the response variable" - or, maybe

[R] Arial font in eps figures in R

2012-02-09 Thread Sharon Kuhlmann-B
Hi, I am trying to create a graph using Arial font (as required by PLoS One). I have read probably all posts in R-help on this topic, as wells as R-news 2006. The code I have been trying is following: Arial <- Type1Font(family="Arial", metrics=c("ArialMT.afm", "arial-BoldMT.afm"

Re: [R] package does not have a NAMESPACE

2012-02-09 Thread Reinker, Stefan
A new version of the kopls package has been made available. This installs without problems in R 2.14 (windows 32-bit). Download from here: https://sourceforge.net/projects/kopls/files/K-OPLS%20for%20R/1.1.2/ [[alternative HTML version deleted]] ___

[R] subset select="variable with a list of names"

2012-02-09 Thread Francisco
Hello, I would like to make a function which extracts a subset, from a dataset, with only the columns that I want (specifying their names). For example, having this matrix: > mydata<-matrix(c(22,1,3,2001,24,5,7,2002,26,7,8,2002,28,5,7,2003), byrow=TRUE, ncol=4, dimnames=list(c(1,2,3,4), c("ag

[R] sample points - sp package

2012-02-09 Thread anaraster
When I make a sample in sp, for example a random samping of 5 points in dataset1: sample.dataset1=spsample(dataset1, n = 5, "random") I have a sp object for the selected sampling... My question is : How can I extract from dataset2 the points & data for the coordinates(sample.dataset1) ? The da

[R] which R package is used for browsing web pages through coding

2012-02-09 Thread sagarnikam123
i know RCurl pakage to retrieve web content,it has limited use, i want interactive package like (in perl--->Mechanize, In java--->Watij,Prowser,HTMLunit,HTTPunit, in Ruby>Watir ,etc) this modules/packages opens appropriate browser,which can create queries,retrieves output, clicks buttons, fil

[R] Help with TimeSeries

2012-02-09 Thread Vinicius Magalhães
Hello everyone! I´ve started using R last week and I´m having really persistent problems trying to make predictions using the HoltWinters function. I´m sending my script and the errors I´m getting. My data is: Jan Feb Mar Apr May Jun Jul Ago Sep Oct Nov Dec 2004 118 143 169

[R] Tr: Re: how to pass weka classifier options with a meta classifier in RWeka?

2012-02-09 Thread Milan Bouchet-Valat
Le jeudi 09 février 2012 à 15:31 +0200, Kari Ruohonen a écrit : > Hi, > I am trying to replicate a training of AttributeSelectedClassifier with > CFsSubsetEval, BestFirst and NaiveBayes that I have initially done with > Weka. Now, I am trying to use RWeka in R. > > I have a problem of passing argu

[R] Weibull Distribution

2012-02-09 Thread Yogendra
Hi, I want to estimate parameter of weibull distribution using mle for below density function, The PDF is, f(x) = b a^-b x^(b-1) exp -(x/a)^b In R ,density of the weibull distribution is, f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a) which is different from my density, I trying to estimate mle par

[R] how to specify the Oy axis length

2012-02-09 Thread ikuzar
Hi, I'd like to plot a point: plot(1,2) I use RStudio. I'd like to know how to specify the length of Oy axis. I 'd like to put 20 as length of Oy but , by default, I 've got 2.5. Thanks for your help -- View this message in context: http://r.789695.n4.nabble.com/how-to-specify-the-Oy-axis-len

[R] problem with arrows( )

2012-02-09 Thread ikuzar
Hello, I have got an issue with this code: plot(...) xMontant = as.POSIXlt(ecs$startAt[i]) xDescendant = as.POSIXlt(ecs$endAt[i]) arrows(xMontant, 0, xMontant, ecsPOW, col="green") Here is the error: "Erreur dans arrows(xMontant, 0, xMontant, ecsPOW, col = "green") : premier argument incorr

[R] AUC, C-index and p-value of Wilcoxon

2012-02-09 Thread linda Porz
Dear all, I am using the ROCR library to compute the AUC and also the Hmisc library to compute the C-index of a predictor and a group variable. The results of AUC and C-index are similar and give a value of about 0.57. The Wilcoxon p-value is <0.001! Why the AUC is showing small value and the p-va

Re: [R] Weibull Distribution

2012-02-09 Thread Rui Barradas
Hello, > > I want to estimate parameter of weibull distribution using mle for below > density function, > The PDF is, > f(x) = b a^-b x^(b-1) exp -(x/a)^b > > In R ,density of the weibull distribution is, > f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a) > > which is different from my density, > Is

[R] Some question about "rpart" and splitting criterion

2012-02-09 Thread Myriam Tabasso
Dear All, I have questions about the function "rpart" to construct a regression tree in R code. My problem is how to change the splitting criteria. In the "rpart" we have : parms=list(split="..") , I ask you if in this command is it possible to use an another splitting criterion to substitu

Re: [R] problem with arrows( )

2012-02-09 Thread ikuzar
I found the issue: arrows( ) , segments( ) do not accept argument of type POSIXlt. One must convert the argument into POSIXct and it works well. -- View this message in context: http://r.789695.n4.nabble.com/problem-with-arrows-tp4373152p4373422.html Sent from the R help mailing list archive at

Re: [R] ifelse

2012-02-09 Thread R. Michael Weylandt
cat() returns a null value so it's problematic inside ifelse. Here you probably need a regular if statement: if(all(list %in% c(1, 10, 100))) cat("YES\n") else cat("NO\n") # The == TRUE is redundant. Michael On Thu, Feb 9, 2012 at 11:37 AM, Arnaud Gaboury wrote: > Hello, > > I need to print a s

Re: [R] calling the function which is stored in a list

2012-02-09 Thread Gabor Grothendieck
On Thu, Feb 9, 2012 at 2:54 AM, arunkumar wrote: > Hi > > I'm storing two functions in a list > > # creating two function >  function1 <- function(n) { >  return(sum(n)) > } > > function2 <- function(n) { >  return(mean(n)) > } > > #storing the function > function3 =c(function1,function2) > >

Re: [R] ifelse

2012-02-09 Thread Arnaud Gaboury
TY much. Works for me. Arnaud Gaboury   A2CT2 Ltd. -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: jeudi 9 février 2012 17:47 To: Arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] ifelse cat() returns a null value so it's problematic insid

Re: [R] ifelse

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 11:37 AM, Arnaud Gaboury wrote: Hello, I need to print a screen message after a test. list<-c("10","1","100","10") ifelse(all(list %in% c(1,10,100)==TRUE),cat("YES\n"),cat("NO\n")) YES Error in ifelse(all(l %in% c(1, 10, 100) == TRUE), cat("YES\n"), cat("NO\n")) : rep

Re: [R] Outlier removal techniques

2012-02-09 Thread Rich Shepard
On Thu, 9 Feb 2012, mails wrote: I need to analyse a data matrix with dimensions of 30x100. Before analysing the data there is, however, a need to remove outliers from the data. I read quite a lot about outlier removal already and I think the most common technique for that seems to be Principal

Re: [R] generate matrices

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 8:38 AM, Blaz Simcic wrote: Dear all, I would like to generate 500 matrices of 20 numbers from standard normal distribution with names x1,x2,x3,….x500. I tried with loop for, but I don’t know how to name matices : for (i in 1:500) { x[[i]] <- matrix(rnorm(20), 4) } An

Re: [R] how to specify the Oy axis length

2012-02-09 Thread R. Michael Weylandt
Perhaps the ylim argument to plot() Michael On Thu, Feb 9, 2012 at 9:04 AM, ikuzar wrote: > Hi, > > I'd like to plot a point: plot(1,2) > I use RStudio. > I'd like to know how to specify the length of Oy axis. I 'd like to put 20 > as length of Oy but , by default, I 've got 2.5. > > Thanks for

Re: [R] GLM - guess the distribution of the response variable

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 7:32 AM, wo...@posteo.de wrote: Dear all, I have question regarding GLMs: I have a discrete response variable and a continuous explaining variable. Like this: http://www.myimg.de/?img=example1db0f.jpg I want to use a GLM to investigate. I have to specify the "familiy o

Re: [R] Wriritng to a CSV file

2012-02-09 Thread peter dalgaard
On Feb 8, 2012, at 21:56 , David Winsemius wrote: > > On Feb 8, 2012, at 2:29 PM, Ron Michael wrote: > >> Okay, so I understood that appending can only happen row-wise. Therefore I >> tried with following code: >> >>> write.csv(matrix(1:5, 1), "dat.csv") >>> write.csv(matrix(1:5, 1), "dat.csv

Re: [R] subset select="variable with a list of names"

2012-02-09 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Francisco > Sent: Thursday, February 09, 2012 4:52 AM > To: r-help@r-project.org > Subject: [R] subset select="variable with a list of names" > > Hello, > I would like to make a

Re: [R] Outlier removal techniques

2012-02-09 Thread Frank Harrell
I wonder why it is still standard practice in some circles to search for "outliers" as opposed to using robust/resistent methods. Here is a great paper with a scientific approach to "outliers": @Article{fin06cal, author = {Finney, David J.}, title ={Calibration

Re: [R] AUC, C-index and p-value of Wilcoxon

2012-02-09 Thread Petr Savicky
On Thu, Feb 09, 2012 at 02:05:08PM +, linda Porz wrote: > Dear all, > > I am using the ROCR library to compute the AUC and also the Hmisc library > to compute the C-index of a predictor and a group variable. The results of > AUC and C-index are similar and give a value of about 0.57. The Wilco

[R] object size versus saved size?

2012-02-09 Thread luckjiff
Posting under new subject. I’ve a question on saving a earth object to disk. Say m is the model then print(object.size(m), units=”Mb”) 163.8 Mb and save it off save(m, “tmp.rda”) and “tmp.rda” is roughly 171Mb file. I would like this to be much smaller. So I try m$bx<-NULL then print(object.size(

[R] Grouping together a time variable

2012-02-09 Thread Abraham Mathew
I have the following variable, time, which is a character variable and it's structured as follows. > head(as.character(dat$time), 30) [1] "00:00:01" "00:00:16" "00:00:24" > "00:00:25" "00:00:25" "00:00:40" "00:01:50" "00:01:54" "00:02:33" "00:02:43" > "00:03:22" [12] "00:03:31" "00:03:41" "00:03

Re: [R] Rearanging Data

2012-02-09 Thread Kevin Corry
Hi, This worked great: sub <- subset(Claims, Year=="Y1") Thanks for your help Kevin On Thu, Feb 9, 2012 at 6:12 AM, David Winsemius wrote: > > On Feb 8, 2012, at 9:48 PM, kevin123 wrote: > > Hi, >> >> This is only a small portion of the Data i am working on >> I want to make a subset of this

[R] To write a function for getting the node numbers in "rpart" analysis..

2012-02-09 Thread Yashwanth M.R
## To read .csv file(data) and performing "rpart" ## # library(Hmisc) library(rpart) read.csv("D:/Training/RRE/Revolution(My Projects)/Project1/RProject(pmml from SPSS)/telco_churn.csv", header = TRUE, sep = ",", quote="\"", dec=".") # help(read.csv) Telco<- read.table(file = "D:/Training/RRE/Revo

Re: [R] Row-wise kronecker product with Matrix package

2012-02-09 Thread ilai
Maybe one of these will improve: >help.search('kronecker') ... spam::kronecker Kronecker Products on Sparse Matrices spam::spam.classClass "spam" base::kronecker Kronecker Products on Arrays Matrix::kronecker-methods Methods for Function 'kronecker()'

Re: [R] GLM - guess the distribution of the response variable

2012-02-09 Thread Bert Gunter
Below. -- Bert On Thu, Feb 9, 2012 at 9:06 AM, David Winsemius wrote: > > On Feb 9, 2012, at 7:32 AM, wo...@posteo.de wrote: > >> Dear all, >> >> I have question regarding GLMs: >> I have a discrete response variable and a continuous explaining variable. >> Like this: >> http://www.myimg.de/?img=

[R] loading packages in a function

2012-02-09 Thread Arnaud Gaboury
Hello, I sourced successfully my function(). I need to load libraries, so I wrote this inside my function(): function() { #load needed library library(plyr) library(car) /... } It is OK, but I have this on my invite command when running the function: > function() Loading required packa

Re: [R] Setting up infile for R CMD BATCH

2012-02-09 Thread Gang Chen
Hi Elai, yes, the approach works out pretty well. Thanks a lot for spending time on this and for the great help! Gang On Wed, Feb 8, 2012 at 5:43 PM, ilai wrote: > I'm going to declare this SOLVED. Yes, if you don't want a separate > script for batch, you will need to modify the original script

Re: [R] Outlier removal techniques

2012-02-09 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frank Harrell > Sent: Thursday, February 09, 2012 9:19 AM > To: r-help@r-project.org > Subject: Re: [R] Outlier removal techniques > > I wonder why it is still standard practice

[R] fill an array by rows

2012-02-09 Thread Jim Maas
I've dug around but not been able to find anything, am probably missing something obvious. How can I fill a three-dimensional (or higher dimension) array by rows instead of columns. eg new1 <- array(c(1:125), c(5,5,5)) works fine for me but fills it by columns and new2 <- array(c(1:125), c

Re: [R] generate matrices

2012-02-09 Thread Bert Gunter
Inline below. -- Bert On Thu, Feb 9, 2012 at 8:59 AM, David Winsemius wrote: > > On Feb 9, 2012, at 8:38 AM, Blaz Simcic wrote: > >> Dear all, >> I would like to generate 500 matrices of 20 numbers from >> standard normal distribution with names x1,x2,x3,….x500. >> I tried with loop for, but I d

Re: [R] fill an array by rows

2012-02-09 Thread William Dunlap
Use aperm on the output of array: > aperm(array(1:8, dim=c(2,2,2)), perm=c(2,1,3)) , , 1 [,1] [,2] [1,]12 [2,]34 , , 2 [,1] [,2] [1,]56 [2,]78 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > Fr

Re: [R] fill an array by rows

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 12:47 PM, Jim Maas wrote: I've dug around but not been able to find anything, am probably missing something obvious. How can I fill a three-dimensional (or higher dimension) array by rows instead of columns. eg new1 <- array(c(1:125), c(5,5,5)) works fine for me but

[R] complex subscript/superscript on axis labels

2012-02-09 Thread Eileen Meyer
Hi All, I am having trouble getting a complex subscript to work. I'm sure it's possible. Here is what I have: ylab=expression(paste("log ",L[peak]," [erg ",s^{-1},"]")), I would like to have the subscript read "peak,gamma" where the gamma would be the greek symbol. I do want the comma

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Peter Langfelder
On Thu, Feb 9, 2012 at 1:46 AM, Gregory Jefferis wrote: > Dear Peter, > > Trying to respond to your original question Thanks for staying on thread :) > > > I have a git repositiory in the root of my packages: > > ie > > package-foo/.git > package-foo/R > package-foo/inst > > Running make check

Re: [R] complex subscript/superscript on axis labels

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 12:53 PM, Eileen Meyer wrote: Hi All, I am having trouble getting a complex subscript to work. I'm sure it's possible. Here is what I have: ylab=expression(paste("log ",L[peak]," [erg ",s^{-1},"]")), I would like to have the subscript read "peak,gamma" where the gam

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Hadley Wickham
> Same warning here. Which made me think that R CMD build will probably > tar up the git repository along with the package, which is not > something I would like to do, and which CRAN people most likely won't > tolerate in a package on CRAN. It doesn't. And you can always use .Rbuildignore to ign

Re: [R] loading packages in a function

2012-02-09 Thread R. Michael Weylandt
Perhaps the longest function in base R I know of: suppressPackageStartupMessages e.g., suppressPackageStartupMessages(library(zoo)) Michael On Thu, Feb 9, 2012 at 12:44 PM, Arnaud Gaboury wrote: > Hello, > > I sourced successfully my function(). > > I need to load libraries, so I wrote this i

Re: [R] complex subscript/superscript on axis labels

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 1:20 PM, David Winsemius wrote: On Feb 9, 2012, at 12:53 PM, Eileen Meyer wrote: Hi All, I am having trouble getting a complex subscript to work. I'm sure it's possible. Here is what I have: ylab=expression(paste("log ",L[peak]," [erg ",s^{-1},"]")), I would like

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Hadley Wickham
>> I'm exploring using a version control system to keep better track >> of changes to the packages I maintain. I'm leaning towards git >> (although mercurial also looks good) but am not sure what is the >> best way to set up the repository. It seems I can't set the >> repository directly within the

Re: [R] Grouping together a time variable

2012-02-09 Thread R. Michael Weylandt
Perhaps cut.POSIXt (which is a generic so you can just call cut) depending on the unstated form of your time object. Michael On Thu, Feb 9, 2012 at 12:15 PM, Abraham Mathew wrote: > I have the following variable, time, which is a character variable and it's > structured as follows. > >> head(as.

Re: [R] Rearanging Data

2012-02-09 Thread Phil Spector
Try sub <- subset(Claims, Year==Y1) In R, the equality test is performed by two equal signs, not one. - Phil Spector Statistical Computing Facility Department of Statistic

Re: [R] AUC, C-index and p-value of Wilcoxon

2012-02-09 Thread Petr Savicky
On Thu, Feb 09, 2012 at 06:33:09PM +0100, Petr Savicky wrote: > On Thu, Feb 09, 2012 at 02:05:08PM +, linda Porz wrote: > > Dear all, > > > > I am using the ROCR library to compute the AUC and also the Hmisc library > > to compute the C-index of a predictor and a group variable. The results of

Re: [R] loading packages in a function

2012-02-09 Thread Arnaud Gaboury
TY for your answer, but here what i did : #load needed lybrary suppressPackageStartupMessages(library(plyr)) suppressPackageStartupMessages(library(car)) library(plyr) library(car) But I still get : Loading required package: MASS Loading required package: nnet Arnaud Gaboury   A2CT2 Ltd. --

Re: [R] Arial font in eps figures in R

2012-02-09 Thread David L Carlson
So close. The first version should work if you switch the order of the postscript() and par() functions: Arial <- Type1Font(family="Arial", metrics=c("ArialMT.afm", "arial-BoldMT.afm", "Arial-ItalicMT.afm", "Arial-BoldItalicMT.afm")) postscriptFonts(Arial=Arial) par(family="Arial") postscrip

  1   2   >