[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
?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
)
})
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
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
4994.921
.
Jim
__
James HoltmanWhat is the problem you are trying to solve?
Executive Technical Consultant -- Convergys Labs
[EMAIL PROTECTED]
+1 (513) 723-2929
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
] 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
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
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
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
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
+ .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
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
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
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
+ .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
__
James HoltmanWhat is the problem you are trying to solve?
Executive Technical Consultant -- Office of Technology, Convergys
[EMAIL PROTECTED]
+1 (513) 723-2929
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
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
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
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
.
__
James HoltmanWhat is the problem you are trying to solve?
Executive Technical Consultant -- Office of Technology, Convergys
[EMAIL PROTECTED]
+1 (513) 723-2929
* 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
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
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
] 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
: 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
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
)] # 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
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
[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
.
__
James HoltmanWhat is the problem you are trying to solve?
Executive Consultant -- Office of Technology, Convergys
[EMAIL PROTECTED]
(513) 723-2929
(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
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
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
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
36 matches
Mail list logo