[R] Generate a sequence of vectors of different length

2011-11-02 Thread Christian Langkamp
Hi everyone After the following setup sector=2 # Define Number of Sectors sectors=LETTERS[seq( from = 1, to = sector )] # Name sectors No_ent=round(3/runif(sector)) # Number of entities per sector #Tot_No_ent=sum(No_ent) Goal is to get a List like (A1, A2, A3, B1, B2, B3, B4) where A is

[R] Subtract matrices within arrays along indices

2009-07-29 Thread Christian Langkamp
I have the following array: 3 dimensional object, one dimension being year. Object is 3*3*3 library(plyr, reshape) a1-rep(c(2007,2008,2009),9) a2-c(rep(a,9),rep(b,9),rep(c,9)) a3-c(rep(c(rep(1,3),rep(2,3),rep(3,3)),3)) a4 - rnorm(27) A-data.frame(cbind(comp=a2,val=a3, year=a1, a4)) A1-melt(A,

[R] Re place Values within vector using Translation vector

2009-02-18 Thread Christian Langkamp
Dear everyone I would like to change values in vectors doing a translation. i.e. I have a start vector giving me the levels in one vector (numbers 1 to x - rating) and then I have a second vector giving me the values to be allocated (loss probabilities), but the number of potential rating

[R] Adjusting the Axis in a histogram to the prespecified breaks

2009-02-16 Thread Christian Langkamp
Hello I tried a few searches on hist, histogram, equidist and space (space=0 was mentioned in one contribution), but none of that so far worked. It also says in the help ##-- For non-equidistant breaks, counts should NOT be graphed unscaled: - which is precisely what I am looking for, but I

Re: [R] How do I get my IT department to bless R?

2009-02-05 Thread Christian Langkamp
I know on the website there are some pretty reputable sponsors of the software who at some stage donated some (presumably significant) amount of money out of thankfulness because some project worked and the software helped in some way. In order to push however the use of that software, might it

[R] Extracting Variable Name to define breaks for histogram

2009-02-04 Thread Christian Langkamp
Hi I am trying to define an automatic breaks function for a histogram. Inputs are a vector x and a number n. What I would like is to define the outcome as breaks_(Name of Vector) - but the paste(breaks_,x) obviously refers to the whole vector. breaks- function(x, n) { R-range(x, na.rm=T)