Dear R community,
I am trying to create a matrix of permutations of a vector:
bands - c(AL, B, DB, DG, G, K, LB, LG, MG, O, P,
PI, PK, PU, R, V, W, Y)
Each permutation must be 4 characters long. permutations() from the gtools
package does this easy enough:
possible.combos - permutations(18, 4,
On Sat, 19-Dec-2009 at 09:24AM +1800, Peng Yu wrote:
| On Sat, Dec 19, 2009 at 3:35 AM, Patrick Connolly
| p_conno...@slingshot.co.nz wrote:
| On Thu, 17-Dec-2009 at 03:13PM +1800, Peng Yu wrote:
|
| | Currently, I load the RData file then ls() and str(). But loading the
file
| | takes too
library(R.oo);
setMethodS3(ll, character, function(pathname, ..., force=FALSE) {
require(R.cache) || throw(Package not loaded: R.cache);
# Argument 'pathname':
pathname - Arguments$getReadablePathname(pathname, mustExist=TRUE);
# Check for cache results
fi - file.info(pathname);
thank you for your help, caret package is so powerful , it can do many
things. I now, need learn how to apply to my problems.
Max Kuhn wrote:
You can get this using the caret package. There are a few package
vignettes that come with the package and a JSS article
On 12/18/09 22:24, Charles C. Berry wrote:
On Fri, 18 Dec 2009, Hien Nguyen wrote:
Thanks a lot for answering my questions.
I have tried to run the clogit for only 64 observations and 4
independent variables and the results are solved instantly. However,
when I run the same command (with
Dear R users,
my problem, at the moment, is the following:
I need to apply a script to a very big dataset, so I need first to subdivide
the dataset into samples and then apply the script to every single sample.
Now I tried to solve the problem with these linest:
S1-data[data$sub==1,1:3]
something like
bwplot(val ~ g | G2, dta, pch = |, box.width = 1,
par.settings = list(box.rectangle = list(col = darkred, fill = grey90),
box.umbrella = list(col = darkred),
strip.background = list(col = transparent)))
For more on the Lattice style /
Experts,
I have try to do seperate and doing simulation on lm.dibp (bivpois). I edited
some elements to fit my soccer scores model. The static model has completed, I
try to biuld a weight function for dynamic model as refer to dixon
coles(1997).
existing weighted function in
On Dec 19, 2009, at 2:22 AM, David Hugh-Jones wrote:
Hi all
I want to get the design matrix for a model, evaluated at a single
value.
For example, if I pass in a data frame with a=2, b=2, y=3, and my
model is y ~ a+b+a:b, then I would like to get
the values 3, 2, 2, 4 out. I can do this
Hi Ray,
First possibility: just select those combinations that contain AL:
combos.with.AL - possible.combos[rowSums(possible.combos==AL)0,]
Second possibility: create all 3-combos *without* AL:
bands.without.AL - c(B, DB, DG, G, K, LB, LG, MG, O,
P, PI, PK, PU, R, V, W, Y)
On Dec 18, 2009, at 6:27 PM, Raymond Danner wrote:
Dear R community,
I am trying to create a matrix of permutations of a vector:
bands - c(AL, B, DB, DG, G, K, LB, LG, MG, O,
P,
PI, PK, PU, R, V, W, Y)
Each permutation must be 4 characters long. permutations() from the
gtools
package
On Dec 19, 2009, at 6:24 AM, Veronesi, Fabio wrote:
Dear R users,
my problem, at the moment, is the following:
I need to apply a script to a very big dataset, so I need first to
subdivide the dataset into samples and then apply the script to
every single sample.
Now I tried to solve the
Dear list,
In a little numbers game, I've hit a performance snag and I'm not sure
how to code this in C.
The game is the following: how many 8-digit numbers have the sum of
their digits equal to 17?
The brute-force answer could be:
maxi - 9 # digits from 0 to 9
N - 5 # 8 is too large
test - 17
glmnet _1.1-4 is on CRAN now.
This version includes cross.validation functions to assist in picking
a good value for lambda
These functions are preliminary, in that they can only handle gaussian
or logistic models for binary data.
The complete range will appear in the future.
For those
mda 0.1-4 is on CRAN
Many thanks to Friedrich Leisch, Kurt Hornik and Brian Ripley for
their early work in porting the mda package
into R, and to Kurt for maintaining the package. I have taken back
mda and will maintain it from now on.
The package fits flexible, penalized and mixture
Hi All,
I'm trying following code and would need help with:
1. Flexibility to move legend inside (top, right, left, etc...). Currently
its overlaying with plot's border.
2. Reducing width/height and making it more compact, with small boxes.
# Requires installing and loading ggplot2 package
p -
Hi, I'm a bit new to R and I would like to know how can I compare simple
main effects when using the aov function.
I'm doing a mixed model ANOVA with two between subjects variables and one
within.
When I get an interaction of two of the variables I don't know how to check
for simple main effect of
I have compiled and linked a 64 bit version of R (R 2.9.2) and the
corresponding unix ODBC 64 bit package
The red highlighted text below is the error I'm getting trying to when
invoking a sqlQuery
library(RODBC)
channel - odbcConnect(OraLSH, user, password)
sqlQuery(channel,select sysdate
?sink perhaps?
--- On Sat, 12/19/09, Peng Yu pengyu...@gmail.com wrote:
From: Peng Yu pengyu...@gmail.com
Subject: [R] How to print to file?
To: r-h...@stat.math.ethz.ch
Received: Saturday, December 19, 2009, 7:12 AM
I don't find a function to print a
string to file. Would somebody let
Hi R Users,
I'm using following sample code to save png plots.
png(file=sample.png, width=8, height=6)
Then I copy or use insert pictures function to get the image into MS Word.
After copying, if I try to stretch or re-size the image it starts getting
distorted. Is there a way to standardized
On Dec 19, 2009, at 9:06 AM, baptiste auguie wrote:
Dear list,
In a little numbers game, I've hit a performance snag and I'm not sure
how to code this in C.
The game is the following: how many 8-digit numbers have the sum of
their digits equal to 17?
The brute-force answer could be:
maxi -
2009/12/19 David Winsemius dwinsem...@comcast.net:
On Dec 19, 2009, at 9:06 AM, baptiste auguie wrote:
Dear list,
In a little numbers game, I've hit a performance snag and I'm not sure
how to code this in C.
The game is the following: how many 8-digit numbers have the sum of
their digits
On Dec 19, 2009, at 1:28 PM, Wenjie Lee wrote:
Hi R Users,
I'm using following sample code to save png plots.
png(file=sample.png, width=8, height=6)
Then I copy or use insert pictures function to get the image into
MS Word.
After copying, if I try to stretch or re-size the image it
On 19/12/2009 1:28 PM, Wenjie Lee wrote:
Hi R Users,
I'm using following sample code to save png plots.
png(file=sample.png, width=8, height=6)
Then I copy or use insert pictures function to get the image into MS Word.
After copying, if I try to stretch or re-size the image it starts getting
I hope I have missed a better way to do this in R. Otherwise, I
believe what I'm after is some kind of C or C++ macro expansion,
because the number of loops should not be hard coded.
Why not generate the list of integers that sum to 17, and then mix
with 0s as appropriate?
Hadley
--
Hi
Deepayan Sarkar wrote:
On Wed, Dec 9, 2009 at 10:08 AM, Cable, Samuel B Civ USAF AFMC
AFRL/RVBXI samuel.ca...@hanscom.af.mil wrote:
Thanks, all, for the help. Much obliged. I realize now that I should
have said that I am using lattice graphics. The par() command has not
been helpful in
On Dec 19, 2009, at 1:36 PM, baptiste auguie wrote:
2009/12/19 David Winsemius dwinsem...@comcast.net:
On Dec 19, 2009, at 9:06 AM, baptiste auguie wrote:
Dear list,
In a little numbers game, I've hit a performance snag and I'm not
sure
how to code this in C.
The game is the
Hi,
Thanks for the link, I guess it's some kind of a classic game. I'm a
bit surprised by your timing, my ugly eval(parse()) solution
definitely took less than one hour with a machine not so different
from yours,
system.time( for (i in 1079:1179) if (sumdigits(i)==17) {idx-c(idx,i)})
This problem does yield some interesting and unexpected distributions.
Here is another, the number of positive cases as a function of number
of digits (8 in the original question) and of test value (17).
maxi - 9
N - 5
test - 17
foo - function(N=2, test=1){
sum(rowSums(do.call(expand.grid,
On Dec 19, 2009, at 2:28 PM, baptiste auguie wrote:
Hi,
Thanks for the link, I guess it's some kind of a classic game. I'm a
bit surprised by your timing, my ugly eval(parse()) solution
definitely took less than one hour with a machine not so different
from yours,
system.time( for (i in
Thanks David and Duncan,
pdf()/eps() are good options. Can you please tell which function produces
.wmf images.
I finally want to copy/insert these images into word file (.doc) and submit
it to my adviser, and keep a possibility to re-size pictures.
Is it possible to add these .pdf / .eps
On 19/12/2009 3:06 PM, Wenjie Lee wrote:
Thanks David and Duncan,
pdf()/eps() are good options. Can you please tell which function
produces .wmf images.
win.metafile() (on Windows only, I think) produces .wmf images.
I finally want to copy/insert these images into word file (.doc) and
Hi,
A noobie question: I'm simply trying to run a conditional statement that
evaluates if a substring is found within a larger string. I find that if it
IS found, my function returns TRUE (great!), but if not, the condition does
not evaluate to FALSE.
ex):
if( grep(hi, hop, fixed = TRUE) )
On 12/19/2009 09:06 PM, Wenjie Lee wrote:
Thanks David and Duncan,
pdf()/eps() are good options. Can you please tell which function produces
.wmf images.
I finally want to copy/insert these images into word file (.doc) and submit
it to my adviser, and keep a possibility to re-size
try using 'grepl'
if( grepl(hi, hop, fixed = TRUE) ){
+ print('yes, your substring is in your string')
+ } else print('no, your substring is not in your string')
[1] no, your substring is not in your string
On Sat, Dec 19, 2009 at 3:47 PM, Jonathan jonsle...@gmail.com wrote:
Hi,
A
Hi Jonathan,
grep() returns a vector giving either the indices of the elements of
'x' that yielded a match or, if 'value' is 'TRUE', the matched elements
of 'x' (quoting from the help page, see ?grep).
So you probably want to test whether this vector is empty or not - in
other words,
You can:
1. Right click the graphic and choose copy metafile or save metafile.
2. Use savePlot after producing your plot. See ?savePlot
3. Use win.metafile(...); plot(...); dev.off()
On Sat, Dec 19, 2009 at 1:28 PM, Wenjie Lee wenjieleemaill...@gmail.com wrote:
Hi R Users,
I'm using
Thanks, Jim and Stephen!
On Sat, Dec 19, 2009 at 3:57 PM, jim holtman jholt...@gmail.com wrote:
try using 'grepl'
if( grepl(hi, hop, fixed = TRUE) ){
+ print('yes, your substring is in your string')
+ } else print('no, your substring is not in your string')
[1] no, your substring
Thanks all for your reply,
Wenjie
On Sat, Dec 19, 2009 at 4:20 PM, Gabor Grothendieck ggrothendi...@gmail.com
wrote:
You can:
1. Right click the graphic and choose copy metafile or save metafile.
2. Use savePlot after producing your plot. See ?savePlot
3. Use win.metafile(...); plot(...);
What is equivalent to DROP or KEEP statements of SAS in R?
--
This message was sent on behalf of sarjin...@yahoo.com at openSubscriber.com
http://www.opensubscriber.com/messages/r-help@r-project.org/topic.html
__
R-help@r-project.org mailing list
Try this,
library(lattice)
data(barley)
names(barley)
# Removing first column
barley - barley[,c(-1)]
names(barley)
# Keeping 1st and 3rd column
barley - barley[,c(1,3)]
names(barley)
HTH,
Gary
On Sat, Dec 19, 2009 at 3:21 PM, sarjin...@yahoo.com wrote:
What is equivalent to DROP or KEEP
Hi All,
I'm familiar with bwplot() in lattice package. Is it possible to get such a
boxplot using lattice package:
http://www.reading.ac.uk/ssc/publications/graphics/mma-fig1.gif
instead of the following default:
http://media.wiley.com/wires/WICS/WICS22/mfig005.gif
My aim is to get a compact
Felix Andrews just today posted an answer to a question on filling
the bwplot rectangles with color and using a line instead of a dot for
the median.
I think you will find it difficult to get the hatching for two related
reasons, one aesthetic and the other the fact that patterns are not
The grouped boxplot is one of the features included in the HH package.
An example is posted on my site
http://astro.ocis.temple.edu/~rmh/HH/bwplot-color.pdf
See also the R-help email with an example vaguely similar to yours:
https://stat.ethz.ch/pipermail/r-help/2009-March/190541.html
Hello, all... I've been playing with the TTR package and quantmod, and I'm
loading the Chicago Board of Exchange put/call ratio data via a simple
read.csv call...
CBOEtotal-read.csv(file=
http://www.cboe.com/publish/ScheduledTask/MktData/datahouse/totalpc.csv
,skip=1)
this gives me a data frame
On Fri, Dec 18, 2009 at 3:50 PM, Jeff Breiwick jeff.breiw...@noaa.gov wrote:
Thanks for you advice. I do, in fact, have a call to RODBC in my function
that uses RODBC functions. The first line of that function is
require(RODBC). The odd thing is if I leave off ROBDC from the DESCRIPTION
file
Here is what worked for me:
1) Create a single xts object using one column and the index
2) Merge with the other columns
tt = read.csv(c:/ttt/totalpc.csv, skip=1)
xx = xts(tt$Call, order.by=as.Date(tt$Trade_date, format=%m/%d/%Y))
yy = merge(xx, tt$Put, tt$Total, tt$P.C.Ratio)
Thanks Richard. Which function I should explore in HH package to get such
boxplot?
Peng
On Sat, Dec 19, 2009 at 6:06 PM, Richard M. Heiberger r...@temple.eduwrote:
The grouped boxplot is one of the features included in the HH package.
An example is posted on my site
All the examples have the code file that generate them listed in the
captions. The specific panel function that is usually used is
panel.bwplot.intermediate.hh
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
drop example.
data(iris)
summary(iris)
Sepal.LengthSepal.Width Petal.LengthPetal.Width
Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100
1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300
Median :5.800 Median :3.000 Median :4.350 Median :1.300
Mean
Hi Jonathan,
The function isTRUE is useful for this sort of thing:
isTRUE(pmatch(hi, hop)) evaluates to FALSE.
--Gray
On Sat, Dec 19, 2009 at 12:47 PM, Jonathan jonsle...@gmail.com wrote:
Hi,
A noobie question: I'm simply trying to run a conditional statement that
evaluates if a substring
Dear R Community,
The following seems like a simple problem, but I've been stuck on it for
some time, with no luck using matching or subsetting functions. I'm trying
to remove the rows from a large matrix that match rows in another large
matrix. A (small scale) example:
col1-c(A, B, C, D)
Hello again,
I am simply trying to import a rectangular table of strings. The
table's dimensions are 1990 x 2, yet my read.table() command can only find
362 of the rows (and they're not the first 362). I would've taken the time
to figure out how to use scan, readLines, or some other tool
On Dec 19, 2009, at 11:11 PM, Raymond Danner wrote:
Dear R Community,
The following seems like a simple problem, but I've been stuck on it
for
some time, with no luck using matching or subsetting functions. I'm
trying
to remove the rows from a large matrix that match rows in another
On Dec 19, 2009, at 11:42 PM, Jonathan wrote:
Hello again,
I am simply trying to import a rectangular table of strings. The
table's dimensions are 1990 x 2, yet my read.table() command can
only find
362 of the rows (and they're not the first 362). I would've taken
the time
to figure
On Dec 20, 2009, at 12:07 AM, David Winsemius wrote:
On Dec 19, 2009, at 11:42 PM, Jonathan wrote:
Hello again,
I am simply trying to import a rectangular table of strings. The
table's dimensions are 1990 x 2, yet my read.table() command can
only find
362 of the rows (and they're not
Tried deleting several line above and below line 362; did that and changed
the extension. Still finds the same number of rows (362).
Strange!
Jonathan
On Sun, Dec 20, 2009 at 12:19 AM, David Winsemius dwinsem...@comcast.netwrote:
On Dec 20, 2009, at 12:07 AM, David Winsemius wrote:
On
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Raymond Danner
Sent: Saturday, December 19, 2009 8:12 PM
To: r-help@r-project.org
Subject: [R] Remove rows in a matrix that match rows in another matrix
Dear R Community,
Last one for you guys:
The command:
length(gregexpr('cus','hocus pocus')[[1]])
[1] 2
returns the number of times the substring 'cus' appears in 'hocus pocus'
(which is two)
It's returning the number of **disjoint** matches. So:
length(gregexpr('aa','aaa')[[1]])
[1] 1
returns 1.
**What I
hedelhusk wrote:
Tried deleting several line above and below line 362; did that and changed
the extension. Still finds the same number of rows (362).
On Sun, Dec 20, 2009 at 12:19 AM, David Winsemius
dwinsem...@comcast.netwrote:
On Dec 20, 2009, at 12:07 AM, David Winsemius wrote:
60 matches
Mail list logo