Dear all, I had following calculations with R:
x = vector(length = 4)
x[1] = 1
x[2] = 3
x[3] = 123456789123456
x[4] = -9876543219876
as.integer(x)
[1] 1 3 NA NA
Warning message:
NAs introduced by coercion
What went wrong?
Thanks and regards,
Note that current implementations of*R*use 32-bit integers for integer
vectors, so the range of representable integers is restricted to
about/+/-2*10^9/:|double
http://stat.ethz.ch/R-manual/R-patched/library/base/html/double.html|s
can hold much larger integers exactly.
hth
d
2011-11-26
Dear all,
I need to run a simple linear regression such that:
y = b0 + b1*x1 + (1-b1)*x2 + e
which I know I can use:
lm(y ~ I(x1 - x2) + offset(x2)).
However, I also need to restrict the coefficient b1 to be between 0 and 1.
Is there any way to include such restriction in the linear regression
Sounds like it is or could be considered a mixtures problem. Check
out the FlexMix package, which looks like it should do exactly what
you want. (But maybe not, so look carefully).
-- Bert
On Sat, Nov 26, 2011 at 6:10 AM, Julia Lira julia.l...@hotmail.co.uk wrote:
Dear all,
I need to run a
Hello,
I am running Windows 7 and R-2.13 in StatET.
When I try to create a directory it does not print any errors but if I check
outside eclipse if it exists or do a refresh in Eclipse the directory is not
been created. The strange thing is that it happens only to some
sub-folders... On the
I'm not a Windows man, but have you tried in the R CLI or GUI rather than
Eclipse? That would help narrow down the problem.
Also, if you could provide a minimal example for those who have Windows boxes
that'd be great - though admittedly it sounds hard here.
As an outline, something like:
Hello!
Is it posible to apply /cumsum()/ along the 3rd dimension of 3D array?
Something like matrlab function - /cumsum (*A*,dim)/ which returns the
cumulative sum of the elements along the dimension of *A* specified by
scalar dim.
Thanks in advance
Željka
--
View this message in context:
I have two time series
a - ts(1:10, start=c(1,6), end=c(2,5), frequency=10)
b - ts(1:5, start=c(2,1), end=c(2,5), frequency=10)
Obviously 'b' is a subset of 'a'. I want a single index value indicating
where that start of 'b' lines up with the start of 'a'. So in this simple
example I
On Sat, Nov 26, 2011 at 10:55 AM, Kevin Burton rkevinbur...@charter.net wrote:
I have two time series
a - ts(1:10, start=c(1,6), end=c(2,5), frequency=10)
b - ts(1:5, start=c(2,1), end=c(2,5), frequency=10)
Obviously 'b' is a subset of 'a'. I want a single index value indicating
where
zloncaric zloncaric at biologija.unios.hr writes:
Is it posible to apply /cumsum()/ along the 3rd dimension of 3D array?
Something like matrlab function - /cumsum (*A*,dim)/ which returns the
cumulative sum of the elements along the dimension of *A* specified by
scalar dim.
Check out the
On Nov 25, 2011, at 11:27 PM, sutada Mungpakdee wrote:
Hi,
Has anyone know about how to get the correct plot?
I have use this R script (as below), so I expect the plot is based
on x axis, but the result was opposite. Any suggestion will be great.
You question doesn't make clear what you
On Nov 26, 2011, at 9:32 AM, zloncaric wrote:
Hello!
Is it posible to apply /cumsum()/ along the 3rd dimension of 3D array?
Something like matrlab function - /cumsum (*A*,dim)/ which returns the
cumulative sum of the elements along the dimension of *A* specified by
scalar dim.
`apply` lets
On Nov 26, 2011, at 11:24 AM, David Winsemius wrote:
On Nov 26, 2011, at 9:32 AM, zloncaric wrote:
Hello!
Is it posible to apply /cumsum()/ along the 3rd dimension of 3D
array?
Something like matrlab function - /cumsum (*A*,dim)/ which returns
the
cumulative sum of the elements along
Seems to work fine. Thank you.
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: Saturday, November 26, 2011 10:11 AM
To: Kevin Burton
Cc: r-help@r-project.org
Subject: Re: [R] Time series merge?
On Sat, Nov 26, 2011 at 10:55 AM, Kevin Burton
Greetings, friends (and others :) )
We generated a bunch of results and saved them in an RData file. We
can open, use, all is well, except that the size of the saved file is
quite a bit larger than we expected. I suspect there's something
floating about in there that one of the packages we are
I'm an SPSS user trying to make the transition to R.
Can someone help me translate the following SPSS code into R?:
GLM Total_tp1 Total_tp2 WITH Age Sex
/WSFACTOR=Time 2 Repeated
/METHOD=SSTYPE(3)
/CRITERIA=ALPHA(.05)
/WSDESIGN= Time
/DESIGN= Age Sex Age*Sex.
Also. can anyone
Thank you very much David - R is so rich, the easy way can be hard to find.
Just to close this out for others, the final solution I used was:
Peak2Return - function(v) {
S - cummax(v)
L - which((v ==S) (diff(c(0,v)0))
R - sapply(v[L], function(x,S) {which(x S)[1]; }, S)
now you have L
Hi Josh,
Thanks for the kind reminder of posting the dataframe on. My dataframe
contains lots of categorical variables, which seems to be problematic. For
instance,
dobstatus edu mrext
married highschool yes, full time
Do you know how to specify
On 11-11-26 1:41 PM, Paul Johnson wrote:
We generated a bunch of results and saved them in an RData file. We
can open, use, all is well, except that the size of the saved file is
quite a bit larger than we expected. I suspect there's something
floating about in there that one of the packages
If you know SPSS already why not learn R modeling syntax and do this
yourself?
If ALPHA(.05) implies that you are using stepwise variable selection note
that this is an invalid statistical technique.
Frank
Kristi Shoemaker wrote
I'm an SPSS user trying to make the transition to R.
Can
Perhaps this website and the associated book will be of help:
http://r4stats.com/
Michael
On Nov 26, 2011, at 11:08 AM, Kristi Shoemaker kristi.shoema...@yahoo.com
wrote:
I'm an SPSS user trying to make the transition to R.
Can someone help me translate the following SPSS code into R?:
Dear Kristi,
I assume that this is a repeated-measures ANOVA with one within-subjects
factor (Time) and two between-subjects factors (Age and Sex, which are
crossed). If Age is numeric, and not a factor, then the type-III tests
that you requested don't test sensible hypotheses. In any event, if
On Sat, 26 Nov 2011 12:41:08 -0600
Paul Johnson pauljoh...@gmail.com wrote:
Greetings, friends (and others :) )
We generated a bunch of results and saved them in an RData file. We
can open, use, all is well, except that the size of the saved file is
quite a bit larger than we expected. I
Why do you need to use a frequency attribute for these data? The point
of the zoo/xts line of time series implementations is that the time
stamps are carried through for each observation (unlike ts) and can be
irregular. Both classes exist precisely to avoid being forced into a
frequency
Try xts (tsObj, order.by=index (tsobj))
On Nov 26, 2011 10:57 AM, Kevin Burton rkevinbur...@charter.net wrote:
I have two time series
a - ts(1:10, start=c(1,6), end=c(2,5), frequency=10)
b - ts(1:5, start=c(2,1), end=c(2,5), frequency=10)
Obviously 'b' is a subset of 'a'. I want a
On Tue, Nov 22, 2011 at 6:50 PM, Kevin Burton rkevinbur...@charter.net wrote:
Void of any other suggestions this approach makes sense but for my case I
think I need to use zoo objects rather than xts. If I sequence the data
generally I don't know if there will be 365 days in the year or 366. So
Hi Fei,
I wouldn't worry to much about categorical variables for mice. Mice
would use logisitic regression for binary and polytomous logistic
regression for categorical variables with 2 levels. However, you
should not include factors with a lot of levels, saying30, in
imputation models because it
I've been using the R package randomForest but there is an aspect I
cannot work out the meaning of. After calling the randomForest
function, the returned object contains an element called prediction,
which is the prediction obtained using all the trees (at least that's
my understanding). I've
Hi Weidong,
Thank you for the clear explanation. You are right it is not the categorical
variables that are causing the trouble. It might be the relatively small
number of sample that causing the problem given so many variables. I tried
to exclude some variables that are not essential to all the
Hi
I would like to shorten
mod1 - nls(ColName2 ~ ColName1, data = table, ...)
mod2 - nls(ColName3 ~ ColName1, data = table, ...)
mod3 - nls(ColName4 ~ ColName1, data = table, ...)
...
is there something like
cols = c(ColName2,ColName3,ColName4,...)
for i in ...
mod[i-1] - nls(ColName[i] ~
Hi
is there a way to append a plot as PDF to an existing PDF file?
savePlot seems not to have this possibility.
Christof
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
PDF files contain information at the end of them and so you cannot append
without altering the file (universally true for PDF). Perhaps pdf() your plots
and use external tools to convert the PDFs to .ps then re-merge. Might not be
the best way, but an effective one.
Ken Hutchison
There is the 'pdftk' (PDF tool kit) that you will find on the web that
will do the job. I have used it to both combine and split out the
pages in the PDF file.
On Sat, Nov 26, 2011 at 5:51 PM, Ken vicvoncas...@gmail.com wrote:
PDF files contain information at the end of them and so you cannot
Dear all,
I'm trying to use data.table to summarise a table and merge it to another
table. Here is what I would like to do, but by using data.table() in a proper
way.
library(data.table)
tab1 - data.table(ID = 11:20, A = rnorm(10), D = 1:10, key = ID)
tab2 - data.table(ID2 = 1:10, D = rep(1:5,
Hi Fei,
On Sat, Nov 26, 2011 at 9:07 AM, Fei fayechen0...@hotmail.com wrote:
Hi Josh,
Thanks for the kind reminder of posting the dataframe on. My dataframe
contains lots of categorical variables, which seems to be problematic. For
instance,
dob status edu
Hi:
Here's one way you could do it. I manufactured some fake data with a
simple model to illustrate. This assumes you are using the same model
formula with the same starting values and remaining arguments for each
response.
dg - data.frame(x = 1:10, y1 = sort(abs(rnorm(10))),
Hi Matthew,
The error rate reported by randomForest is the prediction error based
on out-of-bag OOB data. Therefore, it is different from prediction
error on the original data since each tree was built using bootstrap
samples (about 70% of the original data), and the error rate of OOB is
likely
Hi:
There may well be a more efficient way to do this, but here's one take.
library('data.table')
# Want to merge by D in the end, so set D as part of the key:
t1 - data.table(ID = 11:20, A = rnorm(10), D = 1:10, key = ID, D)
t2 - data.table(ID2 = 1:10, D = rep(1:5, 2), B = rnorm(10), key = ID2,
I'm trying to do the second case among Jim's suggestions. I used Bert's
suggestion and it works great.
I would also like to ask if anyone is familiar with a package for making
box-plots. I would like to bin my datapoints at defined X intervals and
display a boxplot for each bin on the same
On Nov 27, 2011, at 12:15 AM, Jeffrey Joh wrote:
I'm trying to do the second case among Jim's suggestions. I used
Bert's suggestion and it works great.
I would also like to ask if anyone is familiar with a package for
making box-plots. I would like to bin my datapoints at defined X
Dear all,
I have problems with iif function using sqldf library.
I counted abundance (Num) of different SPECIES in two moments (esf) saving
the information in two Tables (esf50, esf100):
esf50
SAMPLE SPECIES Num esf
1289diso1 44
Dear R-help,
I have been trying really hard to generate the following vector given
the data (x) and parameter (alpha) efficiently.
Let y be the output list, the aim is to produce the the following
vector(y) with at least half the time used by the loop example below.
y[1] = alpha * x[1]
good night
Again I ask for help to the community, as I am new at this, I have some
basic questions.
I am looking for packages on neural networks and so you can search found
these two that I think are the most used, neuralnet, nnet.
So you can test, and correct me if I'm wrong the neuralnet
Hi Josh,
You opened the blackbox up to me. Now I know what is the right way to go.
Thank you so much!
Best,
Fei
--
View this message in context:
http://r.789695.n4.nabble.com/computationally-singular-error-with-mice-tp4109583p4111537.html
Sent from the R help mailing list archive at
sqldf uses the SQLite database by default for backend processing. The iif
function is specific to the Jet database engine syntax (which underlies MS
Access). You could read up on SQLite syntax, or you could avoid using
nonstandard SQL syntax, retrieve the data into a data frame, and use R code
Aloha all,
I haven't been able to find how to choose the font used by tikzDevice.
My first tries have all been set with a serif font and I'd like to have
them use the sans serif font instead. I've looked through the
documentation and googled a bit without success. Is this possible? Can
someone
46 matches
Mail list logo