Re: [R] Legend symbols mixed char and integer

2010-11-27 Thread Prof Brian Ripley
On Sat, 27 Nov 2010, Mike Prager wrote: Dear Gurus, R 2.11.1 on Windows XP. This is a problem in interaction between R and pdftex. I need to generate a plot with both open and filled circles. It is simple enough, using pch=1 and pch=16. The R pdf graphics output is going into pdftex 1.40.10

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Marius Hofert
Dear Peter, thanks a lot, modifyList() did it perfectly! Cheers, Marius On 2010-11-28, at 01:26 , Peter Ehlers wrote: > On 2010-11-27 15:03, Marius Hofert wrote: >> Dear Peter, >> >> do you know anything similar for a cloud() plot? >> This does not work: >> >> library(lattice) >> x<- matrix

[R] Legend symbols mixed char and integer

2010-11-27 Thread Mike Prager
Dear Gurus, R 2.11.1 on Windows XP. This is a problem in interaction between R and pdftex. I need to generate a plot with both open and filled circles. It is simple enough, using pch=1 and pch=16. The R pdf graphics output is going into pdftex 1.40.10 (MikTeX 2.8). The R pdf is correct when vi

Re: [R] Combind two different vector

2010-11-27 Thread Gabor Grothendieck
On Sat, Nov 27, 2010 at 1:56 PM, Georg Ruß wrote: > On 27/11/10 19:04:27, Serdar Akin wrote: >>    Hi >>    No its has to be like this: >>    a b >>    1 1 >>    2 2 >>    3 3 >>      4 >>      5 >>      6 > Assuming the empty cells are to be NAs turn a and b into ts objects (since ts objects w

Re: [R] Two time measures

2010-11-27 Thread Bill.Venables
I think all you need is ?split -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Eduardo de Oliveira Horta Sent: Sunday, 28 November 2010 8:02 AM To: r-help@r-project.org Subject: [R] Two time measures Hello! I have a csv file of

Re: [R] \Sweaveopts error

2010-11-27 Thread John Maindonald
Actually, I had until I created this file had everything on one line, or had separate \SweaveOpts commands. Putting everything on one line ensures that the graphics file goes to the subdirectory snArt, but the file test1.tex is unchanged. Note however the difference between the files test1.tex an

Re: [R] \Sweaveopts error

2010-11-27 Thread Duncan Murdoch
On 27/11/2010 7:57 PM, John Maindonald wrote: Actually, I spoke too soon. The files process without obvious error, but keep.source=TRUE is ignored. I have posted small files test1.Rnw and test2.Rnw that can be used to demonstrate the problems at: http://wwwmaths.anu.edu.au/~johnm/r/issues/

Re: [R] \Sweaveopts error

2010-11-27 Thread Duncan Murdoch
On 27/11/2010 7:57 PM, John Maindonald wrote: Actually, I spoke too soon. The files process without obvious error, but keep.source=TRUE is ignored. I have posted small files test1.Rnw and test2.Rnw that can be used to demonstrate the problems at: http://wwwmaths.anu.edu.au/~johnm/r/issues/

Re: [R] \Sweaveopts error

2010-11-27 Thread John Maindonald
Actually, I spoke too soon. The files process without obvious error, but keep.source=TRUE is ignored. I have posted small files test1.Rnw and test2.Rnw that can be used to demonstrate the problems at: http://wwwmaths.anu.edu.au/~johnm/r/issues/ Sweave("test1") ## includes SweaveOpts settin

Re: [R] Two time measures

2010-11-27 Thread Gabor Grothendieck
On Sat, Nov 27, 2010 at 5:02 PM, Eduardo de Oliveira Horta wrote: > Hello! > > I have a csv file of intra-day financial data (5-min closing prices) that > looks like this: (obs - the dates are formated as day/month/year, as is > usual here in Brazil) > > Date;Time;Close > 01/09/2009;10:00;56567 >

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

2010-11-27 Thread Gabor Grothendieck
On Wed, Nov 17, 2010 at 2:27 PM, 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. > There is a zoo function that does this. The following converts a to zoo, performs t

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Peter Ehlers
On 2010-11-27 15:03, Marius Hofert wrote: Dear Peter, do you know anything similar for a cloud() plot? This does not work: library(lattice) x<- matrix(runif(900),ncol=3) cloud(x[,3]~x[,1]*x[,2],scales = list(col = 1, arrows=FALSE), par.settings = list(standard.theme(color=FALS

Re: [R] return vector of element names for vector, matrix or array

2010-11-27 Thread Joshua Wiley
Hi Dr. Friendly, On Sat, Nov 27, 2010 at 2:56 PM, Michael Friendly wrote: >  Just as as.vector() takes a vector, matrix or array and returns a vector in > row-major order, > I'd like to write a function to take such an object and return the dimension > names, > pasted with some separator, as a si

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Marius Hofert
Dear Peter, do you know anything similar for a cloud() plot? This does not work: library(lattice) x <- matrix(runif(900),ncol=3) cloud(x[,3]~x[,1]*x[,2],scales = list(col = 1, arrows=FALSE), par.settings = list(standard.theme(color=FALSE), axis.line=list(col="t

Re: [R] How to load data file without attribute names?

2010-11-27 Thread Jim Lemon
On 11/27/2010 11:45 PM, 44whyfrog wrote: Hi all, I'm new to R and I'm struggling with loading a data file without attribute names, like: 1,72,0,5.6431,28.199 1,72,0,12.666,28.447 1,72,0,19.681,28.695 1,72,0,25.647,28.905 It has no names for the columns nor the rows. I tried data<- read.table

[R] return vector of element names for vector, matrix or array

2010-11-27 Thread Michael Friendly
Just as as.vector() takes a vector, matrix or array and returns a vector in row-major order, I'd like to write a function to take such an object and return the dimension names, pasted with some separator, as a similar vector. Here is something ugly cobbled together to demonstrate what I want:

Re: [R] Two time measures

2010-11-27 Thread jim holtman
Try this: > x <- structure(list(Date = c("01/09/2009", "01/09/2009", "01/09/2009", + "01/09/2009", "01/09/2009", "01/09/2009", "02/09/2009", "02/09/2009", + "02/09/2009", "02/09/2009", "02/09/2009", "02/09/2009"), Time = c("10:00", + "10:05", "10:10", "16:45", "16:50", "16:55", "10:00", "10:05", +

Re: [R] Tinn R to R problem

2010-11-27 Thread Rudev
Hi there, Thanks a lot. It helped. Best, Rudra On Wed, Nov 24, 2010 at 3:34 PM, JCFaria [via R] < ml-node+3058122-1766967341-203...@n4.nabble.com > wrote: > Hello, > > All you need are explained at Help/Main/User guide/HTML from Tinn-R menu. > > Basically: > 1. Close R > 2. Menu R/Configure/

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

2010-11-27 Thread Paolo Rossi
Awesome - thanks! Paolo On 17 November 2010 19:44, Ray Brownrigg wrote: > 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. > > > > > > R

[R] Two time measures

2010-11-27 Thread Eduardo de Oliveira Horta
Hello! I have a csv file of intra-day financial data (5-min closing prices) that looks like this: (obs - the dates are formated as day/month/year, as is usual here in Brazil) Date;Time;Close 01/09/2009;10:00;56567 01/09/2009;10:05;56463 01/09/2009;10:10;56370 ##(goes on all day) 01/09/2009;16:45;

Re: [R] Combind two different vector

2010-11-27 Thread Jorge Ivan Velez
Hi Serdar, One way would be: l <- list(a, b) do.call(cbind, lapply(l, function(x) x[1:max(sapply(l, length))])) HTH, Jorge On Sat, Nov 27, 2010 at 10:04 AM, Serdar Akin <> wrote: > Hi > > I'm trying two combine two vectors that have different lengths. This > without > recursive the shorter on

Re: [R] Combind two different vector

2010-11-27 Thread Georg Ruß
On 27/11/10 19:04:27, Serdar Akin wrote: >Hi >No its has to be like this: >a b >1 1 >2 2 >3 3 > 4 > 5 > 6 Hmm, "empty" elements in such an array? Seems not really recommended, if it's possible at all. You may try filling up the shorter vector with NA's or any

[R] lattice: remove box around wireframe (*follow-up*)

2010-11-27 Thread Marius Hofert
okay, solved :-)) It is mentioned here: http://r.789695.n4.nabble.com/How-to-remove-outer-box-from-Wireframe-plots-td824819.html so ... wireframe(z ~ x*y, data = test, scales = list(col = "black", arrows = FALSE), par.settings = list(axis.line = list(col = "transparent"))) ... solves it. Cheer

[R] lattice: remove box around wireframe (*follow-up*)

2010-11-27 Thread Marius Hofert
Dear expeRts, below is a minimal example from the thread http://www.mail-archive.com/r-help@r-project.org/msg48098.html about how to remove the outer box / frame of a wireframe plot. As one can see, the suggested code does remove the box (by making it transparent), however, it also removes the

Re: [R] Matrix Operations

2010-11-27 Thread Wu Gong
Hi Romildo, Merge two table by id2 first, then reshape to the wide format, sum by source at last. Hope it helps. ### Data simulation lsp.text <- " id source destiny id2 caminho order 1 1 2 4 7 0 0 2 2 6 10 4 0 0 3 3 6

Re: [R] multivariate analysis

2010-11-27 Thread Kjetil Halvorsen
if you want linear models (not specified), something like this should work: Put your 1800 response variables (as columns) in a nx1800 matrix resp_mat, and then lm(resp_mat ~ latitude*age) # interactions lm(resp_mat ~ latitude+age # without interactions Kjetil On Fri, Nov 26, 2010 at 9:01 PM,

Re: [R] Combind two different vector

2010-11-27 Thread Georg Ruß
On 27/11/10 16:04:35, Serdar Akin wrote: > I'm trying two combine two vectors that have different lengths. This without > recursive the shorter one. E.g., > > a <- seq(1:3) > b <- seq(1:6) If that means your output should be (1 2 3 1 2 3 4 5 6) then c <- c(a,b) should solve this. Looks like _the_

[R] Combind two different vector

2010-11-27 Thread Serdar Akin
Hi I'm trying two combine two vectors that have different lengths. This without recursive the shorter one. E.g., a <- seq(1:3) b <- seq(1:6) Thanks in advance Serdar [[alternative HTML version deleted]] __ R-help@r-project.org mailing list h

Re: [R] Applying function to elements of matrices in a list

2010-11-27 Thread statmobile
On 11/25/2010 10:30 AM, Peter Ehlers wrote: On 2010-11-25 07:06, statmobile wrote: On 11/25/2010 09:44 AM, Dimitris Rizopoulos wrote: try this: Reduce("+", x) / length(x) Thanks Dimitris, that's very slick, I was unaware of this Reduce function. The issue, is that I actually wanted to do a

Re: [R] R Console - pasting into

2010-11-27 Thread Peter Ehlers
On 2010-11-26 22:33, Troy Lynch wrote: Thank you, Joshua -- great name by the way; he was a Biblical champ! -- fro your suggestion. Sorry about the belated response. Nope, even the script editor will not allow pastes (after the R Console has also refused to allow pastes). I do agree that it is p

Re: [R] How to search the name of dataset on database

2010-11-27 Thread Sebastian Gibb
Am Samstag, 27. November 2010, 15:59:46 schrieb Stephen Liu: > Hi folks, > > I can't figure out using help.search to find the name of the dataset on > database. If it is NOT the right tool please advise which tool shall I > use? TIA > > B.R. > Stephen L > > > > [[alternative HTML versio

Re: [R] help: program efficiency

2010-11-27 Thread Mike Marchywka
> > So in this example, it seems more efficient to sort first and use the > algorithm assuming that the data is sorted. > > There is probably a way to be smarter in nodup_cpp where the bottleneck > is likely to be related to map::find. If you just use a hash table, std::map should work too, I d

[R] How to search the name of dataset on database

2010-11-27 Thread Stephen Liu
Hi folks, I can't figure out using help.search to find the name of the dataset on database. If it is NOT the right tool please advise which tool shall I use? TIA B.R. Stephen L [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Problem with installing RWinEdt on Win 7

2010-11-27 Thread Raghu Naik
I am having problems installing RWinEdt on a Windows 7 machine after upgrading to R 2.12 and running R as an administrator. I have WinEdt 5.x installed on my machine (no WinEdt 6). Please see the r session as below. Would appreciate any feedback. Thx. _

[R] Matrix Operations

2010-11-27 Thread Romildo Martins
Hello, Given the matrices LSPs and services, need to generate the matrix (mtraffic) as follows: 1. Browse all lines of LSPs 2. Collect the value of bw (matrix services) in accordance with id2 3. Sum bw in mtraffic (line = source) (column = destiny) Thanks! Romildo Martins ***

Re: [R] help: program efficiency

2010-11-27 Thread Romain Francois
Hello, Someone pointed out to me off list about this construct: nodup_sort <- function(x, fun = nodup3){ i <- sort.list(x) x[i] <- fun(x[i]) x } which deals more efficiently with the reordering. > x <- sample( 1:10, size = 30, replace = TRUE ) > system.time( nodup_cpp( x )

Re: [R] How to load data file without attribute names?

2010-11-27 Thread jim holtman
You need to follow the posting guide and show exactly what you did. I read in your data and can print it. You did not show what 'x', and 'y' were in your data: > myData <- read.table('clipboard', sep=',') > myData V1 V2 V3 V4 V5 1 1 72 0 5.6431 28.199 2 1 72 0 12.6660 28.447 3

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Marius Hofert
Thanks very much, exactly what I was looking for :-))) Cheers, Marius On 2010-11-27, at 13:16 , Peter Ehlers wrote: > On 2010-11-27 03:31, Marius Hofert wrote: >> Hi, >> >> I get a warning () using >> >> xyplot.<- function(u) { >> BW.theme<- >> list(strip.background = list(col =

[R] How to load data file without attribute names?

2010-11-27 Thread 44whyfrog
Hi all, I'm new to R and I'm struggling with loading a data file without attribute names, like: 1,72,0,5.6431,28.199 1,72,0,12.666,28.447 1,72,0,19.681,28.695 1,72,0,25.647,28.905 It has no names for the columns nor the rows. I tried data <- read.table(path,header = FALSE, sep = ",") and it s

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Gabor Grothendieck
On Fri, Nov 26, 2010 at 6:35 PM, Marius Hofert wrote: > I am not sure if I found a bug... > I would like to create a function that itself creates a lattice plot without > colors. Following > http://www.mail-archive.com/r-help@r-project.org/msg64699.html > I use trellis.device() to set the colors

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Peter Ehlers
On 2010-11-27 03:31, Marius Hofert wrote: Hi, I get a warning () using xyplot.<- function(u) { BW.theme<- list(strip.background = list(col = "gray90"), strip.shingle = list(col=c("gray75")), layout.heights = list(strip = c(1,1)),

Re: [R] Installing RQuantLib on Win 7 64 Bit

2010-11-27 Thread Mike Marchywka
> > > > >> Date: Thu, 25 Nov 2010 21:22:54 -0600 > >> To: santosh.srini...@gmail.com > >> From: e...@debian.org > >> CC: r-help@r-project.org > >> Subject: Re: [R] Installing RQuantLib on Win 7 64 Bit > >> > >> > >> On 26 November 2010 at 07:05, Santosh Sri

Re: [R] Priniting numerics

2010-11-27 Thread Berend Hasselman
Ron_M wrote: > > I am not sure if I understood the help page. It says "fixed notation will > be preferred unless it is more than ‘scipen’ digits wider". If I > understood correctly it says, the corresponding number needs to be less > wider than 'scipen' digit, to print it numerically. Let s

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Marius Hofert
Hi, I get a warning () using xyplot. <- function(u) { BW.theme <- list(strip.background = list(col = "gray90"), strip.shingle = list(col=c("gray75")), layout.heights = list(strip = c(1,1)), axis.text = list(cex = 0.8),

Re: [R] Priniting numerics

2010-11-27 Thread Ron Michael
I am not sure if I understood the help page. It says "fixed notation will be preferred unless it is more than ‘scipen’ digits wider". If I understood correctly it says, the corresponding number needs to be less wider than 'scipen' digit, to print it numerically. Let say:   > options(scipen

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread ottorino
Il giorno sab, 27/11/2010 alle 00.35 +0100, Marius Hofert ha scritto: > The reason why I would like to use trellis.device() within a function > is that > the plot contains a panel.function which contains many calls to > panel.xyplot() > and I do not want to write "col = 1" (e.g.) all the time...

Re: [R] Fast Two-Dimensional Optimization

2010-11-27 Thread Wonsang You
Dear Dave, Thank you for your recommendation. I looked over the website of AD Model Builder for fast optimization. I want to ask you whether the software can be used in R programming as a kind of R package? Or is there any possibility that it can be jointly used with R packages? Regards, Wonsang

Re: [R] Priniting numerics

2010-11-27 Thread Peter Ehlers
On 2010-11-27 02:15, Ron Michael wrote: Hi all, can somebody help me on my little problem? I want to print a number say "10^10" is numerical format not in scientific notation. I ttied following: options(scipen = 1) print(10^10, 10) [1] 1e+10 I am not getting my desired output in simple numer

[R] Priniting numerics

2010-11-27 Thread Ron Michael
Hi all, can somebody help me on my little problem? I want to print a number say "10^10" is numerical format not in scientific notation. I ttied following:   > options(scipen = 1) > print(10^10, 10) [1] 1e+10 I am not getting my desired output in simple numerical format. How can I get that?   Tha

Re: [R] Installing RQuantLib on Win 7 64 Bit

2010-11-27 Thread Prof Brian Ripley
On Fri, 26 Nov 2010, Mike Marchywka wrote: Date: Thu, 25 Nov 2010 21:22:54 -0600 To: santosh.srini...@gmail.com From: e...@debian.org CC: r-help@r-project.org Subject: Re: [R] Installing RQuantLib on Win 7 64 Bit On 26 November 2010 at 07:05, Santosh S

[R] How to remove a package.

2010-11-27 Thread Stephen Liu
Hi folks, library(AER) data() I found the datasets of AER package. But I couldn't remove AER with: either detach("package:AER") or detach("package:AER", unload = TRUE) data() still found "car" there. What will be the correct way to remove it? TIA Besides:- I couldn't find EcDat > librar

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread Marius Hofert
Dear David, thanks for your help. I completely missed the point of trellis.device()... It is probably not the right thing for what I want to achieve. I do not want to open a device or plot the xyplot-object, I just want to create it and save it in a variable. I would like to *not* having to wri