search for: jctoll

Displaying 20 results from an estimated 22 matches for "jctoll".

Did you mean: mctoll
2011 Mar 16
2
Need to abstract changing name of column within loop
Hi, I'm struggling to figure out the way to change the name of a column from within a loop. The problem is I can't refer to the object by its actual variable name, since that will change each time through the loop. My xts object is A. > head(A) A.Open A.High A.Low A.Close A.Volume A.Adjusted A.Adjusted.1 2007-01-03 34.99 35.48 34.05 34.30 2574600 34.30
2012 May 14
2
Inf and lazy evaluation
Hi, I have a question involving Inf, lazy evaluation, and maybe argument recycling. I have a directory where I am trying to check for the existence of files of a certain pattern, basically something like "filename-#", where # is an integer. I can do something like this, which works. file.exists(paste(filename, "-", 1:100, sep = "")) But I don't like the fact
2011 Apr 20
1
taking rows from data.frames in list to form new data.frame?
Hi, I am having a problem figuring out how to extract a subset of rows. I have a list with 68 similar data.frames. Each data.frame is 500 rows by 5 columns. I want to take one row from each data.frame based upon the data in a particular column (i.e. it matches a symbol). For example: > str(database) List of 68 $ X2011.01.11:'data.frame': 500 obs. of 5 variables: ..$ Symbol
2011 May 18
1
Grouped bar plot
Hi, I am trying to produce a grouped bar plot from a data.frame and I'm having difficulties figuring out how to do so. My data is 500 rows by 4 columns and basically looks like so: > head(x) V1 V2 V3 V4 1 XOM 0.2317915 0.1610068 1.6941637 2 AAPL 0.6735488 0.7433611 0.1594102 3 GE 1.2554160 0.9237384 1.6767711 4 IBM 1.6296938 0.3730387 0.5858115 5 CVX
2011 Oct 19
1
ar() - AIC and BIC
Hi, I'm slowly working through Tsay's "Analysis of Financial Time Series" 3rd ed. ?I'm trying to replicate Table 2.1 on p.47, which gives PACF, AIC, and BIC for the monthly simple returns of the CRSP value-weighted index. The data: http://faculty.chicagobooth.edu/ruey.tsay/teaching/fts3/m-ibm3dx2608.txt > da <-
2012 May 31
3
Remove columns from dataframe based on their statistics
Hi, I have a dataframe and want to remove columns from it that are populated with a similar value (for the total column) (the variation of that column is 0). Is there an easier way than to calculate the statistics and then remove them by hand? A <- runif(100) B <- rep(1,100) C <- rep(2.42,100) D <- runif(100) df <- data.frame(A,B,C,D) # if want to conditionally remove column B and
2012 Feb 01
1
ggplot2(0.9.0): could not find function "=="
Hi, I have a question related to the newest version of ggplot2 (0.9.0). I just updated this morning and from CRAN it looks like the Mac version is the only one at 0.9.0 as of right now. http://cran.r-project.org/web/packages/ggplot2/index.html Anyway, I was in the midst of a project where I was trying to replicate "Back-to-back Bar Charts" in this blog post.
2012 Jan 16
2
ggplot2 stacked bar - sum of values rather than count
Hi, I'm trying to create a stacked bar plot using ggplot2. Rather than plotting the count of each of the 13 "Bar" factors on the Y axis, I would like to represent the sum of the Values associated with each of the 13 "Bar" factors. Is there a way to do that? Given the following data, that would obviously mean that there would be some negative sums represented. Here's
2011 Sep 12
1
plot 3 lines with ggplot2
Hi, I am trying to learn to use ggplot2 for what I had hoped would be a fairly simple task. I have a relatively small data.frame (100 by 4). The first column contains symbols. The 2nd, 3rd and 4th columns represent percentage weightings for each symbol using 3 different methodologies. For example: sym <- make.unique(replicate(100, paste(sample(LETTERS, 3, replace = TRUE), collapse =
2012 Oct 08
1
arima.sim
Hi, I have been using arima.sim from the stats package recently, and I'm wondering why I get different results when using what seem to be the same parameters. For example, I've given examples of three different ways to run arima.sim with what I believe are the same parameters. It's my understanding from the R documentation that rnorm is the default function for rand.gen if not
2013 Jan 22
3
density of hist(freq = FALSE) inversely affected by data magnitude
Hi, I have a couple of observations, a question or two, and perhaps a suggestion related to the plotting of density on the y-axis within the hist() function when freq=FALSE. I was using the function and trying to develop an intuitive understanding of what the density is telling me. After reading through this fairly helpful post:
2007 Oct 16
0
Simple plot of IR and option prices
Hi, I'm trying to construct what I think should be a fairly simple plot, yet I'm having a tremendously difficult time. I'm trying to create a very simple graph showing the effect of interest rates on option prices. I have three sets of option prices that I've calculated using rMetrics. Each set contains a call price and a put price at a particular interest rate. Each
2007 Dec 12
1
Overlay PDF on histogram
Hi, I thought that I had read somewhere that there was a really simple way to overlay the probability density function of a normal distribution over a histogram, after the histogram has already been plotted. Possibly a one word command. I've found this email from the archives, but I don't think this is what I'm looking for. I thought there was something more simple than
2007 Sep 28
1
plot x-axis at 0
Hi, I am trying to create a plot of a simple P&L graph for an option I'm pricing using Rmetrics. I'm not trying to do anything fancy. I just want to figure out if it's possible to put the x-axis at 0 rather than at the bottom the the entire plot. It seems like something that would be relatively easy to do. Any help or hints would be greatly appreciated. Thanks.
2010 Dec 16
0
use vector to merge multiple xts objects?
Hi, I have several xts objects that are historical quotes downloaded as such: library(quantmod) > getSymbols("AA") > head(AA) AA.Open AA.High AA.Low AA.Close AA.Volume AA.Adjusted 2007-01-03 30.05 30.06 29.17 29.33 8176300 26.89 2007-01-04 29.33 29.40 28.81 29.11 5655800 26.69 2007-01-05 29.11 29.24 28.49 28.76 7453100
2012 May 17
1
using XML package to read RSS
Hi, I'm trying to use the XML package to read an RSS feed. To get started, I was trying to use this post as an example: http://www.r-bloggers.com/how-to-build-a-dataset-in-r-using-an-rss-feed-or-web-page/ I can replicate the beginning section of the post, but when I try to use another RSS feed I have an issue. The RSS feed I would like to use is: > URL <-
2012 Sep 17
1
memory leak using XML readHTMLTable
Hi, I'm using the XML package to scrape data and I'm trying to figure out how to eliminate the memory leak I'm currently experiencing. In the searches I've done, it sounds like the existence of the leak is fairly well known. What isn't as clear is exactly how to solve it. The general process I'm using is this: require(XML) myFunction <- function(URL) { html
2012 Mar 12
2
mapply & assign to generate functions
Hi, I have a problem that I'm finding a bit tricky. I'm trying to use mapply and assign to generate curried functions. For example, if I have the function divide divide <- function(x, y) { x / y } And I want the end result to be functionally equivalent to: half <- function(x) divide(x, 2) third <- function(x) divide(x, 3) quarter <- function(x) divide(x, 4) But I want
2007 Oct 31
2
reversing perspective plot axis
Hi, I am trying to create a perspective plot with Time on the x-axis, Underlying Price on the y-axis, and Option Price on the z-axis. But I don't like the way my x-axis is setup. Right now, Time is this sequence. Time = seq(from = 1/52, to = 1, by=1/52) That results in the x-axis going from 0 at the back, to 1 near the foreground corner.(If that makes any sense) I want to do the
2012 Apr 13
1
list.dirs() full.names broken?
Hi, I am trying to list all the sub-directories in a particular directory and having a few issues. list.dirs seems to be slightly broken and/or poorly labelled. My issue appears to be the same as this one, from the archives: http://tolstoy.newcastle.edu.au/R/e16/help/11/11/1156.html Here is some of my current platform info: R version 2.15.0 (2012-03-30) Platform: