Re: [R] Interactive/Dynamic plots with R

2011-02-26 Thread Abhishek Pratap
Hi Greg Ability to zoom in/out on x/y axis to begin with and then adding/removing data sets. Thanks! -Abhi On Fri, Feb 25, 2011 at 12:52 PM, Greg Snow greg.s...@imail.org wrote: What types of interaction do you want? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

[R] Using uniroot() with output from deriv() or D()

2011-02-26 Thread jjheath
I need to find the root of the second derivative of many curves and do not want to cut and paste the expression results from the deriv() or D() functions every time. Below is an example. What I need to do is refer to fn2nd in the uniroot() function, but when I try something like

[R] Boxplot for X Vs Y variable grouped by ID

2011-02-26 Thread Shankar Lanke
Dear All, I am new to R. I amazed by this software. I have a question regarding boxplot. I have three columns say X, Y,ID (X is time from 0 to 12 hrs, Y is a variable dependent on X) I can plot a simple boxplot if it is just one group. But I have 10 groups and I want to plot all of them in one

[R] A problem about realized garch model

2011-02-26 Thread 張宏豪
Hi, I am trying to write the Realized GARCH model with order (1,1) The model can be describe bellow: r_t = sqrt( h_t) * z_t logh_t = w + b*logh_(t-1) + r*logx_(t-1) logx_t = c + q*logh_t + t1*z_t +t2*(z_t ^2 -1) + u_t and z follow N(0,1) , u follow N(0, sigma.u^2) But I'm troubled with the

[R] Autocorrelation Rho Greater Than One

2011-02-26 Thread Hock Ann Lim
Dear R Users, Kindly advice me what's wrong in my programming. I'm using the Cochrane-Orcutt two stage procedure with Prais Wisten transformation, below is my R programming : Y-c(60.8,62.5,64.6,66.1,67.7,69.1,71.7,73.5,76.2,77.3,78.8,80.2,82.6,84.3,83.3,84.1,86.4,87.6,89.1,89.3,89.1, , +

Re: [R] Boxplot for X Vs Y variable grouped by ID

2011-02-26 Thread David Winsemius
On Feb 26, 2011, at 1:07 AM, Shankar Lanke wrote: Dear All, I am new to R. I amazed by this software. I have a question regarding boxplot. I have three columns say X, Y,ID (X is time from 0 to 12 hrs, Y is a variable dependent on X) I can plot a simple boxplot if it is just one group. But I

[R] Problem with RODBC sqlSave

2011-02-26 Thread Lars Bishop
Hi, I'm able to establish a successful odbc connection using RODBC 1.3-2 on Win 7 and R 2.12.0. But I'm getting the following error message when I try to save a data frame into the debase as shown below. library(RODBC) bbdb - odbcConnect(bbdb) odbcGetInfo(bbdb) # returns ok sqlSave(bbdb,

[R] sourcing a linux file with system

2011-02-26 Thread james.foadi
Dear R community, I would like to source a file in my linux system to set a few environment variables. I have tried: system(source /home/james/build//ccp4-6.1.13/include/ccp4.setup) and got: sh: source: not found In fact, using Sys.which(source) I get an empty string. How can I source that

Re: [R] R in different OS

2011-02-26 Thread David Scott
Not sure exactly what the original poster was after, but for distinguishing when I am working on different machines with different OS, I use something like this: ### Set some state variables opSys - Sys.info()[sysname] if (opSys == Windows){ linux - FALSE } else { linux - TRUE } David

Re: [R] sourcing a linux file with system

2011-02-26 Thread Prof Brian Ripley
And what do you think 'source' does? Or system() does (check the help page)? Hint: source is not an external command on Linux, but a builtin command of some shells (e.g. csh, bash), but not of sh -- in sh the equivalent is '.'. On Sat, 26 Feb 2011, james.fo...@diamond.ac.uk wrote: Dear R

Re: [R] R in different OS

2011-02-26 Thread Prof Brian Ripley
It is less clear what you are after, but the canonical way to decide if your R session is on Windows is .Platform$OS.type == windows Unlike {R.}version$os and Sys.info()[sysname], the set of values here is known and documented. As ?R.version does say: Do _not_ use ‘R.version$os’ to

Re: [R] Finding pairs with least magnitude difference from mean

2011-02-26 Thread Hans W Borchers
I have what I think is some kind of linear programming question. Basically, what I want to figure out is if I have a vector of numbers, x - rnorm(10) x [1] -0.44305959 -0.26707077 0.07121266 0.44123714 -1.10323616 -0.19712807 0.20679494 -0.98629992 0.97191659 -0.77561593 mean(x)

Re: [R] R in different OS

2011-02-26 Thread David Scott
Thanks Brian, I stand corrected. David Scott On 27/02/2011 12:32 a.m., Prof Brian Ripley wrote: It is less clear what you are after, but the canonical way to decide if your R session is on Windows is .Platform$OS.type == windows Unlike {R.}version$os and Sys.info()[sysname], the set of

[R] invalid type (list) for variable

2011-02-26 Thread Michael Hecker
Hi, I have a problem with an invalid variable type. My sample dataset is looking like this: str(factivaTDM.train) 'data.frame': 4 obs. of 14 variables: $ access: num 2 3 2 1 $ billion : num 2 1 2 2 $ compani : num 7 6 1 2 $ data : num

[R] Pulling p values

2011-02-26 Thread Gallavan, Robert
Hi folks, I'm doing ANOVA with multiple comparisons. I've used both the TukeyHSD function and the multcomp procedure. In both cases, I get some tantalizing results such as this... e = aov(lm(d.all[,(n+4)] ~ d.all[,4]) TukeyHSD(e) Tukey multiple comparisons of means 95% family-wise

Re: [R] sourcing a linux file with system

2011-02-26 Thread David Kirkby
On 26 February 2011 11:00, james.fo...@diamond.ac.uk wrote: Dear R community, I would like to source a file in my linux system to set a few environment variables. I have tried: system(source /home/james/build//ccp4-6.1.13/include/ccp4.setup) and got: sh: source: not found Someone has

Re: [R] Pulling p values

2011-02-26 Thread Peter Ehlers
On 2011-02-26 04:12, Gallavan, Robert wrote: Hi folks, I'm doing ANOVA with multiple comparisons. I've used both the TukeyHSD function and the multcomp procedure. In both cases, I get some tantalizing results such as this... e = aov(lm(d.all[,(n+4)] ~ d.all[,4]) TukeyHSD(e) Tukey

Re: [R] Using uniroot() with output from deriv() or D()

2011-02-26 Thread Hans W Borchers
I need to find the root of the second derivative of many curves and do not want to cut and paste the expression results from the deriv() or D() functions every time. Below is an example. What I need to do is refer to fn2nd in the uniroot() function, but when I try something like

Re: [R] BFGS versus L-BFGS-B

2011-02-26 Thread Prof. John C Nash
Bert has put a finger on one of the key questions: Are we there yet? Global optima are very difficult to find in many, possibly most problems. We can check for local optima. In package optimx (currently resetting it on CRAN due to a variable naming glitch with Rvmmin -- should be there in a

Re: [R] tansformation of variables in cph from rms package

2011-02-26 Thread Frank Harrell
Yao, I wonder how likely it is that log transformations fit the data. More often I find that the flexibility of restricted cubic splines is needed. One of the things that people take for granted when using log() is that they are assuming that k=0 in making the transformation log(x + k). It is

Re: [R] Using uniroot() with output from deriv() or D()

2011-02-26 Thread Gabor Grothendieck
On Sat, Feb 26, 2011 at 2:16 AM, jjheath heath_jer...@hotmail.com wrote: I need to find the root of the second derivative of many curves and do not want to cut and paste the expression results from the deriv() or D() functions every time.  Below is an example.  What I need to do is refer to

Re: [R] unable to access index for repository

2011-02-26 Thread Duncan Murdoch
On 11-02-25 6:15 PM, Kalicin, Sarah wrote: Hi, I have two questions: 1) Since I switched to Windows 2007 and downloaded the current R version (2.12.1; 2010-12-16) for Windows 7 a month ago, I cannot down load packages through the GUI drop down menu. I get: Warning: unable to access

Re: [R] Forced inclusion of varaibles in validate command as well as step

2011-02-26 Thread Frank Harrell
Jon, Version 3.3-0 of rms will be released within 2-3 days. It has a new option force for fastbw, validate, calibrate. force is an integer vector of the parameter numbers to force into every model. It is meant to work with type='individual' and its performance with type='residual' needs to be

Re: [R] Hierarchical Power Analysis

2011-02-26 Thread Ben Bolker
Downey, Patrick PDowney at urban.org writes: Hello, A colleague is trying to do a fairly complicated power analysis for a project. The project would be evaluating random assignment to one of three conditions within each of 8 sites. The dependent variable would be binary (we do not care

Re: [R] MCMCpack combining chains

2011-02-26 Thread Uwe Ligges
On 24.02.2011 17:48, Alan Kelly wrote: Deal all, as MCMClogit does not allow for the specification of several chains, I have run my model 3 times with different random number seeds and differently dispersed multivariate normal priors. For example: res1 =

Re: [R] plotmath: how to create a vector of expressions?

2011-02-26 Thread Peter Ehlers
On 2011-02-25 15:57, Marius Hofert wrote: Dear expeRts, I would like to use LaTeX-like symbols in keys via plotmath. Below is a minimal example. I get: Error in fun(key = list(x = 0.5, y = 0.8, text = list(list(expression(paste((, : first component of text must be vector of labels What's

Re: [R] Boxplot not doing what I think it should

2011-02-26 Thread Uwe Ligges
On 24.02.2011 19:15, Greg Snow wrote: Look at ?quantile, especially the detail section on type and the second reference (and the see also section). There are many different definitions of quantiles/quartiles and different functions use different versions. Particularly ?boxplots points

[R] Wired behavior of a 2-by-2 matrix indicies

2011-02-26 Thread Feng Li
Dear R, I found a very wired behavior for a 2-by-2 matrix, see this example A - matrix(1:4, 2) idx4A - matrix(1:4, 2) A[idx4A] Error in A[idx4A] : subscript out of bounds But other matrices are fine, B - matrix(1:9, 3) idx4B - matrix(1:9, 3) B[idx4B] [1] 1 2 3 4 5 6 7 8 9 I can

Re: [R] Interactive/Dynamic plots with R

2011-02-26 Thread Greg Snow
There is an rggobi package that makes transferring data between R and ggobi easy. But I would probably start with the playwith package which I think will do most of what you want. Some other options are the iplots package, rpanel package, the fgui package and the tkexamp function in the

Re: [R] Wired behavior of a 2-by-2 matrix indicies

2011-02-26 Thread Sarah Goslee
Hello, On Sat, Feb 26, 2011 at 12:11 PM, Feng Li m...@feng.li wrote: Dear R, I found a very wired behavior for a 2-by-2 matrix, see this example A - matrix(1:4, 2) idx4A - matrix(1:4, 2) A[idx4A] Error in A[idx4A] : subscript out of bounds This shouldn't work. From the help for [,

Re: [R] Weird behavior of a 2-by-2 matrix indicies

2011-02-26 Thread Feng Li
The real weird thing is I wrote weird and it comes out wired... The background is that I did a lot of sparse matrices calculations. Therefore need some indices tweaks, e.g subtract a block from a big matrix. Then I just create an indicies matrix and use it directly as a vector since a matrix is

Re: [R] select element from vector

2011-02-26 Thread Uwe Ligges
On 25.02.2011 12:37, zem wrote: Hi Jessica, try this: Q[k:c(k+3)] 1. You have written to the R-help mailing list rather than to Jessica. Please answer also directly: not all posters are on the mailing list. 2. Please quote the original question. Uwe Ligges

Re: [R] J48 - contrasts can be applied only to factors with 2 or more levels

2011-02-26 Thread Uwe Ligges
On 24.02.2011 15:29, Patrick Skorupka wrote: Hi everybody, I recently sent out a first message using this tool and was astonished about the quick and helpful replys. So, thank you in advance for your help, I really appreciate that! As already recently mentioned I am new to using R as I

Re: [R] kohonen: Argument data should be numeric

2011-02-26 Thread Uwe Ligges
On 25.02.2011 15:33, Jay wrote: Hi, I'm trying to utilize the kohonen package to build SOM's. However, trying this on my data I get the error: Argument data should be numeric when running the som(data.train, grid = somgrid(6, 6, hexagonal)) function. As you see, there is a problem with the

Re: [R] aggregate with cumsum

2011-02-26 Thread Uwe Ligges
On 25.02.2011 16:16, stephenb wrote: Bill, what will be the fastest way to output not just single lines but small data frames of about 60 rows? I prefer writing to a text file because the final output is large 47k times 60 rows and since I do not know the size of it I have to use rbind to

Re: [R] tansformation of variables in cph from rms package

2011-02-26 Thread Uwe Ligges
On 26.02.2011 15:43, Frank Harrell wrote: Yao, I wonder how likely it is that log transformations fit the data. More often I find that the flexibility of restricted cubic splines is needed. One of the things that people take for granted when using log() is that they are assuming that k=0 in

[R] Transform a dataset from long to wide using reshape2

2011-02-26 Thread John Kane
I seem to be running into the same problem reported in https://stat.ethz.ch/pipermail/r-help/2010-November/258265.html I cannot seem to transform a dataset from long to wide using reshape2. Clearly I am missing something very simple but a look at the manual and the reshape paper in JSS does not

Re: [R] Transform a dataset from long to wide using reshape2

2011-02-26 Thread Phil Spector
John - In the dat data frame, there is exactly one observation for each Subject/Item combination, so it's clear how to rearrange the values of Score. In the mydata data frame there are multiple values for most combinations of x and id, so reshape2 needs to aggregate y before it can

Re: [R] invalid type (list) for variable

2011-02-26 Thread Jannis
Michael, i have no experience with the Bayesian models you use, but I could imagine that the problem is that this classifiedPositive variable is a list (as you suggest as well). With unlist() as.character() as.factor() you can convert the variable to anything you may need as an input.

Re: [R] preventing repeat in paste

2011-02-26 Thread Dimitri Liakhovitski
This is great, thanks a lot, Gabor! On Fri, Feb 25, 2011 at 6:18 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Fri, Feb 25, 2011 at 5:21 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! s-start; e-end middle-as.character(c(1,2,3)) I would like to get the

[R] 2D Convolution in R

2011-02-26 Thread Wonsang You
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel - (1,2,3,2,1) data - array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is

Re: [R] Interactive/Dynamic plots with R

2011-02-26 Thread Tal Galili
Hello Abhishek, Also notice that if you are on windows, then rggobi doesn't work for the latest R (with ggobi 2.1.8) because of GTK/dll issues. In such a case, Greg's other suggestions are probably the way to go for the time being. Best, Tal Contact

[R] how to remove rows in which 2 or more observations are smaller than a given threshold?

2011-02-26 Thread hind lazrak
Hello The data set I am examining has 7425 observations (rows with unique identifiers) and 46 samples(columns). I have been trying to generate a dataset that filters out observations that are negligible The definition of negligible is absolute value less or equal to 1.58. The rule that I would

Re: [R] how to remove rows in which 2 or more observations are smaller than a given threshold?

2011-02-26 Thread Phil Spector
If the matrix in question is named mymat, then mymat[apply(mymat,1,function(x)sum(abs(x) = 1.58) 2),] (untested due to a lack of a reproducible example) should give you a matrix without any rows containing two or more values with absolute value less than 1.58. I'm not sure ifelse would be

Re: [R] how to remove rows in which 2 or more observations are smaller than a given threshold?

2011-02-26 Thread William Dunlap
You didn't say if your data set was a matrix or data.frame. Here are 2 functions that do the job on either and one that only works with data.frames, but is faster (a similar speedup is available for matrices as well). They all compute the number of small values in each row, nSmall, and extract

Re: [R] how to remove rows in which 2 or more observations are smaller than a given threshold?

2011-02-26 Thread hind lazrak
Dear Bill and Phil Many thanks for your help, your solutions worked perfectly. Bill: I did not specify whether the data was a matrix or dataframe because it is in fact the Expression file in an eset object (bioBase). Thank you so much again! Hind On Sat, Feb 26, 2011 at 4:34 PM, William Dunlap

Re: [R] Reproducibility issue in gbm (32 vs 64 bit)

2011-02-26 Thread Ridgeway, Greg
I have heard about this before happening on other platforms. Frankly I'm not positive how this happens. My best guess is that there's a tiny bit of numeric instability in the 9+ decimal place so that on a given iteration a one variable choice at random looks better than the other. Any other

Re: [R] [R-sig-ME] Fwd: Re: ANOVA and Pseudoreplication in R

2011-02-26 Thread Ben Ward
On 25/02/2011 21:22, Ben Ward wrote: Original Message Subject:Re: [R] ANOVA and Pseudoreplication in R Date: Fri, 25 Feb 2011 12:10:14 -0800 From: Bert Guntergunter.ber...@gene.com To: Ben Wardbenjamin.w...@bathspa.org CC: r-helpr-help@r-project.org I

Re: [R] Interpreting the example given by Prof Frank Harrell in {Design} validate.cph

2011-02-26 Thread vikkiyft
Thank you very very very much Prof Harrell!! You've made my day!! -- View this message in context: http://r.789695.n4.nabble.com/Interpreting-the-example-given-by-Prof-Frank-Harrell-in-Design-validate-cph-tp3316820p3325844.html Sent from the R help mailing list archive at Nabble.com.

[R] (no subject)

2011-02-26 Thread Hamaad Shah
Greetings, I have been trying to use the RInside package with C++ however I am running into an error. I use Ubuntu Linux 10.04 (64-bit) and my R version is 2.12.2. I compiled R from source to give me a shared R library, shared BLAS (ATLAS). When I try to compile one of the examples given in

[R] Help: Error en model.frame.defaul

2011-02-26 Thread Toni López Mayol
Hi and thanks to all R developers and helpers, I wanrt to take the 1 and 3 dimensions of this object to create a new one without the years and with the next functions to do some specific calculations: str(PMpa) num [1:499105, 1:60, 1:12] 29.8 55.8 29.7 25.1 25 ... - attr(*, dimnames)=List

Re: [R] help please ..simple question regarding output the p-value inside a function and lm

2011-02-26 Thread Umesh Rosyara
Hi Jorge and R users Thank you so much for the responses. You input helped me alot and potentially can help me to solve one more problem, but I got error message. I am sorry to ask you again but if you can find my problem in quick look that will be great. I hope this will not cost alot of your

Re: [R] Error

2011-02-26 Thread mathijsdevaan
Mean doesn't work either... I understand that the message replacement has 0 items, need 37597770 implies that the function is not returning any values, but I don't understand why then this is not the case in the example. DF = data.frame(read.table(textConnection(A B C D E 1 1 a 1999 1

[R] 2D Convolution Function

2011-02-26 Thread Wonsang You
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel - (1,2,3,2,1) data - array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is

Re: [R] grouping and counting in dataframe

2011-02-26 Thread zem
sry, new try: tm-c(12345,42352,12435,67546,24234,76543,31243,13334,64562,64123) gr-c(1,3,1,2,2,4,2,3,3,3) d-data.frame(cbind(time,gr)) where tm are unix times and gr the factor grouping by i have a skalar for example k=500 now i need to calculate in for every row how much examples in the

[R] Hello!

2011-02-26 Thread tsvi sabo
Hi,i would like to know what is the best way to write a procedure in R,it seems that when i run a script it doesn't wait for previouse code lines to be excuted,i would like to know how to force R to hold on a code line until it is processed,for example:i want to choose from a list the name of

[R] 2D Convolution Function

2011-02-26 Thread Wonsang You
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel - (1,2,3,2,1) data - array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is

[R] wireframe() display a graph with two colors, not a gradient.

2011-02-26 Thread James Platt
Hi all, I'm quite new to wireframe, essentially what I want to do is display a graph, and z-values 1 would be yellow and those 1 would be blue. This is a bit of my data. 0.334643563 0.350913807 0.383652307 0.370325283 0.38779016

Re: [R] Using uniroot() with output from deriv() or D()

2011-02-26 Thread jjheath
Hans, Both your methods worked great! They was exactly what I was looking for. I ended up using the second method as it is a little more efficient: fn2nd_fun - function(x) eval(fn2nd, list(x=x)) ex - seq(from=0, to=1, length.out = 1000) y1 - fn2nd_fun(ex) ... r -

Re: [R] [R-sig-ME] Fwd: Re: ANOVA and Pseudoreplication in R

2011-02-26 Thread Bert Gunter
Hi Ben: 1) Confession: I did not and have not read your post in detail. 2) IMHO, the following advice: Pseudo replication is really about a lack of independence between measurements, So you need to work backwards and see where you are building in a known lack of independence. And where that

[R] Weighting of variables‏

2011-02-26 Thread Christopher S
Dear All, I have run PCA using prcomp() and generated a loading plot using biplot(). In addition, I would like to extract the weighting for each of the variables in the loading plot so I can see which of the variables have the most influence on the distribution of the points in a 2D plot of

Re: [R] Hello!

2011-02-26 Thread Bert Gunter
Are you a fan of James Joyce? Is the Caps key on your keyboard broken? -- Bert On Sat, Feb 26, 2011 at 10:09 AM, tsvi sabo tsvis...@yahoo.com wrote: Hi,i would like to know what is the best way to write a procedure in R,it seems that when i run a script it doesn't wait for previouse code

Re: [R] Transform a dataset from long to wide using reshape2

2011-02-26 Thread John Kane
Thanks. I suddenly realised this as I was cycling down to the local grocery store, about 10 minutes after posting the problem. I felt like an idiot. Thanks for confirming my stupidity. john --- On Sat, 2/26/11, Phil Spector spec...@stat.berkeley.edu wrote: From: Phil Spector

[R] nested case-control study

2011-02-26 Thread array chip
Hi, I am wondering if there is a package for doing conditional logistic regression for nested case-control study as described in Estimation of absolute risk from nested case-control data by Langholz and Borgan (1997) where Horvitz-Thompson sampling weight (log of (number in the risk set

Re: [R] [R-sig-ME] Fwd: Re: ANOVA and Pseudoreplication in R

2011-02-26 Thread Robert A LaBudde
I think you are over-concerned with the term pseudo-replication. All this means is that the error source is nested, and not a full replicate. What you haven't done, and need to do, is to describe your experiment in terms of the real variables and error sources. Then code them as fixed or