See Harrell's Hmisc package
--
David Huffer, Ph.D.
Deputy Director
CSOSA/ORE
Washington, DC
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Ken Williams
Sent: Thursday, August 05, 2010 11:20 AM
To: r-help@r-project.org
Subject
How about:
test.table - matrix ( rnorm ( 25 ) , ncol = 5 )
outputDir = paste (
+ getwd ( )
+ , /OutputData-
+ , Sys.Date ( )
+ , sep =
+ )
dir.create ( outputDir )
write.table (
+ test.table
+ , paste (
+ outputDir
+ , test.table.txt
+ , sep = /
+ )
+ , sep = \t
+
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
-
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun
, max = max
)
}
x
}
milton ( x = mymat )
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
When adding several logical vectors I expect each vector will be
coerced to integers and these vectors will then be added.
That doesn't always seem to be the case.
For example:
( f1 - as.factor ( sample ( x , 25 , rep = T ) ) )
[1] x x x x x x x x x x x x x x x x x x x x x x x x x
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
-
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of rkevinbur
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
How about:
sapply (
1:27
, function ( i ) {
min (
get ( paste ( sa , i , sep = ) )
)
}
)
See ?get
david
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC
Or...
X = c (red, blue, green, black ) ; Y = c(red, blue,
green, magenta, cyan)
unique ( c ( X [X %in% Y] , Y [Y %in% X] ) )
[1] red blue green
David
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Praveen Surendran
Like,
a = list (1:3,4:6,7:9)
a
[[1]]
[1] 1 2 3
[[2]]
[1] 4 5 6
[[3]]
[1] 7 8 9
a [[2]] [2]
[1] 5
a [[3]] [3]
[1] 9
HTH
--
David
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of voidobscura
Sent: Thursday, July 16, 2009
The easiest way is to just do something like this:
mdat - matrix(c(4,2,3, 11,12,13), nrow = 2, ncol=3)
mdat
[,1] [,2] [,3]
[1,]43 12
[2,]2 11 13
as.vector ( colSums ( mdat ) )
[1] 6 14 25
HTH
--
David
-Original Message-
From: r-help-boun...@r-project.org
I'm guessing you want to perform some sort of transformation on all the
elements in the matrix you've posted and that you've only presented
those 3 elements as an example of how the transformation will affect
those 3 elements. Is that right?
--
David
-Original Message-
From:
) what goes in the bottom corner of the new matrix? I
would have guessed i would have seen
2 7
1 8
in the corner. Was that a typo or do you really want to
overwrite the values of the submatrix that *is* in A1?
david
--
David
-
David
] On
Behalf Of David Huffer
Sent: Wednesday, July 15, 2009 11:07 AM
To: jurgen claesen; r-help@r-project.org
Subject: Re: [R] problem with merging matrices
On Wednesday, July 15, 2009 8:28 AM, jurgen claesen wrote:
...I'm a relative new user of R and I have a
problem with merging a collection
0.729 0.857
[5,] 10 0.306 0.385 0.477 0.583 0.705 0.843
Im not really sure what you mean by Line up the first row with
the factors (decimal fractions).
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington
[[2]]
[1] 1 1 1
[[3]]
[1] 3 3 1
length ( q [ crossRsorted [ , 1 ] ] )
[1] 3
How'd you come up with
length(q)
[1] 165
length(q[ crossRsorted[,1] ])
[1] 15750
I must be missing something.
--
David
-
David Huffer
N in y
3 3 1
5 1 3
7 2 1
9 1 1
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
How about
countN - function ( v ) {
sum ( !is.na ( v ) ) - sum ( is.na ( v ) )
}
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
way is not
wrong...
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
__
R-help@r-project.org mailing list
https://stat.ethz.ch
Is there any way to have Sexpr span multiple lines?
--
David
-
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huf...@csosa.gov
like the way to go, but it seems not to take full
advantage of the language. Thank you both. David
-Original Message-
From: Duncan Murdoch [mailto:murd...@stats.uwo.ca]
Sent: Tuesday, June 30, 2009 1:16 PM
To: David Huffer
Cc: r-help@r-project.org
Subject: Re: [R] Sweave: multiline
=2009g=dignore=.csv
, sep =
)
destfile - paste ( destpath , substitute ( symbol ) , .csv , sep = )
download.file ( url , destfile , quiet = TRUE )
}
download.ichart ( TEF )
--
David
-
David Huffer, Ph.D
, 169.131.58.2
, 162.131.58.6 , 169.132.58.3
, 162.132.58.20 , 250.131.58.4
, 162.252.20.21 , 250.131.58.5
, 162.254.20.22 , 250.131.58.7
)
)
test
HTH
--
David
-
David Huffer, Ph.D. Senior
On Thursday, May 07, 2009 7:45 PM, David Freedman wrote:
...how about:
d=data[order(data$ID,-data$Type),]
d[!duplicated(d$ID),]
Does the -data$Type argument to the order function work?
--
David
-
David Huffer, Ph.D
Do you have the foreign package loaded?
--
David
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal,
I'm trying to install the Hmisc package, however it doesn't appear in
the list after utils:::menuInstallPkgs(). Any help?
--
David
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
On Monday, September 29, 2008 1:59, Dimitris Rizopoulos wrote:
On Monday, September 29, 2008 1:26, milton ruser wrote:
...I have a data.frame like...
place-c(place1, place2, place3, place4, place5)
population-c(100,200,300,50,30)
my.df-data.frame(cbind(place,population))
I'm looking for something along the lines of
which ( table ( x ) == max ( table ( x ) ) )
to find the most common level of one factor
by several other factors. For instance, I've got
X - data.frame (
+ x = factor ( sample ( c ( A , B , C , D ) , 20 , r = T ) )
+ , z1 = factor (
I'm making a few functions to generate latex files describing
rpart objects that are then \input-ed into a larger document. So
far, the functions I have generate paragraphs containing
enumerations of the predictors in pruned trees and the number of
formed groups.
Its easy enough to recover these.
29 matches
Mail list logo