Hello. I have been working on a project which involves random number
generation and unit root test. After I generate the numbers (I am generating
stock returns using rnorm(1000,0,0.25), I want to check if the series has a
unit root or not. But before I should modify the data to time series. My
One thing to keep in mind is the no side effects rule in R. Almost all
variables are copied on assignment/modification. Of course, there's also
lazy instantiation, so the copy isn't actually constructed unless it needs
to be, but this can impact the expected performance of more complicated data
Since nobody else has respond, I thought I'd take a stab. Maybe if I'm
wrong enough somebody will correct me, but my understanding is that that
kind of situation, ie the pain of getting the correct method called when
there is a dependency on the type of more than one argument is part of the
There aren't a whole lot of more complex data structures available as R
packages. My impression is that pure R implementation offers
dissatisfactory performance and native (or e.g. java) implementations end
up inconsistent with R's no side effects principles. I'd suggest building
an R interface
On 14.06.2011 22:29, Daniel Malter wrote:
Hi,
pick up any introductory manual of which there are many online. It so
happens that the functions for mean and sd are called mean() and sd(). If
you want to know how to use them type ?mean or ?sd in the R-prompt and hit
enter.
... and some rants
On Tue, Jun 14, 2011 at 08:40:00AM -0700, xuyongdeng wrote:
Any one know is there any package or function to generate bivariate
exponential distribution? I gusee there should be three parameters, two rate
parameters and one correlation parameter. I just did not find any function
available on
Dear Sigrid,
This is very easy with the ggplot2 package
install.packages(ggplot2)
library(ggplot2)
ggplot(data = Your.Data.Frame, aes(x = YEAR, y = YIELD, colour = TREATMENT)) +
geom_point() + geom_smooth(method = lm) + facet_wrap(~Country)
Best regards,
Thierry
-Oorspronkelijk
Hi
r-help-boun...@r-project.org napsal dne 14.06.2011 18:28:42:
Andreas Betz ab...@portola.com
Odeslal: r-help-boun...@r-project.org
14.06.2011 18:28
Komu
r-help@r-project.org
Kopie
Předmět
[R] problems with plots in loop (corrected Email)
Dear helpers,
In an
Thanks Greg,
Using rasterImage and the steps you described works fine!
I agree with the distraction! But my purpose is to superimpose a heat map of
eye tracking data on the original picture...
Thanks!
- original message
Subject: RE: [R] plotting on an image
Sent: Wed, 15 Jun
Dear,
I have a data frame melted from a list of matrices (melt from reshape
package), then I impute some missing values and then want to tabulate
the data again to the array (or list, doesn't matter) of matrices form.
However when using xtabs function it orders my rows alphabetically and
On 06/14/2011 08:53 PM, Agustin Lobo wrote:
Hi!
I'm displaying a contingency table with heatmap():
svm.predPix.tabla
svm.predPix CC DD LL NN NN2
CC 22 0 3 8 3
DD 0 27 0 1 0
LL 1 1 90 3 7
NN 2 0 1 11 4
NN2 0 0 5 1 20
I have some data I would like to model which involves choice of food by
dung beetles.
There are a number of experiments where in each case, there are five
choices. Overall there are more than 5 different foods being compared
(including a placebo) and different experiments use different
On Wed, 15 Jun 2011, David Scott wrote:
I have some data I would like to model which involves choice of food by
dung beetles.
There are a number of experiments where in each case, there are five
choices. Overall there are more than 5 different foods being compared
(including a placebo) and
I am using AUTO ARIMA for forecasting. But it is not detecting 'seasonality
term' of its own for any data.
Is there any other method by which we can detect seasonality and its
frequency for any data?
Is there any method through which seasonality and its frequency can be
automatically detected
Dear all, I have been working in a plot based on figure 5.6 of the Lattice book
(http://lmdvr.r-forge.r-project.org/figures/figures.html).
I
have already modified it to include the size of the circles as another
variable, but I would like to modify the legend to show it (like they do
it in
Hi,
I have a dataframe column from which I want to calculate the number of
1's in each entry. Some column values could, for example, be
0001001000 and 111.
To get the number of occurrences from a string I use this:
sum(unlist(strsplit(mydata[,my_column], )) == 1)
However, as my data is
Hi all,
I have a 2 files, one with a series of beginning and end times of animal
dives in (lets call it dives). The other file is readings from a time-depth
recorder, there is a datetime reading for every second, a temperature and
light level reading (lets call it tdr).
Now I want to say from
On Wed, 15 Jun 2011, siddharth arun wrote:
I am using AUTO ARIMA for forecasting.
I assume you mean function auto.arima() from package forecast.
But it is not detecting 'seasonality term' of its own for any data.
Yes, it does so, if you supply a time series object with a frequency 1.
Is
Hi there
I am trying to install Rmpi (version 0.5-4) on our 8-core SUSE Linux
Enterprise Server 11 SP1. I read all I could find about Rmpi installation
but still cannot get it working.
Here the last command that I used:
R CMD INSTALL
I agree that this is a really outdated source but I did not find the
way to tell R using correctly the tcl version included (at least for
the 64 bit version).
If I remove the environment variables, things work for R 32 bit (it
uses the tcl version included), but it does not work in R 64 bit.
Hmm,
looks like there was a trailing blank after the backslash and before end of
line,
resulting in --with-Rmpi-libpath possibly not recognised:
\--with-Rmpi-libpath=/usr/lib64/mpi/gcc/openmpi/lib64 \
I also doubt there is real need to escape newlines within a string. But another
On Tue, Jun 14, 2011 at 19:56, idris idris.r...@gmail.com wrote:
Follow up question: My data contains x, y, height, and day.
I want to create the heatmap for each day, keeping the color coding
consistent.
I've created an example with 2 days, and you can see the charts below.
Notice that
Thank you very much Hugo. Using the command as suggested results exactly
the same error:
# R CMD INSTALL
--configure-args=--with-Rmpi-include=/usr/lib64/mpi/gcc/openmpi/include
--with-Rmpi-libpath=/usr/lib64/mpi/gcc/openmpi/lib64
--with-Rmpi-type=OPENMPI Rmpi_0.5-4.tar.gz
* installing to library
Well, the R code in package tcltk for startup under Windows is, as you
could have found out yourself easily:
.onLoad - function(lib, pkg)
{
packageStartupMessage(Loading Tcl/Tk interface ...,
domain = R-tcltk, appendLF = FALSE)
if(!nzchar(tclbin -
I post my replies through nabble. The second one, I can do. However, I would
assume that subscribers would not only see my reply, but also the original
reply, since the forum and email programs/platforms provide threaded msg-ing
these days, or not?
The first seems to be an either/or option in
Júlio,
Your code is not reproducible, you doesn't provide any data. So I did a
minimal code that illustrates a possible procedure is the following
n - 30
da - data.frame(x=runif(n), y=runif(n), z=runif(n))
da$z - cut(da$z, seq(0,1,0.25))
require(lattice)
xyplot(y~x, da, cex=as.numeric(da$z),
The error msg puts it quite clearly -- the initial parameters 1,1,1,1 are
inadmissible for
your function. You need to have valid initial parameters for the variable
metric method
(option BFGS).
This is one of the main problems users have with any optimization method. It is
ALWAYS a
good idea
Kristian,
I just tried that particular command here on a Gentoo system with
openmpi-1.5.3 installed, because I wondered why the Rmpi configure
script tests for main function in a shared library ...
But I got a completly different output from configure. While the
linker succeeds here, the
Thanks Hugo.
I am pretty sure openmpi is installed:
# zypper se openmpi
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
--+---+-+---
i | openmpi | A powerful
I was pretty sure to have installed tcltk files for 64 bit from the
installer, but to be sure ...
- I removed previously created Environment variables (MY_TCLTK)
- I reinstalled R one more time ... this time with the full
installation option
and ... it does not work (still works with R 32bit) !
Ho Saravana,
I did have nearly the same issue some months ago -- you will find below a
good starting point.
I am quite sure there is a better way to achieve it or with better code,
but this should work!
Kind regards,
Eric
-
generateCube - function(x,simplify=TRUE,onlyComb=FALSE,...){
I have a dataframe object having the following structure
FinalOutput[1:3,]
GasDays 2011-03-31 2010-09-30 2010-10-31 2010-11-30 2010-12-31
2011-01-31 2011-02-28
1 2006-10-01 217303553 221205033 222824639 217016511 216093460
216477468 216834021
2 2006-10-02 231158527 234565250
Reading the helpfile (as the posting guide asks you to do) of write.table will
solve your problem.
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens Paolo Rossi
Verzonden: woensdag 15 juni 2011 16:52
Aan: r-help@r-project.org
You need to add row.names=FALSE to your write.table() statement.
This and other useful options are documented in the help. And you'll
notice that that first column of row names appears in your R output as
well.
Sarah
On Wed, Jun 15, 2011 at 10:51 AM, Paolo Rossi
statmailingli...@googlemail.com
Hi Paolo,
Not sure to understand you well, but try with row.names=FALSE in your
call to write.table()
HTH,
Ivan
Le 6/15/2011 16:51, Paolo Rossi a écrit :
I have a dataframe object having the following structure
FinalOutput[1:3,]
GasDays 2011-03-31 2010-09-30 2010-10-31 2010-11-30
Sarah,
That is correct - thanks a lot for this to everyone who replied
Paolo
On 15 June 2011 16:03, Sarah Goslee sarah.gos...@gmail.com wrote:
You need to add row.names=FALSE to your write.table() statement.
This and other useful options are documented in the help. And you'll
notice that
Kristian,
these are the usual problems with binary distributions.
Regarding
--with-Rmpi-include=/usr/lib64/mpi/gcc/openmpi/include
and configure output
checking for mpi.h... no
... so does /usr/lib64/mpi/gcc/openmpi/include really exist? At least,
that appears to be a
I am using auto.arima() for forecasting.When I am using any in built data
such as AirPassangers it is capturing seasonality. But, If I am entering
data in any other format(in vector form or from an excel sheet) it is not
detecting seasonality.
Is there any specific format in which it detects
Dear Hugo
I ran the command with the verbose switch and get the following output:
mpicc mtest.c -ov mtest
mtest: In function `_start':
/usr/src/packages/BUILD/glibc-2.11.1/csu/../sysdeps/x86_64/elf/start.S:65:
multiple definition of `_start'
Hi Eric,
Your solution looks very close to my own. I also use expand.grid to get
the cross product though. If I find an alternate way, I will send out my
solution.
Thanks a lot for your suggestion !
Regards,
Saravanan
On 06/15/2011 09:34 AM, Eric Lecoutre wrote:
Ho Saravana,
I did have
Write yourself an alternative function to table, for example like this:
tableOfGivenLevels = function(x, levels)
{
n = length(levels)
counts = rep(0, n);
names(counts) = levels
tab = table(x);
counts[match(names(tab), levels)] = tab;
counts;
}
x = sample(c(1:4), 20, replace = TRUE)
Dear Kristian,
please run exactly
mpicc mtest.c -o mtest
If you really need it, add -v separately. mpicc is nothing but a compiler
wrapper.
The -o switch specifies the outfile name, which has to follow immediately
after -o,
with or without a blank character in between. I'm
I did not intend to bully you but rather tried to speak narrowly to the core
of the issue. In a sense the point was that the example you used to
illustrate the problem created part of the problem and that in a sensical
dataset you would not obtain nonsensical results. Secondly, my reply talked
to
Hi Hugo
One step closer! I added the path to libmpi to ld.so.conf and ran ldconfig
(see
http://www.linuxforums.org/forum/programming-scripting/80405-linking-shared
-libraries.html).
Compiling the code you sent me works but running the file gets stuck with
the following message:
./mtest
siddharth arun sid.arun91 at gmail.com writes:
I am using auto.arima() for forecasting.When I am using any in built data
such as AirPassangers it is capturing seasonality. But, If I am entering
data in any other format(in vector form or from an excel sheet) it is not
detecting seasonality.
Hi,
I have a data file with all our purchases from last year,
it contains the unit price, count, and total dollars spend.
Now I'm looking for some way to classify all our purchases to find out
which purchases are the best ones to find cheaper alternatives.
for example: if we only buy 1 item of a
Hi,
Can anyone help with plotting vertical error bars on a bar graph.
I have tried following examples online and in the big R book and writing my own
function but I have been unsuccessful and donât really have an understanding
of what it is I am doing. I have calculated my standard errors
To Domain Owner,
We are emailing you in regards to *rstatistics**.com* which will become
available on Friday, 24th Jun.
If you do have interest, please fill out priority notice form available here:
http://patriatricolor.com/1063253mogera
Thank you and we apologize for the inconvenience if
Dnia 2011-06-15, o godz. 12:05:01
Jim Lemon j...@bitwrit.com.au napisał(a):
On 06/15/2011 06:46 PM, filip.biele...@rega.kuleuven.be wrote:
Dear,
I have a data frame melted from a list of matrices (melt from
reshape package), then I impute some missing values and then want
to tabulate
Hi all,
I have scoured the archives of this forum but nothing quite seems to fit the
bill...
I would like to plot a graph displaying two variables (y axes) that share
date as the x axis. However, the date values for each variable are not the
same - for example, some parasitoids were not released
Dennis,
Thanks for your suggestion, but that is not exactly what I was after.
I was trying to get the legend in the margin on the top right of the
page and not in the plot frame. Is there a way to do this?
Thanks,
Justin
On Tue, Jun 14, 2011 at 6:03 PM, Dennis Murphy djmu...@gmail.com wrote:
Hello,
I am wondering how to get the quotation marks into a variable expression. I
can't escape it with the backslash \ ...
Example:
I can access my data frame via
TABLE$2011-01-02$columnD
Now I want to do this automatically.. (with a for loop)..
a - TABLE
b -
I?m confused by the difference in the fit of a gam model (in package mgcv)
when I specify an interaction in different ways. I would appreciate it if
someone could explain the cause of these differences.
For example:
x - c(105, 124, 124, 124, 144, 144, 150, 176, 178, 178,
206, 206,
I'm hoping there is a simple answer to this - it seems that there should be,
but I can't figure it out.
I have a matrix/data frame with three variables of interest - V1, V2, V3.
One, V1, is a factor with x levels (x may be a large number); I want to
calculate the correlation between the other
Thanks for the tip on the limit attribute on scale_fill_gradientn.
I'll check out mencoder and let you know if I use your code for the movie.
Cheers
--
View this message in context:
http://r.789695.n4.nabble.com/Heatmap-in-R-and-or-ggplot2-tp3594590p3600034.html
Sent from the R help mailing
Hello All,
I am using read.spss() to read a SPSS dataset into R data.frame.
However I am not able to read user defined MISSING values when it
defined as range in SPSS variable view. I am also not able to read the
value from the MEASURE column in the SPSS variable view to determine
whether a SPSS
If I understand you correctly, your data column is not a character.
class(mydata[,my_column])
If it's numeric or a factor, this should work
# convert it to character to split apart the individual digits
# then convert the digits to numeric, and calculate the sum
I'm trying to fit the Bass Diffusion Model using the nls function in R but
I'm running into a strange problem. The model has either two or three
parameters, depending on how it's parameterized, p (coefficient of
innovation), q (coefficient of immitation), and sometimes m (maximum market
share).
Hello everyone,
I use the following command lines to get important variable from
training dataset.
data.controls - cforest_unbiased(ntree=500, mtry=3)
data.cforest - cforest(V1~.,data=rawinput,controls=data.controls)
data.cforest.varimp - varimp(data.cforest, conditional = TRUE)
I got
Hello,
I am using the spline.correlog function of the ncf library, and am getting
the error cannot allocate vector of size 832.2 Mb. Using
memory.limit(), I already increased the size to 4Gb. I thought it might
be related to the storage space, but I have over 14Gb on
Hello,
I am creating biplots based on the prcomp principal components
analysis command. I would like to display only the principal component
vectors and the variables, not the data. Can anyone suggest how to do
this?
Thanks,
Alyssa
__
Hello
I would like to optimize a function which is as follows.
nc.adj - function(nc, G) {
x = a + G + (b/(G^2 + (c - G)^2)) - nc
return(x)
}
Can I just know how to get the optimized values of a,b,c for given G and nc
using optim/optimize function.
--
View this message in context:
Can anyone help me with this?
thank you in advance.
Karena
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-include-multiple-random-effects-in-lme-function-tp3598339p3600164.html
Sent from the R help mailing list archive at Nabble.com.
---BeginMessage---
Hi,
I never tried to read SPSS data, but to read a csv extracted from excel
for instance, you can do something like
read.csv(example, na.strings='#N/A')
if that is the case, then your NAs will be identified and properly read
while loading data.
HTH. Cheers,
Filipe Botelho
Dear members,
I'm fitting linear model using lm which has numerous auto-regressive terms as
well as other explanatory variables. In order to calculate prediction
intervals, i've used a for-loop as the auto-regressive parameters need to be
updated each time so that a new forecast and
You might try 'bargraph.CI' in R pkg 'sciplot'.
?bargraph.CI
HTH,
Savi
Anna Harris annaharrisish...@hotmail.com 6/15/2011 1:00 PM
Hi,
Can anyone help with plotting vertical error bars on a bar graph.
I have tried following examples online and in the big R book and writing my own
function
I have to confess that plyr has made me lazy about remembering tapply,
by, aggregate et al., so I'm no help there. But if you want to use
plyr it's just
ddply(dat, .(V1), summarize, cor.v2.v3 = cor(V2, V3))
Best,
Ista
On Wed, Jun 15, 2011 at 10:31 AM, jfdawson j.f.daw...@aston.ac.uk wrote:
I'm
x-c(1,1,1,1,1,2,2,2,2,2)
y-rnorm(10)
z-y+rnorm(10)
by(data.frame(y,z),factor(x),cor)
hth,
Daniel
jfdawson wrote:
I'm hoping there is a simple answer to this - it seems that there should
be, but I can't figure it out.
I have a matrix/data frame with three variables of interest - V1, V2,
x-'GTTACTGGTACC'
table(strsplit(x,''))
hth,
Daniel
karena wrote:
Hi,
I have a string GGCCCAATCGCAATTCCAATT
What I want to do is to count the percentage of each letter in the string,
what string functions can I use to count the number of each letter
appearing in the string?
This should work:
mydata$my_column-as.character(mydata$my_column)
sum(unlist(strsplit(mydata[,my_column], )) == 1)
On Wed, Jun 15, 2011 at 7:09 PM, Jay josip.2...@gmail.com wrote:
Hi,
I have a dataframe column from which I want to calculate the number of
1's in each entry. Some column
On Wed, Jun 15, 2011 at 11:06 AM, Christopher Hulme-Lowe
hulme...@umn.edu wrote:
I'm trying to fit the Bass Diffusion Model using the nls function in R but
I'm running into a strange problem. The model has either two or three
parameters, depending on how it's parameterized, p (coefficient of
Hi there,
I am having a strange problem. I am running nls on some data.
#data
x - -(1:100)/10
y - 100 + 10 * (exp(-x / 2)
Using nls I fit an exponential model to this data and get a great fit
summary(fit)
Formula: wcorr ~ (Y0 + a * exp(m1 * -dist/100))
Parameters:
Estimate Std.
Hi,
I have a string GGCCCAATCGCAATTCCAATT
What I want to do is to count the percentage of each letter in the string,
what string functions can I use to count the number of each letter appearing
in the string?
For example, the letter A appeared 6 times, letter T appeared 5 times,
how can I
On Wed, Jun 15, 2011 at 5:35 PM, Gabor Grothendieck
ggrothendi...@gmail.com wrote:
On Wed, Jun 15, 2011 at 11:06 AM, Christopher Hulme-Lowe
hulme...@umn.edu wrote:
I'm trying to fit the Bass Diffusion Model using the nls function in R but
I'm running into a strange problem. The model has
Tena koe Karena
Try:
table(strsplit(GGCCCAATCGCAATTCCAATT, ''))
HTH ...
Peter Alspach
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of karena
Sent: Thursday, 16 June 2011 8:37 a.m.
To: r-help@r-project.org
Subject: [R]
You could try the sink function! I use that from time to time:
?sink
Kyle H. Ambert
Fellow, National Library of Medicine
Department of Medical Informatics Clinical Epidemiology
Oregon Health Science University
ambe...@gmail.com
__
There may be two issues here. The first might be that, if I understand the
Bass model correctly, the formula you are trying to estimate is the adoption
in a given time period. What you supply as data, however, is the cumulative
adoption by that time period.
The second issue might be that the
Hi,
On Wed, Jun 15, 2011 at 4:37 PM, karena dr.jz...@gmail.com wrote:
Hi,
I have a string GGCCCAATCGCAATTCCAATT
What I want to do is to count the percentage of each letter in the string,
what string functions can I use to count the number of each letter appearing
in the string?
For
On Wed, Jun 15, 2011 at 6:05 PM, Daniel Malter dan...@umd.edu wrote:
There may be two issues here. The first might be that, if I understand the
Bass model correctly, the formula you are trying to estimate is the adoption
in a given time period. What you supply as data, however, is the
Dear Experts,
Thanks to all those who responded! More requests for suggestions/thoughts:
Along with the above conventions/styles of writing code (as provided in your
links), there is always a tug of war on agreement on the scope/depth of a
program..
Also, there is a carry-over of Java- / C|C++
I have a situation where the parameter estimates from lrm identify a
binary predictor variable (X) as clearly non-significant (p0.3), but
the ANOVA of that same model gives X a chi^2-df rank of 200, and
adjudicates X and one interaction of X and a continuous measure as
highly significant.
Hi all,
My apologies if this message is incredibly inept but I am very new to both
computer programming and to R.
I am working with the odesolve add-on and have the following function
defined
RVF_Single - function(t, x, p)
within the script I also have the following functions defined:
Many thanks - this is exactly what I was hoping for. Very helpful!
Best wishes,
Jeremy
On 15 Jun 2011, at 21:22, Ista Zahn-2 [via R] wrote:
I have to confess that plyr has made me lazy about remembering tapply,
by, aggregate et al., so I'm no help there. But if you want to use
plyr it's just
Thank all you guys for the great help~. I appreciate
--
View this message in context:
http://r.789695.n4.nabble.com/R-string-functions-tp3600484p3600975.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Many thanks - this is very helpful indeed!
Best wishes,
Jeremy
On 15 Jun 2011, at 21:58, Daniel Malter [via R] wrote:
x-c(1,1,1,1,1,2,2,2,2,2)
y-rnorm(10)
z-y+rnorm(10)
by(data.frame(y,z),factor(x),cor)
hth,
Daniel
jfdawson wrote:
I'm hoping there is a simple answer to this - it seems that
I am trying to calculate Bayesian Credible Intervals for a proportion
(disease prevalence values to be more specific) and am having trouble using
R to do this. I am working with ncredint() function but have not had success
with it. Please help!
Example:
Positive samples = 3
Total sampled = 10
On 16/06/11 11:07, Aimee Jones wrote:
Hi all,
My apologies if this message is incredibly inept but I am very new to both
computer programming and to R.
I am working with the odesolve add-on and have the following function
defined
RVF_Single- function(t, x, p)
within the script I also have the
Aimee Jones wrote:
Hi all,
My apologies if this message is incredibly inept but I am very new to both
computer programming and to R.
I am working with the odesolve add-on and have the following function
defined
RVF_Single - function(t, x, p)
within the script I also have the
The individual tests on coefficients in logistic regression are generally based
on a Wald test statistic. Unfortunately there is a bit of a paradox possible
in this case where the coefficient is highly significant, but due to a
flattening of the likelihood the standard error is overestimated
It would help us to help you if you told us which package ncredint is in (it is
not in any of the packages that is installed on the computer I am presently
using, but could be in multiple others).
Does this interval match what you are expecting?
library(TeachingDemos)
hpd(qbeta, shape1=4,
90 matches
Mail list logo