search for: divvec

Displaying 2 results from an estimated 2 matches for "divvec".

2001 Feb 01
1
constructing a vector from a dataframe and another vector
...GE 0.137 and a character vector of symbols that might, for example, look like this: syms <- c("ADBE", "AAPL", "ED", "ED", "ADBE") >From these two data objects, I'd like to construct the following numeric vector of dividends: divvec <- c( .025, .025, .025, .550, .410, .550, .410, .550, .410, .025, .025, .025) In other words, I'd like to construct a numeric vector by replacing each symbol in syms by the dividends associated with that symbol in the dataframe divs. Symbols can occur more than once in syms, and some of...
2008 Jul 09
7
recursively divide a value to get a sequence
Hi, if given the value of, say, 15000, I would like to be able to divide that value recursively by, say, 5, and to get a vector of a determined length, say 9, the last value being (set to) zero- i.e. like this: 15000 3000 600 120 24 4.8 0.96 0.192 0 These are in fact concentration values from an experiment. For my script, I get only the starting value (here 15000), and the factor by which