[R] Can not install fCalendar package under R 2.6.2

2008-03-22 Thread Yan Wang
I have previously sent a same email to [EMAIL PROTECTED], however I am not sure if the mailing address has been changed to this one. If the duplicated messages are received twice, I am sorry for that and please delete one of them. Dear R helper: When I was trying to install the fCalendar packag

[R] Can not install fCalendar package under R 2.6.2

2008-03-22 Thread Yan Wang
Dear R helper: When I was trying to install the fCalendar package, R report the following error and then my installation failed: * Installing *source* package 'fCalendar' ... ** R ** inst ** preparing package for lazy loading Loading required package: MASS Loading required package: fEcofin Loadin

Re: [R] "spreading out" a numeric vector

2008-03-22 Thread Levi Waldron
On Sat, Mar 22, 2008 at 9:58 PM, jim holtman <[EMAIL PROTECTED]> wrote: > Is this close to what you want? > > > spread <- function(x, mindiff=0.5){ > + unique(as.integer(x / mindiff) * mindiff) > + } > > > > > x <- c(1,2,seq(2.1,2.3,0.1),3,4) > > x > [1] 1.0 2.0 2.1 2.2 2.3 3.0 4.0 > > s

[R] periodic function

2008-03-22 Thread Antonio.Gasparrini
Hello, I'm trying to built a model for a time-series analysis with an periodic term for seasonality. I've tried both harmonic (package spatstat) and periodicSpline (package splines). The former don't allow a periodic constraint (or it does?), while I've not been able to use the latter within a da

Re: [R] Draw Circles

2008-03-22 Thread Felix Andrews
help.search("circle") should point you to grid.circle in the grid package, at least in my R version 2.6.1 (grid package version 2.6.1). On Sun, Mar 23, 2008 at 8:44 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Look at draw.circle and draw.arc in the plotrix package. > > On Sat, Mar 22, 2

Re: [R] "spreading out" a numeric vector

2008-03-22 Thread jim holtman
Is this close to what you want? > spread <- function(x, mindiff=0.5){ + unique(as.integer(x / mindiff) * mindiff) + } > > x <- c(1,2,seq(2.1,2.3,0.1),3,4) > x [1] 1.0 2.0 2.1 2.2 2.3 3.0 4.0 > spread(x) [1] 1 2 3 4 > > spread(x,.2) [1] 1.0 2.0 2.2 3.0 4.0 > On Sat, Mar 22, 2008 at 8:03 PM, L

Re: [R] counting values on one colum only

2008-03-22 Thread jim holtman
There are 7 rows since this is probably a data frame and each column in a dataframe (or a matrix in this case) all have the same number of rows. I think what you want is to 'sum' the number of times a condition is met; this might come closer to what you were expecting: sum(weekly$a != 0) On Sat,

[R] "spreading out" a numeric vector

2008-03-22 Thread Levi Waldron
I am creating a timeline plot, but running into a problem in positions where the values to plot are too close together to print the text without overlap. The simplest way I can think of to solve this (although there may be other ways?) is to create a new numeric vector whose values are as close as

[R] Dotplot error bar caps?

2008-03-22 Thread John Bishop
Hi I've used Dotplot from Hmisc to draw a dotplot with error bars, where each row of the dotplot has two points. Now I'd like for the error bars to have caps on the end so I can see how much they overlap, but I can't figure out how to produce them. This draws the plot I want, but doesn't add ca

[R] counting values on one colum only

2008-03-22 Thread Felipe Carrillo
Hi all: Can someone help me count the number of rows with values in colum "a" only. assume the name of my dataframe is "weekly" I was trying i<- nrows(weekly$a) i but returns 7 when it should be 4. Thanks a b c d 27.000 27.000 1.569 0.013

Re: [R] Draw Circles

2008-03-22 Thread Gabor Grothendieck
Look at draw.circle and draw.arc in the plotrix package. On Sat, Mar 22, 2008 at 5:40 PM, ermimi <[EMAIL PROTECTED]> wrote: > > Hello!!! > > I would want to draw a circle but I don´t want use the function symbol(..). > Do anybody know other function that allow me draw a circle? > Thank you very mu

[R] R Quantreg package: "CI" constraint in qss

2008-03-22 Thread thierrydb
Hello, For a few large set of points, whenever I use a "CI" constraint in the qss term, I get the following error message: Warning message: In rq.fit.sfnc(x, y, tau = tau, ...) : tiny diagonals replaced with Inf when calling blkfct Without any constraint, these sets work well. Does anyone kn

[R] Draw Circles

2008-03-22 Thread ermimi
Hello!!! I would want to draw a circle but I don´t want use the function symbol(..). Do anybody know other function that allow me draw a circle? Thank you very much, Greetings Luismi -- View this message in context: http://www.nabble.com/Draw-Circles-tp16227640p16227640.html Sent from the R he

Re: [R] invalid \uxxxx sequence while trying to create a package

2008-03-22 Thread Charles Annis, P.E.
Thank you, Professor Ripley! LazyLoad:FALSE in my DESCRIPTION file was the charm! (It took a bit of looking to determine the correct syntax. A search for "lazyloading" in "Writing R Extensions" was a red herring, but a search on CRAN suggesting "lazy loading" - obvious in hindsight, of course

Re: [R] Vectorization Problem

2008-03-22 Thread David Winsemius
"Sergey Goriatchev" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I have the code for the bivariate Gaussian copula. It is written > with for-loops, it works, but I wonder if there is a way to > vectorize the function. > I don't see how outer() can be used in this case, but maybe one can

Re: [R] Geting names of variables

2008-03-22 Thread John Kane
I don't quite understand what you doing but have you looked at ?names ? x1 <- 3 x2 <- 5 y <- -34.5 mylist <- list(x1,x2,y) mynames <- c("First Trade Position", "Second Trade Position", "P&L") names(mylist) <- mynames mylist --- Fernando Saldanha <[EMAIL PROTECTED]> wrote: > I wanted to cr

[R] Geting names of variables

2008-03-22 Thread Fernando Saldanha
I wanted to create a list with the names of variables and their values. So I wrote the following function. add.to.list.names.vars.1 <- function(lnv, vnv) { i <- 1 while (i < length(vnv)) { z <- as.character(eval(substitute(quote(vnv[i+1])))[[2]][[i + 2]]) lnv[[vnv[i]]] <- list(Name = z

Re: [R] About R question

2008-03-22 Thread Uwe Ligges
shuyan wu wrote: > Hi, > After I installed R in my computer, I have loaded package Faraway, You probably mean package "faraway", but that should not be related to the following problem. > but when I want to plot, it will show errors like below: > > *> x<-c(1,2) >> y<-c(3,4) >> plot(x,y) >

Re: [R] function for the average or expected range?; CORECTION

2008-03-22 Thread Spencer Graves
Hi, Greg: 1. I did the integration in Excel for four reasons: First, it's easier (even for me) to see what's happening and debug for something that simple. Second, my audience were people who were probably not R literate, and they could likely understand and use the Excel file easier

Re: [R] function for the average or expected range?; CORECTION

2008-03-22 Thread Greg Snow
Why do the integration in Excel instead of using the integrate function in R? The R function will allow integration from -Inf to Inf. What was the correction to the formula? The last one you showed looked like the difference between the average min and average max, but did not take into acc

[R] About R question

2008-03-22 Thread shuyan wu
Hi, After I installed R in my computer, I have loaded package Faraway, but when I want to plot, it will show errors like below: *> x<-c(1,2) > y<-c(3,4) > plot(x,y) Error in windows() : unable to start device devWindows* I don't know why, please help me. Shuyan [[alternative HTML ver

Re: [R] More elegant multiplication or division of a data frame with avector

2008-03-22 Thread Greg Snow
> sweep( rawdata, 2, sens, '/' ) hope this helps, From: [EMAIL PROTECTED] on behalf of Tribo Laboy Sent: Sat 3/22/2008 8:21 AM To: r-help@r-project.org Subject: [R] More elegant multiplication or division of a data frame with avector Hello, I am importin

Re: [R] More elegant multiplication or division of a data frame with a vector

2008-03-22 Thread Gabor Grothendieck
Not sure if these are any better but here are a few alternatives: rawdata / rep(sens, each = nrow(rawdata)) as.data.frame(mapply("/", rawdata, sens)) as.data.frame(as.matrix(rawdata) %*% diag(1/sens)) On Sat, Mar 22, 2008 at 10:21 AM, Tribo Laboy <[EMAIL PROTECTED]> wrote: > Hello, > > I am imp

Re: [R] How to get week of the year, scale 1-52?

2008-03-22 Thread Peter Dalgaard
Eik Vettorazzi wrote: > But usually weeks start with a Monday. So what should happen when new > year isn't on a Monday? format(days, "%W") puts the first Monday of the > year in the first week, which makes sense. > > No it doesn't. Well, it does, but it will only match our planning calendars

[R] Re intraday OHLC plot

2008-03-22 Thread Jeff Ryan
Hi Thomas, You may want to check out the quantmod package. There is a whole suite of charting functionality now included. You will need to change the 'Last' colname to Close, but other than that your data should work. If you download the most recent build or svn snapshot from http://r-forge.r-p

[R] More elegant multiplication or division of a data frame with a vector

2008-03-22 Thread Tribo Laboy
Hello, I am importing some raw voltage multichannel measurements into an R data frame. I need to scale each column with the respective sensitivity for that channel. I figured how to do it, but I am curious if there isn't a more elegant way. Now I start with something like this: rawdata <- data.f

Re: [R] Aggregate with functions using multiple arguments

2008-03-22 Thread jim holtman
Is this what you want? > DAT siteobsfrc 1A 1.2745106 -1.6899502 2B 1.4394225 0.4167296 3A -0.1087532 0.7710872 4B -0.6319814 -0.2177236 5A -0.4208416 0.5099765 > (z <- by(DAT, list(DAT$site), function(x) mean(x$obs - x$frc))) : A [1] 0.3846007 ---

[R] Vectorization Problem

2008-03-22 Thread Sergey Goriatchev
I have the code for the bivariate Gaussian copula. It is written with for-loops, it works, but I wonder if there is a way to vectorize the function. I don't see how outer() can be used in this case, but maybe one can use mapply() or Vectorize() in some way? Could anyone help me, please? ## Density

Re: [R] intraday OHLC plot

2008-03-22 Thread Gabor Grothendieck
Try this: Lines <- '"Date (GMT)" "Open" "High" "Low" "Last" 17-03-2008 00:00:00 1,5764 1,5766 1,5747 1,5750 17-03-2008 00:05:00 1,5749 1,5750 1,5741 1,5744 17-03-2008 00:10:00 1,5745 1,5762 1,5741 1,5749' DF <- read.delim2(textConnection(Lines)) library(quantmod) z <- re

[R] intraday OHLC plot

2008-03-22 Thread Thomas Steiner
I want to create a open/high/low/last plot of intraday data. I try to use the function plotOHLC from the tsteries package. I create my own multiple time series and then try to plot it. raw Data Format (file eurusd2.csv): "Date (GMT)""Open" "High" "Low" "Last" 17-03-2008 00:00:00 1,5764

[R] Simulating Conditional Distributions

2008-03-22 Thread Sherri Rose
Dear R-Help List, I'm trying to simulate data from a conditional distribution, and haven't been able to modify my existing code to do so. I searched the archives, but didn't find any previous post that matched my question. n=1 pop = data.frame(W1 = rbinom(n, 1, .2), W2 = runif(n, min

Re: [R] invalid \uxxxx sequence while trying to create a package

2008-03-22 Thread Prof Brian Ripley
Now, I wonder who Duncan meant by 'one person on the list who can diagnose the problem' ? Hint: small packages are not selected for lazyloading, so do your example with lazy loading set in the DESCRIPTION file. If I do that, the example runs in R-devel but not in 2.6.2. It is a locale is