Re: [R] help on IDE

2010-11-17 Thread Dennis Murphy
Hi: Since Deducer was mentioned, I'll add that Ian Fellows has recently released an 'all-in-one' installer for R, JGR and Deducer at http://ifellows.ucsd.edu/pmwiki/pmwiki.php?n=Main.WindowsInstallation Look for the Download Installer link (it's kinda hard to miss :) On my system (64-bit Win 7),

Re: [R] Problem with nlme package

2010-11-17 Thread Gavin Simpson
Did you load the package in R? Sounds like you didn't. Try require(nlme) Another possibility is that that function is hidden. Just to be sure, are you should be using it like this summary(mod) Not like this summary.lme(mod) HTH Gavin Sent from my HTC - Reply message - From: "Joann

[R] custom package not installed for 'arch=i386'

2010-11-17 Thread Yulia Arzhaeva
Dear all, Since version R-2.12.0, I've got problems building an add-on package for R ("imglib" here) for 32-bit Windows. The following command is called: C:\Program Files\R\R-2.12.0\bin\i386\Rcmd build --binary imglib And here is an error I am getting in the end of processing: ** testing if ins

[R] Updata Rdata File

2010-11-17 Thread Jason Kwok
How do I add data to a .rdata file? In my case, I have a time series that needs to get updated every day. Thanks, Jason [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] Fwd: Numerical integration

2010-11-17 Thread Hans W Borchers
Eduardo de Oliveira Horta gmail.com> writes: > > -- Forwarded message -- > From: Eduardo de Oliveira Horta gmail.com> > Date: Wed, Nov 17, 2010 at 3:59 PM > Subject: Re: [R] Numerical integration > To: David Winsemius comcast.net> > > It works, however is not very efficient fo

Re: [R] aspect ratio 1 and blank space

2010-11-17 Thread Peter Ehlers
On 2010-11-17 09:26, Silvia Cecere wrote: Hi, I need to produce an ordinary scatter plot and it is vital that the aspect ratio equals 1. I set the axis as: plot(x, y, type="n", asp=1, ,ylim=c(-80,70),xlim=c(0,100)). The problem is that I get some 'additional' blank plot area (basically, the

[R] plist file?

2010-11-17 Thread Nick Matzke
Hi all, I am running R.app on Mac OS X 10.4. I am trying to figure out if there is a .plist file of some sort, or a similar parameter file, that will let me turn on and off e.g. line-wrapping in the R.app GUI console. The only hint I could find online is this: https://stat.ethz.ch/pipermail

Re: [R] Globbing inconsistencies, dir() vs. unlink()

2010-11-17 Thread Henrik Bengtsson
Hi, note that to expand tilde, there is also path.expand() which should give less "surprises" than Sys.glob(). I can confirm that this is not only Windows, but also on Linux; > dir("~/ttt") [1] "foo.txt" > unlink("~/ttt", recursive=TRUE) > dir("~/ttt") [1] "foo.txt" > unlink(path.expand("~/ttt")

Re: [R] About R and RKward

2010-11-17 Thread Ajay Ohri
some comparisons for interfaces to R on desktop-draft from blog post (JSS paper is submitted for GUI issue but not vetted) http://decisionstats.com/2010/10/05/interfaces-to-r/ RKward is number 4 have you researched out all R commander E plugins before settling on R Kward R commander is by J F

[R] About R and RKward

2010-11-17 Thread Stephen Liu
Hi all, Has any folk tested or been using RKward? Please shed me some light whether it takes data from the spreadsheet, analyzes the data and puts the data back to the spreadsheet, similar to RExcel and "R and Calc". Or RKward is only an editor of R, working on front-end? I have tested REx

[R] On efficiency, Vectorize and loops

2010-11-17 Thread Eduardo de Oliveira Horta
In my last e-mails, I have asked for help regarding 1. 'defining functions inside loops' 2. 'integrating functions / vector arithmetics' 3. 'vectors out of lists?' 4. 'numerical integration' Since some of these topics seemed to be relevant (I'm guessing by the # of replies I got), I'm posting a mo

Re: [R] Multiple Line Plots with xyplot

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 5:38 PM, Elliot Joel Bernstein wrote: I'm trying to make multiple line plots, each with a different color, using the xyplot command. Specifically, I have an NxK matrix Y and an Nx1 matrix x. I would like the plot to contain a line for each (x, Y[,i]), i=1:K. I know some

[R] New Sampling question

2010-11-17 Thread wangwallace
I have another question about drawing samples from a data frame. This might sound really tricky. Let me use a data frame I have posted earlier as an example: SubIDCSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4 1 6 5 6 2 6 22 4 2

[R] Multiple Line Plots with xyplot

2010-11-17 Thread Elliot Joel Bernstein
I'm trying to make multiple line plots, each with a different color, using the xyplot command. Specifically, I have an NxK matrix Y and an Nx1 matrix x. I would like the plot to contain a line for each (x, Y[,i]), i=1:K. I know something like xyplot(Y[,1] + Y[,2] + Y[,3] ~ x, type='l') will w

Re: [R] Looking up the directory a file is located in

2010-11-17 Thread Cliff Clive
Basically I'm just looking for a command that can look up the name of the directory of the script that is running. If I move or copy the script to another directory, it should be able to read the name of the new directory without me having to edit the code. Once I have identified the directory,

[R] non linear constraints for a portfolio in fPortfolio package

2010-11-17 Thread Luis Felipe Parra
Hello, I would like to setup a non-linear constraint for a portfolio using the portfolioConstraint function. Does somebody now how to do this? thank you Felipe Parra [[alternative HTML version deleted]] __ R-help@r-project.org mailing list http

[R] portfolioConstraints

2010-11-17 Thread Luis Felipe Parra
Hello, I am trying to use portfolioConstraints from the fPortfolio package and y would like to write a constraint of the form t(w)*A=z where w is the weight vector I am optimizing on, A is another vector and a is a scalar (which can take zero value). Does somebody know how to setup this constrain

Re: [R] How to catch warnings

2010-11-17 Thread Michael Bedward
Hi Alex, Something like this ? x <- 1:4 y <- list(good=2:5, bad=3:5) for (yy in y) { tryCatch( x <- cbind(x, yy), warning=function(w) cat("problem values: ", yy, "\n") ) } Michael On 18 November 2010 03:19, Alaios wrote: > Hello when my code executes I receive the message tha

[R] Accessing variables inside a namespace

2010-11-17 Thread Santosh Srinivas
Hello Group, I am trying to see if there is way to access data that is inside another namespace. For e.g. the addATR function in the quantmod package calculates the ATR using the TTR package and then plots it to the graph. Now since it has already calculated the info that I need, can I access tha

[R] R package for sample selection with panel data

2010-11-17 Thread Jennifer Bréa
Echoing an older inquiry (https://stat.ethz.ch/pipermail/r-help/2008-November/180184.html), does anyone know of R code that exists to correct for sample selection with panel data as in: J.M. Wooldridge (1995), “Selection Corrections for Panel Data Models Under Conditional Mean Independence Ass

[R] Fwd: Numerical integration

2010-11-17 Thread Eduardo de Oliveira Horta
-- Forwarded message -- From: Eduardo de Oliveira Horta Date: Wed, Nov 17, 2010 at 3:59 PM Subject: Re: [R] Numerical integration To: David Winsemius It works, however is not very efficient for the problem I'm working with, since it is the same as vectorizing the integrand befor

[R] Any help understand the FKF package? Thanks.

2010-11-17 Thread Taste of R
  Dear Fellow R Users, I am experimenting right now the FKF package. I started by working out the first example included in the package and I am already confused. Would you offer some kind suggestions? What I want to do is to write down the state transition equation and the measurement equation

Re: [R] Drop non-integers

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 6:57 PM, Sam Albers wrote: On Wed, Nov 17, 2010 at 3:49 PM, David Winsemius > wrote: On Nov 17, 2010, at 6:27 PM, Sam Albers wrote: Hello all, I have a fairly simple data manipulation question. Say I have a dataframe like this: dat <- as.data.frame(runif(7, 3, 5))

Re: [R] translate vector of numbers to indicies of 0/1 matrix

2010-11-17 Thread Gabor Grothendieck
On Wed, Nov 17, 2010 at 6:00 PM, Alexander Shenkin wrote: > Hello All, > > Searched around, haven't found a decent solution. > > I'd like to translate a vector of numbers to a matrix (or to a list of > vectors) such that the vector values would serve as indicies of the 1's > in an otherwise-zero-f

Re: [R] Drop non-integers

2010-11-17 Thread Sam Albers
On Wed, Nov 17, 2010 at 3:49 PM, David Winsemius wrote: > > On Nov 17, 2010, at 6:27 PM, Sam Albers wrote: > > Hello all, >> >> I have a fairly simple data manipulation question. Say I have a dataframe >> like this: >> >> dat <- as.data.frame(runif(7, 3, 5)) >> dat$cat <- factor(c("1","4","13","1

Re: [R] Drop non-integers

2010-11-17 Thread Duncan Murdoch
On 17/11/2010 6:27 PM, Sam Albers wrote: Hello all, I have a fairly simple data manipulation question. Say I have a dataframe like this: dat<- as.data.frame(runif(7, 3, 5)) dat$cat<- factor(c("1","4","13","1","4","13","13A")) dat runif(7, 3, 5) cat 1 3.880020 1 2 4.062800 4

Re: [R] Drop non-integers

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 6:27 PM, Sam Albers wrote: Hello all, I have a fairly simple data manipulation question. Say I have a dataframe like this: dat <- as.data.frame(runif(7, 3, 5)) dat$cat <- factor(c("1","4","13","1","4","13","13A")) dat runif(7, 3, 5) cat 1 3.880020 1 2 4.

Re: [R] plot vs print ??

2010-11-17 Thread Greg Snow
Well, assuming this refers to the histogram function in the lattice package, looking at the code for print.trellis shows that the default behavior is to call plot.trellis with the same arguments. So unless you change the default behavior, there really is no difference between printing and plott

[R] Drop non-integers

2010-11-17 Thread Sam Albers
Hello all, I have a fairly simple data manipulation question. Say I have a dataframe like this: dat <- as.data.frame(runif(7, 3, 5)) dat$cat <- factor(c("1","4","13","1","4","13","13A")) dat runif(7, 3, 5) cat 1 3.880020 1 2 4.062800 4 3 4.828950 13 4 4.761850 1

Re: [R] ncdf4 for Windows/R-2.12.0

2010-11-17 Thread David Pierce
David Winsemius wrote: > >> Windows binary: not available, see ReadMe > > Sorry. Then in answer to your second question: > > http://cran.r-project.org/doc/manuals/R-admin.html > > Especially: > http://cran.r-project.org/doc/manuals/R-admin.html#The-Windows-toolset > > (At least as I read the t

Re: [R] ncdf4 for Windows/R-2.12.0

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 6:12 PM, phaaland wrote: This is what CRAN says about ncdf4: Windows binary: not available, see ReadMe Sorry. Then in answer to your second question: http://cran.r-project.org/doc/manuals/R-admin.html Especially: http://cran.r-project.org/doc/manuals/R-admin.html#The-W

Re: [R] translate vector of numbers to indicies of 0/1 matrix

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 6:00 PM, Alexander Shenkin wrote: Hello All, Searched around, haven't found a decent solution. I'd like to translate a vector of numbers to a matrix (or to a list of vectors) such that the vector values would serve as indicies of the 1's in an otherwise-zero-filled matr

Re: [R] ncdf4 for Windows/R-2.12.0

2010-11-17 Thread phaaland
This is what CRAN says about ncdf4: Windows binary: not available, see ReadMe -- View this message in context: http://r.789695.n4.nabble.com/ncdf4-for-Windows-R-2-12-0-tp3047807p3047829.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] translate vector of numbers to indicies of 0/1 matrix

2010-11-17 Thread Phil Spector
Alexander - If I understand your problem, I think this function will make the matrix you want: makeyourmatrix = function(vec){ n = length(vec) mat = matrix(0,n,n) mat[cbind(1:n,vec)] = 1 mat } makeyourmatrix(c(1,3,3,4)) [,1] [,2] [,3] [,4] [1,]1000 [2,]

Re: [R] ncdf4 for Windows/R-2.12.0

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 5:56 PM, phaaland wrote: We need to install the ncdf4 package for R-2.12.0 on Windows. There are is no binary available from CRAN Are you sure? This is the line on CRAN Package Check as of today, 6PM EST: ncdf 1.6.3 OK OK OK OK OK OK OK OK OK ERROR OK Brian Ripley

[R] translate vector of numbers to indicies of 0/1 matrix

2010-11-17 Thread Alexander Shenkin
Hello All, Searched around, haven't found a decent solution. I'd like to translate a vector of numbers to a matrix (or to a list of vectors) such that the vector values would serve as indicies of the 1's in an otherwise-zero-filled matrix (or list of vectors). For example: > a = c(1,3,3,4) # pe

[R] ncdf4 for Windows/R-2.12.0

2010-11-17 Thread phaaland
We need to install the ncdf4 package for R-2.12.0 on Windows. There are is no binary available from CRAN so it looks like a manual install will be required. Is there a guide for doing this? -- View this message in context: http://r.789695.n4.nabble.com/ncdf4-for-Windows-R-2-12-0-tp3047807p30478

Re: [R] Looking up the directory a file is located in

2010-11-17 Thread jim holtman
What do you expect it to look up? How do you want to specify the directory? Is it supposed to search through some sequence or use ESP? On Wed, Nov 17, 2010 at 4:08 PM, Cliff Clive wrote: > > Hello everyone, > > This should be an easy question, I think. > > I'd like to write a command in a progr

Re: [R] Problem with nlme package

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 5:22 PM, > wrote: The function is not exported from the package. You have to get tough with it, e.g. library(nlme) summary.lme Error: object 'summary.lme' not found But if you insist: nlme:::summary.lme function (object, adjustSigma = TRUE, verbose = FALSE, .

[R] Trouble with mixed model anova (incl. random block)

2010-11-17 Thread Philippe Hensel
Dear R community, I have slightly unbalanced survey/land elevation data (over 7,000 data points, grouped according to 60 transects, 30 in each of two treatments). Observations in both treatments are taken simultaneously, and the surveying of all 60 transects took 22 days. Comparisons among t

Re: [R] Problem with nlme package

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 5:07 PM, Joanna Geller wrote: Thanks for the suggestions - I tried all of them, including require(lme4) and require(nlme) and summary.lme still cannot be found. I want to use it to get full output of a multi-level model. Maybe it's a Mac thing? Any other suggestions would b

Re: [R] Problem with nlme package

2010-11-17 Thread Bill.Venables
The function is not exported from the package. You have to get tough with it, e.g. > library(nlme) > summary.lme Error: object 'summary.lme' not found But if you insist: > nlme:::summary.lme function (object, adjustSigma = TRUE, verbose = FALSE, ...) { fixed <- fixef(object) ... You ca

Re: [R] how to do linear regression when dimension is high

2010-11-17 Thread Quan Zhou
Thanks! it worked. this forum is so powerful! On Tue, Nov 16, 2010 at 12:20 PM, Douglas Bates wrote: > On Tue, Nov 16, 2010 at 10:30 AM, poko2000 > wrote: > > > Hi I am a newbie in R. > > I have data with dim of 20. > > How to use lm if i want to do regression with the whole design matrix? My >

Re: [R] Problem with nlme package

2010-11-17 Thread Joanna Geller
Thanks for the suggestions - I tried all of them, including require(lme4) and require(nlme) and summary.lme still cannot be found. I want to use it to get full output of a multi-level model. Maybe it's a Mac thing? Any other suggestions would be much appreciated! Thanks, again. On Wed, Nov 17, 2

[R] Label positions for the legend when using smallplot within image.plot

2010-11-17 Thread Alberte Bondeau (PIK)
Hi all, after having many images plots on my window, I want to have one single legend plot. For that I use image.plot where the position is defined within smallplot: image.plot(legend.only=T,zlim=c(0,400), col=rainbow(50),horizontal=T,smallplot=c(.05,.45, .03,.06)) This works fine, bu

[R] Looking up the directory a file is located in

2010-11-17 Thread Cliff Clive
Hello everyone, This should be an easy question, I think. I'd like to write a command in a program to set the working directory to whatever directory the file is currently stored in. Suppose I have a file called "myRscript.r", and it's stored in "C:\Rprojects\myRscript.r", and it references ot

Re: [R] Problem with nlme package

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 4:48 PM, David Winsemius wrote: On Nov 17, 2010, at 4:39 PM, Joanna Geller wrote: Hello, I have installed the nlme package, but every time I try to use the function "summary.lme," How did you "try to use it"? I get a message that the function cannot be found. If i

Re: [R] Problem with nlme package

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 4:39 PM, Joanna Geller wrote: Hello, I have installed the nlme package, but every time I try to use the function "summary.lme," How did you "try to use it"? I get a message that the function cannot be found. If it says it cannot be found, then you quite possibly forg

Re: [R] Vectors out of lists?

2010-11-17 Thread Bill.Venables
That was my thought, and if you are going to be integrating it, you do need to be concerned with efficiency to some extent, I would imagine. My experience is that Vecotrize() is theoretically interesting and it is great for getting you out of a tight spot like this, but if you can avoid it witho

[R] Problem with nlme package

2010-11-17 Thread Joanna Geller
Hello, I have installed the nlme package, but every time I try to use the function "summary.lme," I get a message that the function cannot be found. I've tried to install the package several times and have re-started R several times, but to no avail. I have also loaded the lme4 package, in case th

Re: [R] efficient conversion of matrix column rows to list elements

2010-11-17 Thread Chris Carleton
Thanks for the suggestion. The solution below is much better than my round-about way. combn(outcomes, 2, list ) I can't do much about the speed of combn() so I wanted to trim the fat wherever else I could. C On 17 November 2010 15:10, Charles C. Berry wrote: > > On Wed, 17 Nov 2010, Chris Carl

Re: [R] help on IDE

2010-11-17 Thread Liviu Andronic
On Wed, Nov 17, 2010 at 7:41 PM, Partha Sinha wrote: > I am new comer in R.There r few IDE like Tinn R,VIM etc.I mean How to > use them? Do I need to install R and then install them to use or they > can work alone? Also does one install packages on R or IDEs? Can I > call/use the package from IDEs

Re: [R] Regexp question

2010-11-17 Thread Gabor Grothendieck
On Wed, Nov 17, 2010 at 2:59 PM, johannes rara wrote: > I have a vector like this: > > a <- c("thisIsName", "thisIsAlsoName", "andThisName") > > How to break this into pieces and produce a vector with unique parts: > > this > Is > Name > Also > and > This Try this: library(gsubfn) strapply(a, ".

Re: [R] Regexp question

2010-11-17 Thread johannes rara
Great, thanks! 2010/11/17 Henrique Dallazuanna : > Try this: > > Reduce(union, strsplit(gsub("([A-Z])", ";\\1", a), ";")) > > On Wed, Nov 17, 2010 at 5:59 PM, johannes rara > wrote: >> >> I have a vector like this: >> >> a <- c("thisIsName", "thisIsAlsoName", "andThisName") >> >> How to break thi

[R] Q reg accessing "HAVER" from R

2010-11-17 Thread amit jain
has anyone accessed Haver from R ? I have their api for connection to vb , c++ and other softwares...has anyone tried to use that api with R ? Any other help in this regard would be much appreciated. Thanks Amit __ R-help@r-project.org mailing list h

Re: [R] Regexp question

2010-11-17 Thread Henrique Dallazuanna
Try this: Reduce(union, strsplit(gsub("([A-Z])", ";\\1", a), ";")) On Wed, Nov 17, 2010 at 5:59 PM, johannes rara wrote: > I have a vector like this: > > a <- c("thisIsName", "thisIsAlsoName", "andThisName") > > How to break this into pieces and produce a vector with unique parts: > > this > Is

Re: [R] efficient conversion of matrix column rows to list elements

2010-11-17 Thread Charles C. Berry
On Wed, 17 Nov 2010, Chris Carleton wrote: Hi List, I'm hoping to get opinions for enhancing the efficiency of the following code designed to take a vector of probabilities (outcomes) and calculate a union of the probability space. As part of the union calculation, combn() must be used, which r

[R] kalman filter in sspir

2010-11-17 Thread feder
Hi, I used sspir for managing non-gaussian State space models but I observed that for such models only the smoother is gave while the filter is missing. Why? -- View this message in context: http://r.789695.n4.nabble.com/kalman-filter-in-sspir-tp3047486p3047486.html Sent from the R help mailing

[R] Regexp question

2010-11-17 Thread johannes rara
I have a vector like this: a <- c("thisIsName", "thisIsAlsoName", "andThisName") How to break this into pieces and produce a vector with unique parts: this Is Name Also and This -J __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

Re: [R] Parameterising apply To Compute Rolling Average of Columns in a matrix

2010-11-17 Thread Ray Brownrigg
On Thu, 18 Nov 2010, Paolo Rossi wrote: > I sent a post to find a clever way to compute a Rolling Average of columns > in a matrix and I was given the solution below which I am very pleased > with. > > > RollingAverage <- function(x, RollingObs) { > cx <- cumsum(x); > N <- length(x); > Temp <-

Re: [R] where are my pspline knots?

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 1:05 PM, Federico Calboli wrote: Hi All, I am trying to figure out how to get the position of the knots in a pspline used in a cox model. As far as I understand it, the term "knot" should be used with natural splines, but not for penalized smoothing splines. See p 124

Re: [R] Parameterising apply To Compute Rolling Average of Columns in a matrix

2010-11-17 Thread Henrique Dallazuanna
You've tried? apply(a, 2, RollingAverage, 7) On Wed, Nov 17, 2010 at 5:27 PM, Paolo Rossi < statmailingli...@googlemail.com> wrote: > I sent a post to find a clever way to compute a Rolling Average of columns > in a matrix and I was given the solution below which I am very pleased > with. > > >

[R] modify the scalebar in cor.plot {psych}?

2010-11-17 Thread Lara Poplarski
Dear List, I am working with a relatively large correlation matrix (~1600*1600), which I am looking to plot with function cor.plot in package psych. cor.plot draws a scalebar with as many tick marks/subdivisions as there are rows in the matrix, which makes the values unreadable even for relativel

[R] Parameterising apply To Compute Rolling Average of Columns in a matrix

2010-11-17 Thread Paolo Rossi
I sent a post to find a clever way to compute a Rolling Average of columns in a matrix and I was given the solution below which I am very pleased with. RollingAverage <- function(x, RollingObs) { cx <- cumsum(x); N <- length(x); Temp <- (cx[RollingObs:N] - c(0, cx[1:(N-RollingObs)]))/RollingO

[R] unserialize form rawConnection possibe?

2010-11-17 Thread Saptarshi Guha
Hello, Consider this little function (not concerned about efficiency here) m=function(r) { a<-serialize(r,NULL); zz<-rawConnection(raw(0),"r+"); writeBin(length(a),zz); c(rawConnectionValue(zz),a)} a=m(10) p=rawConnection(a,"r+"); u=readBin(p,"int") unserialize(p) Error in unserialize(p) : unk

Re: [R] Working with "necessary" columns in R (CSV)

2010-11-17 Thread Petr Savicky
On Wed, Nov 17, 2010 at 08:19:53PM +0200, arturs.onz...@gmail.com wrote: > Hi all. It will be great if some one will help me to solve my home task. So, > the deal : i have .pcap file, i convert it to csv using tcpdump (tcpdump -tt > -n -r x.pcap > x.csv) > > CSV file looks like that : > > 1289008

[R] efficient conversion of matrix column rows to list elements

2010-11-17 Thread Chris Carleton
Hi List, I'm hoping to get opinions for enhancing the efficiency of the following code designed to take a vector of probabilities (outcomes) and calculate a union of the probability space. As part of the union calculation, combn() must be used, which returns a matrix, and the parallelized version

Re: [R] help on IDE

2010-11-17 Thread Jonathan P Daily
Each IDE is going to have its own setup that will also usually depend on what type of computer you are running. EMACS, for instance, requires a pre-existing R install with the 'ess' package (packages are usually installed inside R). Geany, on the other hand, requires an R install and, in some c

[R] Cox model output & hazard ratios

2010-11-17 Thread Julien Vezilier
Dear R users, Here is the coxme output I obtain on my survival dataset having 3 strains and 2 infection status (i: infected, ni: non infected) coxme(Surv(lay) ~ infection*strain, data=datalay, random= ~1 |block) Cox mixed-effects model fit by maximum likelihood Data: datalay n= 1194 Iteration

Re: [R] Computing Rolling Average

2010-11-17 Thread Paolo Rossi
Thanks to everyone. Paolo On 16 November 2010 20:14, William Dunlap wrote: > Have you tried filter()? > filter(a, rep(1,7)/7) > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-project.org > > [mailto:r-help-boun...@r-p

[R] help on IDE

2010-11-17 Thread Partha Sinha
I am new comer in R.There r few IDE like Tinn R,VIM etc.I mean How to use them? Do I need to install R and then install them to use or they can work alone? Also does one install packages on R or IDEs? Can I call/use the package from IDEs? regards Parth -- Socrates, proclaimed: "I came to know one

Re: [R] Vectors out of lists?

2010-11-17 Thread Bert Gunter
Eduardo: On Wed, Nov 17, 2010 at 9:53 AM, Eduardo de Oliveira Horta wrote: > Thanks. > > I wanted to avoid loops (even inside functions) because I thought they were > much slower than vector operations, and I really need an efficient code (not > an exercise!). This is a common miconception. What

Re: [R] Vectors out of lists?

2010-11-17 Thread Joshua Wiley
On Wed, Nov 17, 2010 at 9:42 AM, William Dunlap wrote: > Don't fixate on avoiding loops.   Bury them in a function > so you don't have to see them and then you just want something > that does the right thing quickly enough.  (I'm assuming > this is not a homework/puzzle type problem where you are

[R] lme weights glht

2010-11-17 Thread Sibylle Stöckli
Dear R-user I used lme to fit a linear mixed model inlcuding weights=varPower(). Additionally I wanted to use glht to calculate Tukey-Kramer multiple comparision. error: > glht(modelF, linfct=mcp(Species="Tukey")) Error in glht.matrix(model = list(modelStruct = list(reStruct = list(SubPl

[R] Working with "necessary" columns in R (CSV)

2010-11-17 Thread arturs . onzuls
Hi all. It will be great if some one will help me to solve my home task. So, the deal : i have .pcap file, i convert it to csv using tcpdump (tcpdump -tt -n -r x.pcap > x.csv) CSV file looks like that : 12890084,761659 IP 10.10.20.20.47808 > 10.10.20.255.47808: UDP, length 12 12890084,761659 IP 1

Re: [R] aspect ratio 1 and blank space

2010-11-17 Thread Bert Gunter
On Windows R 2.12.0, the following seemed to work for me: par(pty="s") ## before plotting plot(1:10,xlim=c(0,20),ylim=c(0,30)) I do not find that setting the asp parameter does anything useful; indeed, the Help documentation seems to be backwards (asp=x/y not y/x). I probably misunderstood and/

[R] where are my pspline knots?

2010-11-17 Thread Federico Calboli
Hi All, I am trying to figure out how to get the position of the knots in a pspline used in a cox model. my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous How do I find out where the knot of the spline are? I would like to know to figure out how many case

[R] inar(1), time series of count data

2010-11-17 Thread sahin
Hello, is there anyone, who works with modelling of time series of count data. I try to model traffic accidents with inar(1)-models, but I have a lot of problems with the R-Code. I would be very grateful, if someone helped me. Nazli __ R-help@r

Re: [R] Vectors out of lists?

2010-11-17 Thread William Dunlap
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap > Sent: Wednesday, November 17, 2010 9:42 AM > To: Eduardo de Oliveira Horta > Cc: r-help@r-project.org

Re: [R] Vectors out of lists?

2010-11-17 Thread Eduardo de Oliveira Horta
Thanks. I wanted to avoid loops (even inside functions) because I thought they were much slower than vector operations, and I really need an efficient code (not an exercise!). However, after a few tentatives I'm coming to the conclusion that loops are actually MORE efficient (at least in the type

Re: [R] Vectors out of lists?

2010-11-17 Thread William Dunlap
Don't fixate on avoiding loops. Bury them in a function so you don't have to see them and then you just want something that does the right thing quickly enough. (I'm assuming this is not a homework/puzzle type problem where you are not allowed to use loops). E.g., the following does the job (wi

[R] aspect ratio 1 and blank space

2010-11-17 Thread Silvia Cecere
Hi, I need to produce an ordinary scatter plot and it is vital that the aspect ratio equals 1. I set the axis as: plot(x, y, type="n", asp=1, ,ylim=c(-80,70),xlim=c(0,100)). The problem is that I get some 'additional' blank plot area (basically, the lower bound of xlim becomes quite negative

Re: [R] : plot different axis, same plot position

2010-11-17 Thread jim holtman
I think this is what you want for the 'axis' command: axis(1, at = x, labels = T, las=2) On Wed, Nov 17, 2010 at 12:19 PM, Pelt van, Saskia (KNMI) wrote: > Dear R-users, > > I am trying to make a plot in R where x and y are plotted in a regular way, > but the x axis corresponds to another set

[R] : plot different axis, same plot position

2010-11-17 Thread Pelt van, Saskia (KNMI)
Dear R-users, I am trying to make a plot in R where x and y are plotted in a regular way, but the x axis corresponds to another set of values. For example I have x,y and T (all 29 values) x<- c( -1.31846232, -1.04744756, -0.87034853, -0.72883370, -0.60618971, -0.49501845, -0.39128988, -0.

Re: [R] Multiple plots in one window

2010-11-17 Thread Dennis Murphy
Hi: Try this: pf <- function(p) { plot(c(p:(p+10)),c(1:11)) plot(c(p:(p+10)),c(2:12)) plot(c(p:(p+10)),c(3:13)) } par(mfrow = c(3, 3)) for(i in 1:3) pf(i) par(mfrow = c(1, 1)) HTH, Dennis On Wed, Nov 17, 2010 at 8:56 AM, Soyeon Kim wrote: > Dear All, > > I made a function which gives 3

[R] Multiple plots in one window

2010-11-17 Thread Soyeon Kim
Dear All, I made a function which gives 3 plots in one window(I used par(mfrow=c(1,3)) in the function). Using that function 3 times, I want to produce 9 plots in one window. I tried par(mfrow=c(3,1)) or par(mfrow=c(3,3)) but it didn't work. For example, pf <- function(p) { par(mfrow=c(1,3))

Re: [R] Fit a distribution to an "ECDF"

2010-11-17 Thread MyKenk
Actually, after thinking about this, what I want to do is to fit a curve (Weibull and LogLogistic) to the first 9 data points in the series. The numbers represent percent of development, and I don't "trust" the 1.000 point, so I want to fit these curves to get 2 estimates of the tail, both a thick

Re: [R] rgl, multiple graphics ??

2010-11-17 Thread Ben Bolker
skan gmail.com> writes: > How can I get multipanel conditioning graphics with rgl as I do with lattice > "|" > > For example I have three variables x, y, z, w. Where x,y,z are continuous > and w is categorical or discrete. > I want to use plot3d(x,y,z) for each value of w in a panel > somethin

Re: [R] Vectors out of lists?

2010-11-17 Thread Phil Spector
Bill - An excellent point, especially if you're concerned about efficiency: Y = list(sqrt,sin,function(u)u/2) Ybar0 = function(u)mean(sapply(Y,function(fun)fun(u))) Ybar1 = function(u) rowMeans(sapply(Y, function(fun) fun(u))) system.time(one <- Vectorize(Ybar0)(seq(0,1,length=1)))

Re: [R] stacking consecutive columns

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 10:37 AM, Graves, Gregory wrote: Follows is the exact solution to this: v <- NULL #note that decreasing is FALSE so preceding year preceeds for(i in 2:46) { kk <- melt(yearmonth[, c(1, i, i+1)], id.vars="month", variable_name="year") v[[i-1]] <- kk[order(kk$year, decre

[R] How to catch warnings

2010-11-17 Thread Alaios
Hello when my code executes I receive the message that were some warnings. I want to catch warning messages at run time so to print some local variables and try to understand why this warning happens. I searched on internet and I tried withCallingHandlers( which seems to work but as I used Rkwar

[R] test of the effect of a polytomous explanatory variable (nominal scale) in glm with quasi

2010-11-17 Thread Eiiti Kasuya
When a polytomous variable (nominal scale) is used as an explanatory variable in GLM (generalized linear models), the result object or summary of glm function does not show the effect of this variable. In this case, anova function can be used. My question is on the appropriate procedure(s) for tes

Re: [R] Give me all operator

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 9:26 AM, Alaios wrote: It seems that I am confusing something: List of 50 $ :List of 2 ..$ CRmap: logi [1:100, 1:100] NA NA NA NA NA NA ... ..$ xy : num [1:2] 21 11 $ :List of 2 ..$ CRmap: logi [1:100, 1:100] NA NA NA NA NA NA ... ..$ xy : num [1:2] 80 68 la

[R] rasterImage and coordinate conversion

2010-11-17 Thread Rajarshi Guha
Hi, I have a plot and I would like to overlay a PNG image over it. I'm using the rasterImage function to do this, but the problem I'm facing is working out the coordinates of the upper right corner of the final image in user coordinates. That is I can place the image so the lower left is located a

Re: [R] statistical test for comparison of two classifications (nominal)

2010-11-17 Thread Martin Tomko
Thank you Matta for the great suggestion, I will try the additional tests. I have just been experimenting with the e1071 package and the adjustedRand. It works perfectly, The only outstadning question is interpretation - is there any rule of thumbs for the level of agreement that needs to be re

Re: [R] Numerical integration

2010-11-17 Thread David Winsemius
On Nov 17, 2010, at 6:44 AM, Eduardo de Oliveira Horta wrote: Hi! I was wondering if there are any other functions for numerical integration, besides 'integrate' from the stats package, but which wouldn't require the integrand to be vectorized. Oh, and must be capable of integrating over

Re: [R] Give me all operator

2010-11-17 Thread Joshua Wiley
MyStruct <- list(list(CRmap = rnorm(50), xy = 1:50), list(CRmap = rnorm(50), xy = 51:100)) I wonder if it would be possible to extend indexing to accept lists. For example: MyStruct[[c(1, 2)]] extracts level1[1] and level2[2], so if the vector was a list, perhaps MyStruct[[list(c(1, 2), 2)]] ## l

Re: [R] statistical test for comparison of two classifications (nominal)

2010-11-17 Thread Mattia Prosperi
Another useful measure to compare partitions is the adjusted Rand index which is implemented in the library(e1071) within the classAgreement function. If you have your data partitions to be compared in a matricial form (where each column is a different partition), the syntax is ARI<-classAgreement(

[R] rgl, multiple graphics ??

2010-11-17 Thread skan
Hello How can I get multipanel conditioning graphics with rgl as I do with lattice "|" For example I have three variables x, y, z, w. Where x,y,z are continuous and w is categorical or discrete. I want to use plot3d(x,y,z) for each value of w in a panel something like plot3d(z~x*y|w) cheers

[R] rgl, multiple graphics ??

2010-11-17 Thread skan
Hello How can I get multipanel conditioning graphics with rgl as I do with lattice "|" For example I have three variables x, y, z, w. Where x,y,z are continuous and w is categorical or discrete. I want to use plot3d(x,y,z) for each value of w in a panel something like plot3d(z~x*y|w) cheers

  1   2   >