similar to: Calculating sum of letter values

Displaying 20 results from an estimated 2000 matches similar to: "Calculating sum of letter values"

2008 Nov 25
3
Line color based on data values?
Hi all Does anyone know if it is possible when plotting a line or scatter plot, to selectively color the data points based on the data value? i.e. if plotting say the percentage change in stock price movements, to color +ve points in green and -ve points in red? And extending this to a user-defined range of colors based on the quartile of the data points? Thanks Rory Rory Winston RBS Global
2008 Dec 05
1
Cartesian Product Of Character Vectors
Hi all (I'm sure this question has been asked before, but I cant find it). If I have two character vectors: > x <- c("aaa","bbb","ccc") > y <- c("1","2","3") How can I get the cartesian product of the string values? > expand.grid(x,y) Gives me a data frame with separate columns...however, I cant seem to get *apply
2008 Dec 05
1
Lexical Permutation Algorithm in R
Hi all Here is a rather naive implementation of the SEPA algorithm for generating lexical permutations: lexperm3 <- function(x, n=length(x)) { perms <- list() k <- 1 perms[[k]] <- x k <- k + 1 for (y in 1:(factorial(n)-1)) { i <- n-1 while (x[i] > x[i+1] && i > 0) { i <- i - 1 } # i is largest index st x[i] > x[i+1] j <- n #
2008 Dec 11
3
Downloading Reuters data from R
Hi R, Can we download Reuters (3000 Xtra) data from R? Does ODBC package help me in this? Or otherwise, is there a way to extract daily closing prices data of Reuters from R? Thank you very much, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}}
2008 Oct 23
1
[R-SIG-Finance] forecasting earnings, sales and gross margin of a company...
Sender: r-help-bounces at r-project.org On-Behalf-Of: comtech.usa at gmail.com Subject: Re: [R] [R-SIG-Finance] forecasting earnings, sales and gross margin of a company... Message-Id: <b1f16d9d0810231239k506d582i7ecb908b84bc1642 at mail.gmail.com> Recipient: ngottlieb at marinercapital.com -------------------------------------------------------- This information is being sent at the
2008 Sep 02
1
Moving to a new bug reporting system?
Hi all This may be an issue that has been discussed at length before, so apologies if I have missed that discussion, but is there any desire to switch from Jitterbug to something more capable and modern? Say JIRA, for instance? Rory Rory Winston RBS Global Banking & Markets Office: +44 20 7085 4476 *********************************************************************************** The
2008 Oct 22
1
forecasting earnings, sales and gross margin of a company...
Hi all, I am playing with some companies' balance sheets and income statements and want to apply what I've just learned from Stats class to see if I can forecast the companies earnings, sales and gross margin in the short term (3rd and 4th Quarter), mid-term (2009) and long term (2011, etc. ) I pulled up some data from companies' financial statements over the past a few years. The
2008 Aug 27
1
Odd behavior in histogram breaks?
I am looking at histogram breaks, and notice something odd: > foo <- hist(runif(10000),breaks=20) > length(foo$breaks) [1] 21 This makes sense to me. > foo <- hist(runif(10000),breaks=200) > length(foo$breaks) [1] 201 This also makes sense. BUT > foo <- hist(runif(10000),breaks=250) > length(foo$breaks) [1] 201 > foo <- hist(runif(100000),breaks=250) >
2008 Nov 21
2
Extracting diagonal matrix
Dear All, I have a correlation matrix of size 100 x 100 and would like to extract the diagonal matrix from it. I have used the for loop to store tha correlation values of the diagonal matrix. Is there a 'R way' of doing this? Thanks in advance. Kind regards, Ezhil
2008 Dec 02
2
Can't load Rgraphviz on windows-based R
Hi, I have problem loading Rgraphviz. Following the instructions specified by the README in Rgraphviz_1.20.3.tar.gz didn't help either. o. set the following Windows environment variables accordingly (control panel -> systems -> Advanced -> Environment Variables ): (a) create new user variables: GRAPHVIZ_INSTALL_DIR (e.g., C:\Graphviz-2.21)
2008 Sep 02
2
receiving "Error: cannot allocate vector of size 1.5 Gb"
Dear all, In my attempt to run the below modelling command in R 2.7.0 under windows XP (4GB RAM with /3GB switch set) I receive the following error: Error: cannot allocate vector of size 1.5 Gb I have searched a bit and have tried adding: --max-mem-size=3071M to the command line (when set to 3G I get the error that 3072M is too much) I also run: > memory.size() [1] 11.26125 >
2008 Sep 17
1
Extracting subsets by factor level?
Hi I have a data frame which looks like the following (it is a table of commit logs to a source repo). The Author column is treated as a factor, by virtue of stringsAsFactors being set to TRUE, so I can extract the number of commits per author by using table(logs$Author). Is there an elegant way to extract all subsets of this frame by the Author column - i.e. that returns say a list of data
2008 Aug 21
1
x[order(x)] vs sort(x)?
Hi I have a question (which may be an obvious one). It is about an idiom which I have seen quite often: o <- order(x); <- x[o] vs. the alternative x <- sort(x) I am just wondering as to the rationale behind the order/reindex idiom vs sorting. Especially as there seems to be a marked performance difference (especially for integer vectors): > x <- trunc(runif(1E6, 1, 100)) >
2008 Apr 04
4
Arbitrary Precision Numbers
Hi (If you're wondering, this is a Project Euler question :)) If I wanted to calculate the sum of the digits in the decimal representation of 2^1000, what would be a good way to go about that? I've tried the following methods: # Calculate the sum of digits in the decimal representation of 2^n # Only works for smaller values of n bsum <- function(n) { s <- 0 e <-
2008 Jun 08
2
Adding a Rotated Density Plot to an Existing Plot
Hi Consider the following graph: x <- rnorm(1000) x <- x + exp(-x/2) layout(matrix(rep(c(1,1,2), 2), 2, 3, byrow=TRUE)) boxplot(x) rug(jitter(x), side=2) plot(density(x)) What I would really like to do is to have the density plot rotated by 90 degrees so that I can see it line up with the rug plot on the side axis. I cant seem to do this. I have seen references to the grid
2008 Dec 26
2
Computational Probability
Hi Firstly , happy Christmas to R-Help! Secondly, I wonder if anyone can help me with the following query: I am trying to reproduce some explicit probability calculations performed in APPL (a Maple extension for computational probability). For instance, in APPL, to compute the probability that the sum of 10 iid uniform variables [0,1] will be between 4 and 6, (i..e Pr( 4 < \sum_{i=1}^{10}X_i
2008 Apr 12
3
Matrix Indexing
Hi Does anyone know how I might pick out diagonal elements of a matrix using a vector? If I create a matrix a: a <- matrix(c(1:16), 4, byrow=TRUE) and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary diagonal (upper or lower), is there any way I can use a vector to do this? So if I want a diagonal of size 3, I could create a vector like x <- c(0:2) and then pick
2009 Jul 03
2
Correlation Network Diagram?
Hi all On page 39 of this paper [1] by Andrew Lo there is a very interesting correlation network diagram (sorry I dont have a more convenient link to the type of diagram I'm talking about). does anyone know of any package in R that can generate these types of diagrams? Cheers -- Rory [1] http://web.mit.edu/alo/www/Papers/august07.pdf [[alternative HTML version deleted]]
2007 Oct 29
2
Changing size of lattice plot?
Hi I am having a bit of difficulty with changing the canvas size on a trellis/lattice plot. I am plotting two "cubes" of 3-dimensional random numbers, as follows: library(gsl) library(lattice) q <- qrng_alloc(type="sobol", 3) npoints <- 200 rs <- qrng_get(q,npoints) # Plot the normal variates in a 3-dim cube p1 <- cloud(rnorm(npoints) ~ rnorm(npoints) +
2008 Jul 03
2
Plotting Prediction Surface with persp()
Hi all I have a question about correct usage of persp(). I have a simple neural net-based XOR example, as follows: library(nnet) xor.data <- data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0))) names(xor.data) <- c("x","y","o") xor.nn <- nnet(o ~ x + y, data=xor.data, linout=FALSE, size=1) # Create an (x.y) surface and predict over all points d <-