Re: [R] How to convert c:\a\b to c:/a/b?

2005-06-27 Thread james . holtman
[1] D:\\spencerg\\statmtds\\R\\Rnews Jim __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Convergys Labs [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] grep negation

2005-06-23 Thread james . holtman
?setdiff e.g., txt - c(arm,foot,lefroo, bafoobar) i - grep(foo,txt); i [1] 2 4 setdiff(seq(length(txt)),grep(foo,txt)) [1] 1 3 Jim __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant

Re: [R] (no subject)

2005-06-20 Thread james . holtman
) }) cbind(unlist(Passed), x.1) # put results in first column with the data Jim __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Convergys Labs [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] vectorisation suggestion

2005-06-20 Thread james . holtman
v3 - numeric() v3[v1] - table(v2)[v1] Jim __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Convergys Labs [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] vectorization

2005-06-17 Thread james . holtman
4994.921 . Jim __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Convergys Labs [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] Manipulating dates

2005-06-14 Thread james . holtman
Use POSIX. To convert: my.dates - strptime(your.characters, format='%d/%m/%Y') once you have that, you can use 'min' to find the minimum. 'difftime' will give you the differences. Jim __ James HoltmanWhat is the problem you

Re: [R] Dateticks

2005-06-14 Thread james . holtman
] 2003-11-13 23:00:00 EST 2004-01-02 23:00:00 EST 2004-02-21 23:00:00 EST axis(1, at=c(0,50,100,150,200,250), labels=format(dates,%m/%d/%y)) # format the output Jim __ James HoltmanWhat is the problem you are trying to solve

Re: [R] transform large matrix into list

2005-06-07 Thread james . holtman
x.1 [,1] [,2] [1,]14 [2,]25 [3,] NA6 cbind(x.1[!is.na(x.1)], which(!is.na(x.1), arr.ind=TRUE)) row col [1,] 1 1 1 [2,] 2 2 1 [3,] 4 1 2 [4,] 5 2 2 [5,] 6 3 2 Jim __ James Holtman

Re: [R] weighted.mean and tapply (again)

2005-05-25 Thread james . holtman
10 3 6 4 by(x.1, x.1$GROUP, function(x) weighted.mean(x$VALUE, x$FREQUENCY)) x.1$GROUP: 2 [1] 2.654676 --- x.1$GROUP: 3 [1] 4.153846 Jim __ James

Re: [R] plot question

2005-03-03 Thread james . holtman
tt - data.frame(c(0.5, 1, 0.5)) names(tt) - a plot(tt$a, type = 'o',xlim=c(0,4)) __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED

Re: [R] (no subject)

2005-02-16 Thread james . holtman
use 'gsub' x - c('1,200.44', '23,345.66') gsub(',','',x) [1] 1200.44 23345.66 as.numeric(gsub(',','',x)) [1] 1200.44 23345.66 __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant

Re: [R] Programming/scripting with expressions - variables

2005-02-07 Thread james . holtman
+ .result[paste('other_', name, sep='')] - paste(other_, value, sep='') + .result + } Gregor - test('Gorjanc', '25') Gregor# print out the vector Gorjanc other_Gorjanc 25other_25 __ James HoltmanWhat

Re: [R] Frequency of Data

2005-02-02 Thread james . holtman
2 1997 [2,] 152 2001 [3,] 152 2001 [4,] 23 12 2002 table(list(x.1[,2], x.1[,3])) .2 .1 1997 2001 2002 2 120 12 001 __ James HoltmanWhat is the problem you are trying to solve? Executive

Re: [R] Finding runs of TRUE in binary vector

2005-01-27 Thread james . holtman
FALSE TRUE FALSE __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] Avoiding a Loop?

2005-01-21 Thread james . holtman
Does this do what you want? nr.of.columns - 4 myconstant - 27.5 mymatrix - matrix(myconstant, nrow=5, ncol=nr.of.columns) mymatrix[,1] - 1:5 t(apply(mymatrix, 1, function(x) cumprod(x))) __ James HoltmanWhat is the problem

Re: [R] recoding large number of categories (select in SAS)

2005-01-19 Thread james . holtman
+ .value[1] # return first value if multiple matches + }) newValues [1] 150 150 438 792 792 808 808 __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office

Re: [R] plotting percent of incidents within different 'bins'

2005-01-05 Thread james . holtman
__ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] lists within a list / data-structure problem

2004-12-13 Thread james . holtman
the 'Dom's lapply(x.all, function(x) x$Dom) HTH __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] How to duplicate rows in dataframe?

2004-12-13 Thread james . holtman
x.1 - data.frame(a=1:5, b=1:5) x.1 a b 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 x.1[c(1,2,2,2,3,3,4,4,5,4,3,2,1),] a b 1 1 1 2 2 2 2.1 2 2 2.2 2 2 3 3 3 3.1 3 3 4 4 4 4.1 4 4 5 5 5 4.2 4 4 3.2 3 3 2.3 2 2 1.1 1 1 __ James Holtman

[R] 'object.size' takes a long time to return a value

2004-12-12 Thread james . holtman
15 language R __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929 -- NOTICE: The information contained in this electronic

Re: [R] how can I get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3

2004-12-03 Thread james . holtman
Use the 'polynom' library: p - as.polynomial(c(1,1,1)) p 1 + x + x^2 p^3 1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6 unclass(p^3) [1] 1 3 6 7 6 3 1 __ James HoltmanWhat is the problem you are trying to solve? Executive

Re: [R] scatterplot of 100000 points and pdf file format

2004-11-24 Thread james . holtman
. __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] timeDate

2004-11-23 Thread james . holtman
* 1000 [1] 1.101168e+12 this value requires 46 bits and since a floating point number has 54 bits of value, it should be enough to give you millisecond resolution and still maintain the 'date' __ James HoltmanWhat is the problem you

Re: [R] How to extract data?

2004-11-23 Thread james . holtman
lengths: int [1:2] 3 3 values : num [1:2] 1 -1 you can check the results of 'rle' to determine where the changes are. __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology

Re: [R] RE : Create sequence for dataset

2004-11-21 Thread james . holtman
7 2.1 2 11 1 2.3 2 10 2 2.13 2 11 3 2.17 2 12 4 2.18 2 10 5 2.20 2 11 6 3.2 3 11 1 3.5 3 11 2 3.7 3 10 3 3.14 3 11 4 3.15 3 10 5 3.16 3 10 6 3.19 3 11 7 __ James HoltmanWhat is the problem you are trying

Re: [R] scan or source a text file into a list

2004-11-11 Thread james . holtman
] fnrnYears qe year0 myList # output my list $fnr [1] 0.3 $nYears [1] 50 $qe [1] 0.04 $year0 [1] 1970 __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology

[R] Error in PDF output in R 2.0.0

2004-10-29 Thread james . holtman
: print.trellis(xyplot(csw ~ time | factor(cpu), memIn, panel = function(x, y) panel.xyplot(x, y, type = l))) 1: print(xyplot(csw ~ time | factor(cpu), memIn, panel = function(x, y) panel.xyplot(x, y, type = l))) __ James Holtman

Re: [R] Error with repeat lines() in function

2004-09-24 Thread james . holtman
The problem was is that you were not return a value from the apply function. It was trying to store the result of the apply into an array and there was no value. See the line I added in your function. __ James HoltmanWhat

Re: [R] Unique lists from a list

2004-09-01 Thread james . holtman
)] # create new list with just one 'name' __ James HoltmanWhat is the problem you are trying to solve? Executive Technical Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] +1 (513) 723-2929

Re: [R] naive question

2004-06-30 Thread james . holtman
is being spent. The nice thing about R is that there are a number of ways of approaching a solution and it you don't like the timing of one way, try another. That is half the fun of using R. __ James HoltmanWhat is the problem you

Re: [R] binding rows from different matrices

2004-06-29 Thread james . holtman
[5,] b g l q v [6,] B G L Q V [7,] 3 8 13 18 23 [8,] c h m r w [9,] C H M R W [10,] 4 9 14 19 24 [11,] d i n s x [12,] D I N S X [13,] 5 10 15 20 25 [14,] e j o t y [15,] E J O T Y __ James Holtman

Re: [R] Specifying suitable PC to run R

2003-10-09 Thread james . holtman
. __ James HoltmanWhat is the problem you are trying to solve? Executive Consultant -- Office of Technology, Convergys [EMAIL PROTECTED] (513) 723-2929

Re: [R] timezones

2003-08-03 Thread james . holtman
(now.gmt) `POSIXlt', format: chr 2003-08-03 22:29:38 (now.gmt - as.POSIXct(now,tz=GMT)) [1] 2003-08-03 18:29:38 EDT str(now.gmt) `POSIXct', format: chr 2003-08-03 18:29:38 now-now.gmt Time difference of 0 secs __ James HoltmanWhat

[R] Problem reading a PDF output

2003-06-19 Thread james . holtman
Is this breaking some limit in PDF? I am running: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor7.1 year 2003 month06 day 16 language R __ James Holtman What

Re: [R] Convert char vector to numeric table

2003-03-31 Thread james . holtman
use 'textConnection': x.1 - c('1 2 3','4 5 6','7 8 9','8 7 6','6 5 4') # create character vector x.in - textConnection(x.1) # setup connection x.data - read.table(x.in) # read in the character vector x.data V1 V2 V3 1 1 2 3 2 4 5 6 3 7 8 9 4 8 7 6 5 6 5 4

Re: [R] overlapping pattern match (errata 2.0)

2003-03-29 Thread james . holtman
Another way to find all the multiple occurances of a character in a string is to use 'rle': x.s - 'aaabbcdeeeggiijjysbbddeffghjjjsdk' x - unlist(strsplit(x.s, NULL)) x [1] a a a b b c d e e e f f f f g g i i j [20] j y s b b d d e f f g h j j j s d k k [39] k k k rle(x) Run Length