Re: [R] Lasso with Categorical Variables

2011-05-02 Thread Nick Sabbe
For performance reasons, I advise on using the following function instead of model.matrix: factorsToDummyVariables<-function(dfr, betweenColAndLevel="") { nc<-dim(dfr)[2] firstRow<-dfr[1,] coln<-colnames(dfr) retval<-do.call(cbind, lapply(seq(nc), function(ci){

[R] Bootstrapping confidence intervals

2011-05-02 Thread khosoda
Hi, Sorry for repeated question. I performed logistic regression using lrm and penalized it with pentrace function. I wanted to get confidence intervals of odds ratio of each predictor and summary(MyModel) gave them. I also tried to get bootstrapping standard errors in the logistic regression. boo

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Mike Miller
On Tue, 3 May 2011, Christian Schulz wrote: On Mon, 2 May 2011, P Ehlers wrote: Use str_sub() in the stringr package: require(stringr) # install first if necessary s <- "abcdefghijklmnopqrstuvwxyz" str_sub(s, c(1,12,17), c(3,15,-1)) #[1] "abc""lmno" "qrstuvwxyz" Thanks. Th

Re: [R] problem with Sweave and pdflatex

2011-05-02 Thread Frank Lehmann
That might fix the problem... I will test it. Thanks! Frank -Ursprüngliche Nachricht- Von: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Gesendet: Montag, 2. Mai 2011 17:52 An: Frank Lehmann Cc: r-help@r-project.org Betreff: Re: [R] problem with Sweave and pdflatex Have you check

[R] Comparison of two penalized spline fits in mixed model framework

2011-05-02 Thread Anna-Leena Orsama
Hello! I have faced a problem in nlme-environment. My intention is to fit a penalized spline model in mixed model framework. I want make a comparison in smooth curves between two groups but for some reason I get NaN in output.. Hereis the R-code I have used. #Z.overall is for truncated

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Christian Schulz
On Mon, 2 May 2011, P Ehlers wrote: Use str_sub() in the stringr package: require(stringr) # install first if necessary s <- "abcdefghijklmnopqrstuvwxyz" str_sub(s, c(1,12,17), c(3,15,-1)) #[1] "abc""lmno" "qrstuvwxyz" Thanks. That's very close to what I'm looking for, but

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Mike Miller
On Mon, 2 May 2011, P Ehlers wrote: Use str_sub() in the stringr package: require(stringr) # install first if necessary s <- "abcdefghijklmnopqrstuvwxyz" str_sub(s, c(1,12,17), c(3,15,-1)) #[1] "abc""lmno" "qrstuvwxyz" Thanks. That's very close to what I'm looking for, but i

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread P Ehlers
Mike Miller wrote: On Mon, 2 May 2011, Gabor Grothendieck wrote: On Mon, May 2, 2011 at 10:32 PM, Mike Miller wrote: On Tue, 3 May 2011, Andrew Robinson wrote: try substr() OK. Apparently, it allows things like this... substr("abcdef",2,4) [1] "bcd" ...which is like this: echo "abcde

[R] adaptIntegrate - how to pass additional parameters to the integrand

2011-05-02 Thread HC
Hello, I am trying to use adaptIntegrate function but I need to pass on a few additional parameters to the integrand. However, this function seems not to have the flexibility of passing on such additional parameters. Am I missing something or this is a known limitation. Is there a good alternativ

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Mike Miller
On Mon, 2 May 2011, Gabor Grothendieck wrote: On Mon, May 2, 2011 at 10:32 PM, Mike Miller wrote: On Tue, 3 May 2011, Andrew Robinson wrote: try substr() OK.  Apparently, it allows things like this... substr("abcdef",2,4) [1] "bcd" ...which is like this: echo "abcdef" | cut -c2-4 Bu

Re: [R] easy way to do a 2-D fit to an array of data?

2011-05-02 Thread Ravi Varadhan
Hi Carl, Here is another slightly different (not necessarily the easiest) approach that uses a profiling technique. An advantage is that you get the maximum location directly. n <- 20 x <- sort(rnorm(n)) y <- sort(rnorm(n)) xy <- expand.grid(x, y) zfn <- function(x) 0.5 - 2.2 * (x[1] - 0.5)

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Gabor Grothendieck
On Mon, May 2, 2011 at 10:32 PM, Mike Miller wrote: > On Tue, 3 May 2011, Andrew Robinson wrote: > >> try substr() > > OK.  Apparently, it allows things like this... > >> substr("abcdef",2,4) > > [1] "bcd" > > ...which is like this: > > echo "abcdef" | cut -c2-4 > > But that doesn't use a delimite

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Mike Miller
On Tue, 3 May 2011, Andrew Robinson wrote: try substr() OK. Apparently, it allows things like this... substr("abcdef",2,4) [1] "bcd" ...which is like this: echo "abcdef" | cut -c2-4 But that doesn't use a delimiter, it only does character-based cutting, and it is very limited. With "c

Re: [R] Lasso with Categorical Variables

2011-05-02 Thread Breheny, Patrick
Clementonia, It sounds like you are looking for the group lasso (Yuan & Lin, 2006). There are two packages on CRAN that have implemented this idea: grpreg and grplasso. The syntax of each is similar to lars (in particular requiring a numeric design matrix as produced by model.matrix), except

Re: [R] easy way to do a 2-D fit to an array of data?

2011-05-02 Thread Ravi Varadhan
You may want to consider spatial::surf.ls Or, a simplistic approach where you fit a model such as using `lm': E[Z | x, y] = a + b(x - x0)^2 + c(y - y0)^2 where (x0, y0) is the location of maximum. Ravi. From: r-help-boun...@r-project.org [r-help-boun.

Re: [R] Lasso with Categorical Variables

2011-05-02 Thread Andrew Robinson
On Mon, May 02, 2011 at 05:22:57PM -0400, Clemontina Alexander wrote: > Thanks for your response, but I guess I didn't make my question clear. > I am already familiar with the concept of dummy variables and > regression in R. My question is, can the "lars" package (or some other > lasso algorithm)

Re: [R] Lasso with Categorical Variables

2011-05-02 Thread David Winsemius
On May 2, 2011, at 2:22 PM, Clemontina Alexander wrote: Thanks for your response, but I guess I didn't make my question clear. I am already familiar with the concept of dummy variables and regression in R. My question is, can the "lars" package (or some other lasso algorithm) handle factors?

Re: [R] List of Data Frames

2011-05-02 Thread Rolf Turner
On 03/05/11 11:42, Mike Smith wrote: I'm trying to create a list of Data Frames. I have 17 data frames that I need to move through in a loop, but if I simply make a list of them, then they do not stay data frames, That is simply not true. Just ***how*** did you ``make a list of them''???

Re: [R] List of Data Frames

2011-05-02 Thread Jerome Asselin
On Mon, 2011-05-02 at 16:42 -0700, Mike Smith wrote: > I'm trying to create a list of Data Frames. I have 17 data frames > that I need to move through in a loop, but if I simply make a list of > them, then they do not stay data frames, and I can't sort through > them. I tried to create an array,

[R] List of Data Frames

2011-05-02 Thread Mike Smith
I'm trying to create a list of Data Frames.  I have 17 data frames that I need to move through in a loop, but if I simply make a list of them, then they do not stay data frames, and I can't sort through them.  I tried to create an array, but the data frames can have anywhere from 14-16 rows, and

[R] install rdcomclient source

2011-05-02 Thread Richard Wang
Hi, I'd like to ask a installation question. I want to install a source code through the following command, R CMD INSTALL RDCOMClient but get Error: unexpected symbol in "r cmd" Please let know if I miss anything. I my utils package loaded. Thanks, Richard [[alternative HTML version

Re: [R] Impulse response analysis within package vars

2011-05-02 Thread jessezeng
Hi, I have a similar question: ir <- irf(varsumm, impulse=c("prod", "rea", "rpo") n.ahead=20, runs=500, ci=0.95) will calculate the orthogonalized impulse responses from "prod", "rea", and "rpo", i.e. a (1, 1, 1)' vector. What do I need to do to make the impulse (-1, 1, 1)', i.e. I want the the

Re: [R] Simulation Questions

2011-05-02 Thread Andrew Robinson
Hi Shane, it sounds to me as though you have a fairly well-defined problem. You want to generate random numbers with a specific mean, variance, and correlation with another random varaible. I would reverse-enginerr the fuinctions for simple linear regression to get a result like y = beta_0 + be

Re: [R] Lasso with Categorical Variables

2011-05-02 Thread Clemontina Alexander
Thanks for your response, but I guess I didn't make my question clear. I am already familiar with the concept of dummy variables and regression in R. My question is, can the "lars" package (or some other lasso algorithm) handle factors? I did use dummy variables in my original data, but lars (lasso

Re: [R] Help with coloring segments on a plot

2011-05-02 Thread Andrew Robinson
Hi Paul, not to seem naive, but have you actually tried the code below? It doesn't seem that you have, from your text. I think that if you try it and hack then ask concrete questions (e.g. can anyone explain why the following simple, reproducible, commented code does not work) then you'll have m

[R] easy way to do a 2-D fit to an array of data?

2011-05-02 Thread Carl Witthoft
Hi, I've got a matrix, Z, of values representing (as it happens) optical power at each pixel location. Since I know in advance I've got a single, convex peak, I would like to do a 2D parabolic fit of the form Z = poly((x+y),2) where x and y are the x,y coordinates of each pixel (or equivalen

Re: [R] INSERT OR UPDATE

2011-05-02 Thread Mikkel Grum
Thanks Steven. It obviously makes sense to loop on the much smaller dataset that is being added than the set of everything that might already be in the database. I've added your message in plain text, so that others can see it too. Mikkel From: Steven Kennedy Subject: Re: [R] INSERT OR UPDATE

Re: [R] Optimization - n dimension matrix

2011-05-02 Thread Andrew Robinson
Hello, optim() works for more than one dimension. You might also find this page helpful: http://cran.r-project.org/web/views/Optimization.html Cheers Andrew On Mon, May 02, 2011 at 12:41:19PM -0700, petrolmaniac wrote: > Dear all, > > I am facing the following problem in optimization: > > w

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread Andrew Robinson
Hi Mike, try substr() Cheers Andrew On Mon, May 02, 2011 at 03:53:58PM -0500, Mike Miller wrote: > The R "cut" command is entirely different from the UNIX "cut" command. > The latter retains selected fields in a line of text. I can do that kind > of manipulation using sub() or gsub(), but it

Re: [R] setting options only inside functions

2011-05-02 Thread luke-tierney
On Fri, 29 Apr 2011, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of luke-tier...@uiowa.edu Sent: Friday, April 29, 2011 9:35 AM To: Jonathan Daily Cc: r-help@r-project.org; Hadley Wickham; Barry Rowlingson Su

Re: [R] INSERT OR UPDATE

2011-05-02 Thread Steven Kennedy
Rather than selecting all the keys, then having R loop through them, why not have postgres do it for you with something like: #go through each line in our entry table for (i in 1:dim(tbl)[1]){ #check if the pkey already exists q <- paste ("SELECT key1, key2 FROM tabl WHERE key1=",tbl[i,1],

Re: [R] Help converting a data.frame to ordered factors

2011-05-02 Thread Phil Spector
Robert - It would be helpful to know what you've tried that didn't work, but the data.frame() function is the usual way of combining things like this: a = factor(sample(1:5,100,replace=TRUE),ordered=TRUE) b = factor(sample(1:5,100,replace=TRUE),ordered=TRUE) ab = data.frame(a,b) sapply(ab,cla

[R] UNIX-like "cut" command in R

2011-05-02 Thread Mike Miller
The R "cut" command is entirely different from the UNIX "cut" command. The latter retains selected fields in a line of text. I can do that kind of manipulation using sub() or gsub(), but it is tedious. I assume there is an R function that will do this, but I don't know its name. Can you tell

Re: [R] QQ plot for normality testing

2011-05-02 Thread Greg Snow
I would use the vis.test function along with vt.qqnorm (both in TeachingDemos package). This will create several plots, one of which is your data, the rest are simulated normals with the same mean and standard deviation. If you can tell which plot stands out (and it is your real data) then tha

Re: [R] Copying to R a rectangular array from a Java class

2011-05-02 Thread Hurr
I am happy to report that the author and maintainer of rJava informed me that the 2-dim array in java needs sapply and .jevalArray as follows: > conn2Arr<- sapply(.jfield(rJavaTst,sig="[[D","con2Arr"),.jevalArray) > conn2ArrRet <- > sapply(.jcall(rJavaTst,returnSig="[[D","retCon2Arr"),.jevalAr

[R] Optimization - n dimension matrix

2011-05-02 Thread petrolmaniac
Dear all, I am facing the following problem in optimization: w = (d, o1, ..., op, m1, ..., mq) is a 1 + p + q vector I want to determine: w = argmin (a - d(w))' A (a - d(w)) where a is a 1xK marix, A is the covariance matrix of vector a, d(w) is a 1xK vector which parameters are functions of

[R] Help converting a data.frame to ordered factors

2011-05-02 Thread Robert Cassidy
I have a 96x34 array of Likert scale data (96 cases, 34 items) of ordered factors (strongly disagree, disagree, neutral, agree, strongly agree) that are coded numerically (1 through 5). I cannot seem to convert this array (in any class) into ordered vectors. I have all the cases as vectors of ord

[R] INSERT OR UPDATE

2011-05-02 Thread Mikkel Grum
I'm trying to insert rows of a data.frame into a database table, or update where the key fields of a record already exist in the table. I've come up with a possible solution below, but would like to hear if anyone has a better solution. # The problem demonstrated: # Create a data.frame with tes

[R] Help with coloring segments on a plot

2011-05-02 Thread Paul Davison
Hi. I need a very short piece of help regarding colouring segments plotted on a graph. When I am plotting segments for the graph, I am using "red" and "darkgreen for the values "1" and "2" respectively. Heres the relevant line of code in R: + col = c("red", "darkgreen")[line.colour.value]) I jus

Re: [R] Tests for the need of cluster analysis

2011-05-02 Thread Ben Bolker
MARY A. WEISS temple.edu> writes: > > Hi, > > I am currently using STATA in my analysis. STATA has a cluster option but > does not have any tests for whether cluster analysis is necessary or not for > a dataset. So I am trying to figure out whether R could be used to test > whether I need to

Re: [R] Lasso with Categorical Variables

2011-05-02 Thread David Winsemius
On May 2, 2011, at 10:51 AM, Steve Lianoglou wrote: Hi, On Mon, May 2, 2011 at 12:45 PM, Clemontina Alexander > wrote: Hi! This is my first time posting. I've read the general rules and guidelines, but please bear with me if I make some fatal error in posting. Anyway, I have a continuous resp

Re: [R] Lasso with Categorical Variables

2011-05-02 Thread Steve Lianoglou
Hi, On Mon, May 2, 2011 at 12:45 PM, Clemontina Alexander wrote: > Hi! This is my first time posting. I've read the general rules and > guidelines, but please bear with me if I make some fatal error in > posting. Anyway, I have a continuous response and 29 predictors made > up of continuous varia

[R] ID parameter in model

2011-05-02 Thread Mike Harwood
Hello, I am apparently confused about the use of an id parameter for an event history/survival model, and why the EHA documentation for aftreg does not specify one. All assistance and insights are appreciated. Attempting to specifiy an id variable with the documentation example generates an "ove

Re: [R] Tests for the need of cluster analysis

2011-05-02 Thread MARY A. WEISS
Hi, I am currently using STATA in my analysis. STATA has a cluster option but does not have any tests for whether cluster analysis is necessary or not for a dataset. So I am trying to figure out whether R could be used to test whether I need to be doing cluster analysis or not. If R does tests

[R] Lasso with Categorical Variables

2011-05-02 Thread Clemontina Alexander
Hi! This is my first time posting. I've read the general rules and guidelines, but please bear with me if I make some fatal error in posting. Anyway, I have a continuous response and 29 predictors made up of continuous variables and nominal and ordinal categorical variables. I'd like to do lasso on

Re: [R] Tests for the need of cluster analysis

2011-05-02 Thread Tal Galili
Hi Mary, Are you using R for your other analysis? If so, What commands are you using for your analysis? p.s: please keep the rest of the R-help mailing list in the loop. Cheers, Tal Contact Details:--- Contact me: tal.gal...@

Re: [R] Specify custom par(mfrow()) layout for defined plot()

2011-05-02 Thread Michael Bach
Prof Brian Ripley writes: > On Mon, 2 May 2011, Michael Bach wrote: > >> Uwe Ligges writes: >> >>> On 29.04.2011 17:10, Michael Bach wrote: Dear R Users, I am doing stats::decompose() on 4 different time series. When I issue csdA<- decompose(tsA) plot(csdA) >>

Re: [R] how to get row name using the which function

2011-05-02 Thread Uwe Ligges
rownames(which(example == max(example), arr.ind=TRUE)) Uwe Ligges On 02.05.2011 13:54, Schumacher, G. wrote: Dear All, Probably a very basic question, but can't seem to work my way around it. I want to which row has the maximum value. But what if the row names do not correspond with the row

Re: [R] problem with Sweave and pdflatex

2011-05-02 Thread Uwe Ligges
Have you checked the permissions in the working directory? Is there a blank in your path (LaTeX does not like spaces in the path). Uwe Ligges On 02.05.2011 14:51, Frank Lehmann wrote: Hallo, when I plot figures with Sweave, I get the message "pdflatex: Permission denied". This problem only

Re: [R] Problems with Rterm 2.13.0 - but not RGui

2011-05-02 Thread Jonathan Daily
The message is pretty clear. Access denied means you don't have permission to access the path. This also explains why the packages fail to load - you don't have access to R's package library. It most likely works on RGui because you are clicking it/running it as admin (you did not specify how you r

Re: [R] Problem installing new packages

2011-05-02 Thread Uwe Ligges
On 02.05.2011 10:47, liyatle wrote: I'm having that problem, what did you do? 1. This is the mailing list R-help, not an individual person. I guess you sent to the wrong address. 2. PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] help with a survplot

2011-05-02 Thread Frank Harrell
Please elaborate. Thanks Frank Marco Barbàra-2 wrote: > > Thank you very much. > > Despite prof. Harrell's support (for whom I feel great > esteem) I still remain doubtful about this feature. > > __ > R-help@r-project.org mailing list > https://stat

Re: [R] pie of pie chart

2011-05-02 Thread Jonathan Daily
The package ggplot2 can do this using a density statistic, polar coordinates, and faceting. Extra documentation for the package can be found at the author's site [1]. [1] http://had.co.nz/ On Mon, May 2, 2011 at 10:06 AM, Mathias Walter wrote: > Hi, > > despite the fact that pie charts often fa

[R] pie of pie chart

2011-05-02 Thread Mathias Walter
Hi, despite the fact that pie charts often fail, I'll draw them anyway (in a case were they are not fail ;-) ). Does anybody know a package/methods which can draw pie of pie or bar of pie charts similar to that in MS Excel? -- Kind regards, Mathias __

Re: [R] 3-way contingency table

2011-05-02 Thread Mathias Walter
Hi David, thanks for your quick response. It was really helpful. -- Kind regards, Mathias 2011/4/29 David Winsemius : > > On Apr 29, 2011, at 6:47 AM, Mathias Walter wrote: > >> Hi, >> >> I have large data frame with many columns. A short example is given below: >> >>> dataH >> >>   host ms01 ms

Re: [R] Global variables

2011-05-02 Thread Kenn Konstabel
On Mon, May 2, 2011 at 2:19 PM, abhagwat wrote: > Well, what would be really helpful is to restrict the scope of all > non-function variables, but keep a global for scope of all function > variables. Then, you still have access to all loaded functions, but you > don't mix up variables. > > How wou

Re: [R] Axis label colour

2011-05-02 Thread David Winsemius
On May 2, 2011, at 2:48 AM, Kang Min wrote: Hi all, Is there an argument in the axis() function to change the colour of the tick labels? I only found col.ticks, and col.lab, but they're not doing what I want. You just need to read a bit further down in the help page for `axis`. -- David Wi

Re: [R] Global variables

2011-05-02 Thread Duncan Murdoch
On 02/05/2011 7:19 AM, abhagwat wrote: Well, what would be really helpful is to restrict the scope of all non-function variables, but keep a global for scope of all function variables. Then, you still have access to all loaded functions, but you don't mix up variables. How would one do that? Y

Re: [R] strange fluctuations in system.time with kernapply

2011-05-02 Thread Ravi Varadhan
Why not do `zero padding' to improve the efficiency, i.e. add a bunch of zeros to the end of the data vector such that the resulting vector is a power of 2? This is very common in signal processing, and is legitimate since zero padding does not add any new information. Ravi. -

[R] Problems with Rterm 2.13.0 - but not RGui

2011-05-02 Thread Stefan McKinnon Høj-Edwards
Hi all, I have just installed R 2.13.0 and I am experiencing problems with the terminal, but not the with the GUI interface. I am Windows 7. When running "R" or "Rterm" from a commandline I receive the following: Warning message: In normalizePath(path.expand(path), winslash, mustWork) : path[

[R] problem with Sweave and pdflatex

2011-05-02 Thread Frank Lehmann
Hallo, when I plot figures with Sweave, I get the message "pdflatex: Permission denied". This problem only occurs while working on local system. When I copy the *.rnw-File to my AFS drive, there is no problem at all. Here is a small example: \documentclass{scrartcl} \usepackage[OT1]{fo

Re: [R] Specify custom par(mfrow()) layout for defined plot()

2011-05-02 Thread Prof Brian Ripley
On Mon, 2 May 2011, Michael Bach wrote: Uwe Ligges writes: On 29.04.2011 17:10, Michael Bach wrote: Dear R Users, I am doing stats::decompose() on 4 different time series. When I issue csdA<- decompose(tsA) plot(csdA) I get a summary plot for observed, trend, seasonal and random componen

Re: [R] how to get row name using the which function

2011-05-02 Thread Downey, Patrick
Perhaps not the most elegant. rownames(example)[which.max(example)] If you wanted to type less, you could always write a function. names.max <- function(x){ return(rownames(example)[which.max(example)]) } -Mitch -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-

Re: [R] bwplot in ascending order

2011-05-02 Thread Doran, Harold
Doesn't seem to work. My data structure is below (I will send data to anyone off-list who could offer support). The following code below does work, but since I concatenate Region and Gender, the labels on the lattice are ugly. dat$test <- factor(paste(dat$Region, dat$Gender, sep='_')) bymedian

Re: [R] Specify custom par(mfrow()) layout for defined plot()

2011-05-02 Thread Michael Bach
Uwe Ligges writes: > On 29.04.2011 17:10, Michael Bach wrote: >> Dear R Users, >> >> I am doing stats::decompose() on 4 different time series. When I issue >> >> csdA<- decompose(tsA) >> plot(csdA) >> >> I get a summary plot for observed, trend, seasonal and random components >> of decomposed ti

[R] how to get row name using the which function

2011-05-02 Thread Schumacher, G.
Dear All, Probably a very basic question, but can't seem to work my way around it. I want to which row has the maximum value. But what if the row names do not correspond with the row numbers. In the example below, you'll see that the max of example is row 4, but the name of row 4 is "9". How do

Re: [R] Global variables

2011-05-02 Thread abhagwat
Well, what would be really helpful is to restrict the scope of all non-function variables, but keep a global for scope of all function variables. Then, you still have access to all loaded functions, but you don't mix up variables. How would one do that? Adi > Is there a way I can prevent global

[R] Axis label colour

2011-05-02 Thread Kang Min
Hi all, Is there an argument in the axis() function to change the colour of the tick labels? I only found col.ticks, and col.lab, but they're not doing what I want. Thanks, KM __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Problem installing new packages

2011-05-02 Thread liyatle
I'm having that problem, what did you do? -- View this message in context: http://r.789695.n4.nabble.com/Problem-installing-new-packages-tp1589974p3489573.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

[R] adding legend to matplot

2011-05-02 Thread kcchalmers
Hi all, I am new to R programming and I was trying to write a simple code in order to plot my data. The problem is that I am not able to insert a legend corresponding to each column of the data matrix. Please can someone help me out. How can i directly get the legend relating to each data curve. T

Re: [R] bwplot in ascending order

2011-05-02 Thread Mark Difford
On May 01 (2011) Harold Doran wrote: >> Can anyone point me to examples with R code where bwplot in lattice is >> used to order the boxes in >> ascending order? You don't give an example and what you want is not entirely clear. Presumably you want ordering by the median (boxplot, and based on t

Re: [R] subseting data

2011-05-02 Thread Steven Kennedy
You can use grepl: > dat<-data.frame(test=c("abc","cdf","dabc")) > d<-subset(dat,grepl(test,"abc")) > d test 1 abc 3 dabc On Mon, May 2, 2011 at 7:03 PM, Matevž Pavlič wrote: > Hi, > > > > Is it possible (i am sure it is) to subset data from a data.frame on the > basis of SQL >LIKE< oper

[R] grid

2011-05-02 Thread azam jaafari
Dear All   I trained a neural network for 200 data and I did prediction for a grid file (e.g. 100 points) such as below:   snn<-predict(nn, newdata=data.frame(wetness=wetnessgrid$band1, ndvi=ndvigrid$band1))   the pixels of snn is same with wetnessgrid or ndvigrid    I want to convert this f

Re: [R] Copying to R a rectangular array from a Java class

2011-05-02 Thread Hurr
I discovered that a row of a rectangular array returns, but a function parameter is not sent to Java. Appended bare test code: My simple Java test class source and R test code follow: public class RJavTest { public static void main(String[]args) { RJavTest rJavTest=new RJavTest(); } public fi

[R] (no subject)

2011-05-02 Thread Oliver Sonnentag
[[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] Tests for the need of cluster analysis

2011-05-02 Thread Tal Galili
Hi Mary, I'm not sure I understood your question. Are you using this package: http://cran.r-project.org/web/packages/prabclus/index.html And asking how to decide if to use it or not? Contact Details:-

Re: [R] Specify custom par(mfrow()) layout for defined plot()

2011-05-02 Thread Uwe Ligges
On 29.04.2011 17:10, Michael Bach wrote: Dear R Users, I am doing stats::decompose() on 4 different time series. When I issue csdA<- decompose(tsA) plot(csdA) I get a summary plot for observed, trend, seasonal and random components of decomposed time series tsA. As I understand it, the obj

Re: [R] logistic regression with glm: cooks distance and dfbetas are different compared to SPSS output

2011-05-02 Thread Uwe Ligges
On 29.04.2011 18:29, "Biedermann, Jürgen" wrote: Hi there, I have the problem, that I'm not able to reproduce the SPSS residual statistics (dfbeta and cook's distance) with a simple binary logistic regression model obtained in R via the glm-function. I tried the following: fit <- glm(y ~ x1

Re: [R] The bin/R file - hardcoded paths

2011-05-02 Thread Uwe Ligges
From the manual R Installation and Administration (that you should have read yourself before posting): "You can install into another directory tree by using make prefix=/path/to/here install" Uwe Ligges On 29.04.2011 19:42, Saptarshi Guha wrote: Hello, I notice that e.g /home/sguha/lib64

Re: [R] Bechmarking my code

2011-05-02 Thread Uwe Ligges
On 02.05.2011 12:35, Alaios wrote: Dear all, I have written a quite big piece of code that takes like 6 hourse to execute (measured that with system.time). I was wondering if it is possible to try to further understand which are the pieces of code that are more time consuming so to try to im

Re: [R] caret - prevent resampling when no parameters to find

2011-05-02 Thread Max Kuhn
Yeah, that didn't work. Use fitControl<-trainControl(index = list(seq(along = mdrrClass))) See ?trainControl to understand what this does in detail. Max __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

[R] Bechmarking my code

2011-05-02 Thread Alaios
Dear all, I have written a quite big piece of code that takes like 6 hourse to execute (measured that with system.time). I was wondering if it is possible to try to further understand which are the pieces of code that are more time consuming so to try to improve them. Could you please help me u

Re: [R] --mem-vsize in R

2011-05-02 Thread Uwe Ligges
On 29.04.2011 22:14, kparamas wrote: Hi, I am calculation pairwise correlation coefficient for a matrix of 234 X 3. I am getting the following error, Error in cbind(as.vector(row(cl)), as.vector(col(cl)), as.vector(cl)) : allocMatrix: too many elements specified The problem is that y

[R] The R Inferno revised

2011-05-02 Thread Patrick Burns
Hell is new and improved. The new version is in the same old place: http://www.burns-stat.com/pages/Tutor/R_inferno.pdf An explanation of the changes is at: http://www.portfolioprobe.com/2011/05/02/the-r-inferno-revised/ -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http:/

Re: [R] subseting data

2011-05-02 Thread Uwe Ligges
On 02.05.2011 11:47, Matevž Pavlič wrote: Hi, When I use your code i get this : dat<-data.frame(test=c("abc","cdf","dabc")) d<-subset(dat,grepl(test,"abc")) d <- subset(dat, grepl("abc", test)) d Warning message: In grepl(test, "abc") : argument 'pattern' has length> 1

Re: [R] subseting data

2011-05-02 Thread Matevž Pavlič
Hi, When I use your code i get this : >dat<-data.frame(test=c("abc","cdf","dabc")) >d<-subset(dat,grepl(test,"abc")) >d Warning message: In grepl(test, "abc") : argument 'pattern' has length > 1 and only the first element will be used > d test 1 abc 2 cdf 3 dabc I can't

Re: [R] subseting data

2011-05-02 Thread Andrew Robinson
I wonder if grep() will help you? Cheers Andrew On Mon, May 02, 2011 at 11:03:52AM +0200, Matev? Pavli? wrote: > Hi, > > > > Is it possible (i am sure it is) to subset data from a data.frame on the > basis of SQL >LIKE< operator. I.e., i would like to subset a data where only > values w

Re: [R] strange fluctuations in system.time with kernapply

2011-05-02 Thread Uwe Ligges
On 29.04.2011 23:38, Alexander Senger wrote: Hello expeRts, here is something which strikes me as kind of odd and I would like to ask for some enlightenment: First let's do this: tkern <- kernel("modified.daniell", c(5,5)) test <- rep(1,100) system.time(kernapply(test,tkern)) User Syste

[R] subseting data

2011-05-02 Thread Matevž Pavlič
Hi, Is it possible (i am sure it is) to subset data from a data.frame on the basis of SQL >LIKE< operator. I.e., i would like to subset a data where only values which contains a string >GP< would be used? Example: Gp<-subset(DF, DF$USCS like >GP<) This like of course is not wor

Re: [R] question of VECM restricted regression

2011-05-02 Thread Pfaff, Bernhard Dr.
Hello Meilan: 'ect' is shorthand for error-correction-term, 'sd' signify seasonal dummy variables and 'LRM.dl1' is the lagged first difference of the variable 'LRM' (the log of real money demand). HTH, Bernhard > -Ursprüngliche Nachricht- > Von: r-help-boun...@r-project.org > [mailto

Re: [R] bwplot in ascending order

2011-05-02 Thread Uwe Ligges
On 01.05.2011 22:52, Doran, Harold wrote: Can anyone point me to examples with R code where bwplot in lattice is used to order the boxes in ascending order? I have found the following discussion and it partly works. But, I have a conditioning variable, so my example is more like bwplot(var1

Re: [R] vector decreasing by a factor

2011-05-02 Thread Uwe Ligges
On 02.05.2011 09:55, andre bedon wrote: Hi, I'm quite new to R so this question will sound quite fundamental. I need to create a vector of length 160. The first element should be (1+r)^159 and each element thereafter should decrease by a factor of (1+r) until the 160th element that should b

Re: [R] vector decreasing by a factor

2011-05-02 Thread Ted Harding
On 02-May-11 07:55:27, andre bedon wrote: > Hi, > I'm quite new to R so this question will sound quite fundamental. > I need to create a vector of length 160. The first element should > be (1+r)^159 and each element thereafter should decrease by a > factor of (1+r) until the 160th element that shou

Re: [R] help with a survplot

2011-05-02 Thread Marco Barbàra
Thank you very much. Despite prof. Harrell's support (for whom I feel great esteem) I still remain doubtful about this feature. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

Re: [R] bootstrapping problem

2011-05-02 Thread Uwe Ligges
On 29.04.2011 09:01, mimato wrote: I want to classify bipolar neurons in human cochleas and have data of the following structure: Vol_Nuc Vol_Soma 1 186.23 731.96 2 204.58 4370.96 3 539.98 7344.86 4 477.71 6939.28 5 421.22 5588.53 6 276.61 1017.05 7 392.28 6392.32 8 424

[R] vector decreasing by a factor

2011-05-02 Thread andre bedon
Hi, I'm quite new to R so this question will sound quite fundamental. I need to create a vector of length 160. The first element should be (1+r)^159 and each element thereafter should decrease by a factor of (1+r) until the 160th element that should be 1. Is there a function similar to seq() bu

Re: [R] importing and filtering time series data

2011-05-02 Thread Joel Reymont
My current code looks like this. Anything that can be improved? #! /usr/bin/rscript # install.packages(c('zoo','xts')) library(zoo) library(xts) req_stats <- function(data, type = NA) { if (is.na(type)) csv <- data else # subset of data matching our request type csv <- subset(da

Re: [R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test

2011-05-02 Thread Uwe Ligges
To get the statsitics, you will have to run each wilcox.test manually. the pairwise... version just extracts the p-values and adjusts them. Uwe Ligges On 28.04.2011 15:18, JP wrote: Hi there, I am trying to do multiple pairwise Wilcoxon signed rank tests in a manner similar to: a<- c(runif

Re: [R] multiple mosaic plots layout

2011-05-02 Thread Achim Zeileis
On Mon, 2 May 2011, baptiste auguie wrote: Unfortunately, it seems that vcd doesn't return grobs but draws directly to the device, which prevents a concise solution. Yes. The reason is that vcd was first written before grobs were available. When we need multiple plots in a single layout, we u