Hi
library(partitions)
jj - blockparts(rep(9,8),17)
dim(jj)
gives 318648
HTH
rksh
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
No, it does not mean that the numbers have zero chance of being wrong. The
extent to which the estimate can be wrong (which is a very bad and imprecise
expression) is indicated by the standard error.
The p-value close to zero implies that the intercept of the underlying
population from which your
Dear useRs,
We are happy to announce a new version of the randtoolbox* package
(version 1.09) on CRAN. The package is dedicated to Random Number
Generation and in a less exhaustive way to RNG tests. The package is
source-controlled at r-forge as part of the Rmetrics project
Wow!
system.time({
all = blockparts(rep(9,8),17)
print( dim(all[,all[1,]!=0])[2] ) # remove leading 0s
})
## 229713
user system elapsed
0.160 0.068 0.228
In some ways I think this is close to Hadley's suggestion, though I
didn't know how to implement it.
Thanks a lot to everybody who
Hello again everybody.
I fired off my reply before reading the correspondence about
the leading zeros.
You can also assume that there is at least one block
at the leading position, [so that position can take 0,1,2,...,8 additional
blocks] and distribute the remaining 16 blocks amongst all 8
I wonder whether this answers Baptiste's question as asked.
1: An 8-digit number can have some digits equal to 0;
see Baptiste's comment maxi - 9 # digits from 0 to 9
2: According to the man-page fror blockparts in partitions,
all sets of a=(a1,...,an) satisfying Sum[ai] = n subject
to
OOPS!! See correction below!
On 21-Dec-09 08:45:13, Ted Harding wrote:
I wonder whether this answers Baptiste's question as asked.
1: An 8-digit number can have some digits equal to 0;
see Baptiste's comment maxi - 9 # digits from 0 to 9
2: According to the man-page fror blockparts in
Hi Ted.
you've found a bug in the documentation for blockparts().
It should read 0 = ai = yi. I'll fix it before the next
major release (which will include sampling without replacement from
a multiset, Insha'Allah).
Best wishes
rksh
(Ted Harding) wrote:
I wonder whether this answers
Thanks very much it solved my problem.
cheers,
Amit
On Sun, Dec 20, 2009 at 7:56 PM, David Winsemius dwinsem...@comcast.net wrote:
On Dec 20, 2009, at 1:35 PM, Amit wrote:
Dear All,
I am trying to plot polynomial regression line to a scatterplot. I did
following so far:
x=c(1:9335)
Sunny Srivastava wrote:
Dear R-Helpers,
I am having troubles with installing with MCMCglmm package and I get the
following error with a package Matrix
Warning in library(pkg, character.only = TRUE, logical.return = TRUE,
lib.loc = lib.loc) :
there is no package called 'Matrix'
Error:
See the FAQs, particularly
How can I save the result of each iteration in a loop into a separate
file? which applies for the other way round as well.
Uwe Ligges
Maithili Shiva wrote:
Dear R helpers,
Suppose I am dealing with no of interest rates at a time and the no of interest rates I am
Hi
I'm not sure if I understood your problem correctly..
Perhaps you are looking for something like this?
Best regards,
Roger
Result - c()
yourPath - c:\\temp
filesInDir - dir(yourPath)
for(file in filesInDir){
fileInfo - paste(yourPath,file,sep=\\)
tmp - read.csv(fileInfo)
# assign(file,tmp)
Hello,
How can generate a sample from h(u)=min{a,log(u)} for 0u1 in R,please?
thank you
khazaei
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
or if Dataset is a data.table :
Dataset = data.table(Dataset)
Dataset[,abs(ratio-median(ratio)),by=LEAID]
LEAIDV1
[1,] 6307 0.0911905
[2,] 6307 0.0488095
[3,] 6307 0.0488095
[4,] 6307 0.1088095
[5,] 8300 0.2021538
[6,] 8300 0.000
[7,] 8300 0.060
rather than :
Hi, see the example below. There must be a way to do this with apply or
tapply, but it always returned an error incorrect number of dimensions. At
least the code below works
n=100
a=rnorm(n)
u=runif(n)
f=function(x){min(x[,1],log(x[,2]))}
x=data.frame(a,u)
apply(x,1,f) #does not work
#this
Use pmin like this:
set.seed(123)
pmin(-0.1, log(runif(25)))
[1] -1.2462628 -0.2378700 -0.8940966 -0.1244104 -0.100 -3.0888020
[7] -0.6384592 -0.1138195 -0.5952313 -0.7839153 -0.100 -0.7911258
[13] -0.3892415 -0.5575096 -2.2737578 -0.100 -1.4020672 -3.1686692
[19] -1.1149834
I've just posted a demo made with the rgl package to Youtube, visible
here: http://www.youtube.com/watch?v=prdZWQD7L5c
For future reference, here are the steps I used:
1. Design a shape to be displayed, and then play with the animation
functions to make it change over time. Use play3d to
cut() might work if you want a character version...
set.seed(221)
x-rnorm(50)
y-rnorm(1)
xh-hist(x)
cut(y, breaks=xh$breaks)
#or
as.character(cut(y, breaks=xh$breaks))
#or for a 'level number' version (a bit like which())
as.numeric(cut(y, breaks=xh$breaks))
Jim Lemon j...@bitwrit.com.au
I don't know the details of why this is happening, but in any case it
is a good idea to round() your times if you want to convert them to
dates. Just as you would round() a numeric value to convert it to an
integer.
as.Date(round(zzz1, days))
2009/12/21 Jason Morgan jwm-r-h...@skepsi.net:
Thanks Barry for the clarification.
With regards to the following;
d2[[i]] - file[[i]] - mean
renamed to
d2[[i]] - f[[i]] - m
The object f contains the following so clearly f is subsettable
[[1]]
V1
1 10
2 10
3 10
[[2]]
V1
1 11
2 11
3 11
[[3]]
V1
1 12
2 12
3 12
My plan is to subtract
On Mon, Dec 21, 2009 at 1:43 PM, Muhammad Rahiz
muhammad.ra...@ouce.ox.ac.uk wrote:
Thanks Barry for the clarification.
With regards to the following;
d2[[i]] - file[[i]] - mean
renamed to
d2[[i]] - f[[i]] - m
The object f contains the following so clearly f is subsettable
[[1]]
V1
Hi
You were instucted to
1. Read a good introduction to R. You are making a number of
fundamental mistakes here.
2. Run each line separately and check what value you get back by
printing it.
3. Don't give your objects the same name as R functions (you're using
'seq', 'file', and
On Mon, Dec 21, 2009 at 12:42 PM, Duncan Murdoch murd...@stats.uwo.ca wrote:
I've just posted a demo made with the rgl package to Youtube, visible here:
http://www.youtube.com/watch?v=prdZWQD7L5c
For future reference, here are the steps I used:
1. Design a shape to be displayed, and then
Good Morning:
I've read many, many posts on the r-help system and I feel compelled to quickly
admit that I am relatively new to R, I do have several reference books around
me, but I cannot count myself among the fortunate who seem to strong
programming intuition.
I have a data set consisting
On Mon, Dec 21, 2009 at 4:12 PM, Adam Carr adamlc...@yahoo.com wrote:
Good Morning:
I've read many, many posts on the r-help system and I feel compelled to
quickly admit that I am relatively new to R, I do have several reference
books around me, but I cannot count myself among the fortunate
Hi there,
I was looking for a Lorentz-distribution in R but I didn't find any
physical distribution. Is there s.th which I can use for fitting.
thanks
Markus
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
I want to split my whole dateset to training set and test set, building model
in training set, and validate model using test set. Now, How can I split my
dataset to them reasonally. Please give me a hand, It is better to give me
some R code.
and I see some ways like using SOM to project whole
On Dec 21, 2009, at 10:12 AM, Adam Carr wrote:
Good Morning:
I've read many, many posts on the r-help system and I feel compelled
to quickly admit that I am relatively new to R, I do have several
reference books around me, but I cannot count myself among the
fortunate who seem to strong
Not ellegant.. but...
MyDF-data.frame(cbind(x=runif(10), y=rnorm(10)))
TrainingSize=5
TrainingSize_list-sample(1:nrow(MyDF))[1:TrainingSize]
TrainingSize_list
MyDF.training-MyDF[(1:nrow(MyDF) %in% TrainingSize_list),]
MyDF.training
MyDF.test-MyDF[ ! (1:nrow(MyDF) %in% TrainingSize_list),]
Hi,
On Mon, Dec 21, 2009 at 9:09 AM, bbslover dlu...@yeah.net wrote:
I want to split my whole dateset to training set and test set, building model
in training set, and validate model using test set. Now, How can I split my
dataset to them reasonally. Please give me a hand, It is better to
Hi!
I'm trying to compare maximum likelihood estimator with maximum spacing
estimator (in Generalized extreme value distribution). My problem is the
following: i know how to determinate maximum likelihood estimator on R, but
i dont find a way to do the maximum spacing estimator...:-(
Any help
keywords: debug, do.call, debugging in, suppress, arguments, list,
screen, console, output
Hi,
I would like to control the output to the console while debugging
functions that are called by do.call( FCN, ARGUMENTS ) when the
arguments are quite large. Is there a simple way to suppress
Hi,
I've just been browsing for IDEs for R, see e.g.
http://www.linuxlinks.com/article/20080413133953606/R.html
It's probably highly subjective, but which free IDE is the best one around? For
the Python language, I've always been using IDLE. I like the syntax
highlighting and the syntax
When I run the following code in a loop I get an error after about 125 times
saying too many open files...
if(inherits(atmpt, try-error)){
output - paste(yahooSymbol,\n,sep=)
write(output, file = data, append = TRUE, sep = )
} else {
I've tried various things to close
Hi Albert-Jan,
This question gets asked a lot, in both r-help and r-devel, so you
should search the mailing list archives. The answers usually favor
Emacs (GNU or X) with ESS.
--Gray
On Mon, Dec 21, 2009 at 11:18 AM, Albert-Jan Roskam fo...@yahoo.com wrote:
Hi,
I've just been browsing for
On Mon, 21 Dec 2009, Stuart Andrews wrote:
keywords: debug, do.call, debugging in, suppress, arguments, list, screen,
console, output
Hi,
I would like to control the output to the console while debugging functions
that are called by do.call( FCN, ARGUMENTS ) when the arguments are quite
That would work... except I've got a DBConnection I don't want to close and
open constantly
On Mon, Dec 21, 2009 at 12:28 PM, Henrique Dallazuanna www...@gmail.comwrote:
Try:
closeAllConnections()
On Mon, Dec 21, 2009 at 3:22 PM, Nick Torenvliet
nick.torenvl...@gmail.com wrote:
When I
Try:
closeAllConnections()
On Mon, Dec 21, 2009 at 3:22 PM, Nick Torenvliet
nick.torenvl...@gmail.com wrote:
When I run the following code in a loop I get an error after about 125 times
saying too many open files...
if(inherits(atmpt, try-error)){
output -
I noticed Max already pointed you to the caret package.
Load the library and look at the help for the createFolds function, eg:
library(caret)
?createFolds
I think that the createDataPartition function in caret might work
better for you.
There are a number of other packages with similar
The caret package is so good, I am learning it, but one problem is that
nearZeroVar function can be used to identify near zero–variance variables and
it only identify, how can I remove those variables that were identify,
because I have many zero- or near zero- ones, it is not realistic to
Hi Nick,
I hope you're being a little disingenuous about how hard you looked
Typing ?close will pull up the right help page. I think you're
having trouble because you don't store the file object in a variable,
so there's no convenient way to refer to it when you need to close it
(or when
My preferred solution would be to use the select option of the subset function.
data ( iris )
names ( iris )
[1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# KEEP-like way
iris_subset_by_keep - subset ( iris, select = c( Sepal.Length, Species )
)
# DROP-like way
Good Afternoon Dr. Winsemius:
You ask some very good questions and make excellent points; my responses are
below. I've tried to extract your questions and provide answers just to reduce
the clutter.
1. You might want to provide statistical justification for the otherwise
puzzling sampling
Hey all, thanks for your input... assigning the connection and then using
unlink works just fine.
Thanks
On Mon, Dec 21, 2009 at 12:33 PM, Gray Calhoun gray.calh...@gmail.comwrote:
Hi Nick,
I hope you're being a little disingenuous about how hard you looked
Typing ?close will pull up
Well, I'm back again.
Thanks for all the help. Besides working, it's helping me begin to
understand how these functions work.
I still have trouble reading or following the process of a function, which
brings my next question:
Dataset:
LEAID ratio
3 6307 0.720
1 6307
I'm trying to build a model with an overall smooth function for all
the data, plus an additional smooth function for *some* of the data.
If ind is my indicator variable (0 for some x, 1 for others), I
imagined I could write it like this:
gam.obj - gam(y ~ s(x) + ind*s(x))
but this does not
Thanks Petr, Barry David for your useful comments.
Given
d2[[i]] - f[[i]] - m
The problem lies in how I define the object, d2[[i]], which I managed to
resolve by
d2 - list()
--
Muhammad Rahiz | Doctoral Student in Regional Climate Modeling
Is the Lorentz distribution another name for the Cauchy distribution
with density
f(x) = \frac{1}{\pi} \frac{1}{1+x^2}
possibly with location and scale parameters?
albyn
On Mon, Dec 21, 2009 at 05:04:05PM +0100, Markus Häge wrote:
Hi there,
I was looking for a Lorentz-distribution in R
Hi:
Could you please guide me how to do a qq plot for a 3-parameter lognormal
curve. Here is an example from VGAM package to fit lognormal curve. I need to
do a qq plot to check the fit.
Thanks.
lambda = 4
y = lambda + rlnorm(n - 1000, mean=1.5, sd=exp(-0.8))
fit = vglm(y ~ 1, lognormal3,
The easiest way to do this is to use an lapply:
#in working directory
filelist - list.files()
ranges - lapply(filelist[grep(.*range\\.csv, filelist)], read.csv)
probs - lapply(filelist[grep(.*probs\\.csv, filelist)], read.csv)
Hope this helps,
Greg
On 12/20/09 10:24 PM, Maithili Shiva wrote:
Hi
Marius Hofert wrote:
Dear R-users,
I have a plot created with the code below. I tried to put some text
to the right of the color key. I worked with grid.text and also
viewport(), but couldn't achieve this. I know this should be simple,
but I just couldn't figure out how to do it. How does
Hi:
Could you please guide me how to plot weekly.t2. Below are my values and I
am only able to plot weekly t1 but failing to add a second line
representng weekly t2.
Thanks.
weekly.t1
[1] 228.5204 326.1224 387.2449 415.4082 443.6735 454.6939 451.5306 475.1020
483.2653 483.0612 488.9362
Hi, I am having problems working out what to do with my data, I have a series
of positions (26 for each limb!), nested within a limb (10 of them), nested
within a posture (30 of them). I then have 5 observers rating themso
far I have tried lmer and glm but R doesn't want to play. I'm not
Hi teo,
try lines() instead of points().
HTH
Stephan
teo schrieb:
Hi:
Could you please guide me how to plot weekly.t2. Below are my values and I
am only able to plot weekly t1 but failing to add a second line
representng weekly t2.
Thanks.
weekly.t1
[1] 228.5204 326.1224 387.2449 415.4082
Hi,
I have the following table of odds ratios (or), lower limits(ll) and upper
limits(ul), which I would like to plot as horizontal lines beginning at the
lower limit, ending at the upper limits and with a dot at the odds ratio on an
x-axis on a log10 scale. The y axis would be the study
Ot should be noted that the performance of single split into training +
test does not perform satisfactorily unless N 10,000 in many cases.
Frank
Max Kuhn wrote:
I noticed Max already pointed you to the caret package.
Load the library and look at the help for the createFolds function, eg:
On Dec 21, 2009, at 2:54 PM, Rice, Terri wrote:
Hi,
I have the following table of odds ratios (or), lower limits(ll) and
upper limits(ul), which I would like to plot as horizontal lines
beginning at the lower limit, ending at the upper limits and with a
dot at the odds ratio on an x-axis
Sorry for asking again, but I did not receive any answers - I know it's a busy
time... ;-)
Shell I conclude that it is not possible to obtain standard errors from
StructTS()
or its output?
Thanks,
Giovanni Petris
- Original Message -
From: Giovanni Petris gpet...@uark.edu
Date:
mxm.margarida wrote:
Hi!
I'm trying to compare maximum likelihood estimator with maximum spacing
estimator (in Generalized extreme value distribution). My problem is the
following: i know how to determinate maximum likelihood estimator on R, but
i dont find a way to do the maximum spacing
Alternate hypotheses:
HA1: There is no one in the readership who is familiar with the
function (unlikely), or among those lacking knowledge of what package
it might reside in (such as myself) chose not to look up what you
might have provided on the first posting: a self-contained example
On 21-Dec-09 21:19:27, Marc Schwartz wrote:
On Dec 21, 2009, at 2:54 PM, Rice, Terri wrote:
Hi,
I have the following table of odds ratios (or), lower limits(ll) and
upper limits(ul), which I would like to plot as horizontal lines
beginning at the lower limit, ending at the upper limits
Please look at the aedotplot, in which we plot four variables:
A effect, B effect, relative risk, and CI on the relative risk.
It should be easily modified to plot the odds ratios.
## install.packages(HH) ## if you don't have it yet.
library(aedotplot)
example(aedotplot)
On Dec 21, 2009, at 4:13 PM, Ted Harding wrote:
On 21-Dec-09 21:19:27, Marc Schwartz wrote:
On Dec 21, 2009, at 2:54 PM, Rice, Terri wrote:
Hi,
I have the following table of odds ratios (or), lower limits(ll) and
upper limits(ul), which I would like to plot as horizontal lines
beginning at
Using R 2.10 on Windows:
I have a filtered database of 650k event observations in a data frame
with 20+ variables.
I'd like to be able to quickly generate estimate and plot survival
curves. However the survfit and cph() functions are extremely slow.
As an example: I tried
Dear R experts,
Might be very simple question to ask but would be insightful. As the same story
of nested for loops. following is the code that I am using to get the
autocorrelation function of the sample data. I have tried to get rid of for
loops but since I am touching R after such a long
Using R 2.10 on Windows:
I have a filtered database of 650k event observations in a data frame
with 20+ variables.
I'd like to be able to quickly generate estimate and plot survival
curves. However the survfit and cph() functions are extremely slow.
As an example: I tried
Thank you for all help. It is helpful for me.
Max Kuhn wrote:
I noticed Max already pointed you to the caret package.
Load the library and look at the help for the createFolds function, eg:
library(caret)
?createFolds
I think that the createDataPartition function in caret might work
On Dec 21, 2009, at 8:20 PM, gregory.bron...@barclayscapital.com
wrote:
Using R 2.10 on Windows:
I have a filtered database of 650k event observations in a data frame
with 20+ variables.
I'd like to be able to quickly generate estimate and plot survival
curves. However the survfit and
Hi all,
I have a gtable and a ggraphic widget.
I want to drag an element from the table onto the graphic.
When the drag object is released over the ggraphic widget, I want the
mouse coordinates inside the ggraphic to be returned.
Right now I do not know how to get the mouse ccordinates of the
Rcpp version 0.7.0 went onto CRAN this weekend. The key new features are
o inline support, taken from Oleg Sklyar's neat inline package and
adapted/extented to support Rcpp as well as external libraries
(see below for an example); this even works on Windows (provided you
have
Thanks a lot.
2009/12/20 Henrique Dallazuanna www...@gmail.com
Try this also:
sapply(s, function(x)format(x, big.interval = nchar(x) - 3, big.mark =
.))
On Sun, Dec 20, 2009 at 7:50 PM, rusers.sh rusers...@gmail.com wrote:
Hi,
Anybody can give me some hints on the following problem?
71 matches
Mail list logo