Displaying 20 results from an estimated 600 matches similar to: "aggregating irregular time series"
2009 Oct 30
3
Fast optimizer
Hi,
I'm using optim with box constraints to MLE on about 100 data points.
It goes quite slow even on 4GB machine. I'm wondering if R has any
faster implementation? Also, if I'd like to impose
equality/nonequality constraints on parameters, which package I should
use? Any help would be appreciated. Thank you.
rc
2009 Jun 24
2
lapply across using multiple columns
Hi,
To set a simple an clear picture of what I'd like to do, here is an example.
I would like to calculate mean of column A and B bucketed by factor in
column X in a data.frame. lapply or aggregate operates on a single column. I
found dapply function in some package which doesn't seem to exist any more.
Is there anyway that I can accomplish something like this? Thank you so much
in
2009 Sep 01
1
Logistic Politomic Regression in R
Hi everyone,
I'm trying to do an Logistic Politomic Regression in R. Because I have my resposes variables and the aswer is 0 and 1 in 3 bacterial genes. Somebody know how to do this in R in a easy way?
Thank so much,
José Bustos
Facultad de Ciencias
Universidad Catolica Ssma.
Concepcion
Chile
--- El lun, 31/8/09, r-help-request@r-project.org <r-help-request@r-project..org>
2009 Aug 30
2
POSIX time conversion doesn't display digit
Hi,
I have the following string that I converted to a POSIXct:
> a <- "2009-08-24 10:00:00.213"
> a.p <- strptime(a,"%Y-%m-%d %H:%M:%OS")
> as.double(as.POSIXct(a.p))
[1] 1251122400
I can't seem to get the decimal fraction of .213 out by casting to
double or numeric. Is there anyway to make sure that POSIXct spits
that out? Thank you.
adschai
2009 Oct 06
2
how to fit time varying coefficient regression model?
Hi - I read through dse package manual a bit. I'm not quite certain
how I can use it to estimate a time varying coefficient regression
model? I might pick up an inappropriate package. Any suggestion would
be greatly appreciated. Thank you.
rh
2009 Jun 28
1
Defining class as a member of another class
Hi,
When I define a new class (through setClass), members defined in
representation argument doesn't seem to like a class. For example, if
I do the following:
setClass("NotWork",representation=(x="zoo"))
It seems to me that representation members will take in only primitive
type to R. Is there any way to stuff a class as a member in another
class? Thank you.
- adschai
2009 Jun 21
1
Need help installing xts package
Hi,
I am trying to install package xts. I am using OPENSUSE 11 64 bit. When I
invoke:
install.pacakges("xts",dependencies=T)
I received a lot of "ERROR: compilation failed for package" errors when R
tries to install xts dependencies. I do not understand this behavior.
I notice one thing. It complains.
ERROR: compilation failed for package 'Hmisc'
** Removing
2009 Jun 23
1
Smart way to check if a column with certain name exists in a data.frame
Hi,
I have a matrix or data.frame (df). When I would like to check if a column
named "x" exists, it becomes my habit to do the following:
if (length(which(colnames(df)=="x"))>0)
Is there any smarter way to do this? Thank you.
adschai
[[alternative HTML version deleted]]
2009 Aug 12
1
Smart way to sum a column in a matrix across all members in a list
Hi,
I have a list that contains about 100 elements. Each element contains
the following matrix structure
a b
1 1 4
2 2 5
3 3 6
I'd like to sum column b across all elements. I'm thinking of using
lapply or sapply but cannot get it to work. Any help would be really
appreciated. Thank you.
adschai
2010 Aug 12
1
Need help to understand integrate function
Hi,
I'm running into a wall when trying to use the integrate function. I
have the following setting:
powerLaw2 <- function(x,l1,l2,c0,t0) {
idx <- which(x <= 0);
if (length(idx) > 0) {
x[idx] <- 0;
}
xl <- (-l1+l2)*log(x/t0);
L <- log(c0)-l1*log(x)-log(1+exp(xl));
L <- exp(L);
return(L);
}
plCDF2 <- function(x,l1,l2,c0,t0) {
2010 Mar 30
1
Adding RcppFrame to RcppResultSet causes segmentation fault
Hi,
I'm a bit puzzled. I uses exactly the same code in RcppExamples
package to try adding RcppFrame object to RcppResultSet. When running
it gives me segmentation fault problem. I'm using gcc 4.1.2 on redhat
64bit. I'm not sure if this is the cause of the problem. Any advice
would be greatly appreciated. Thank you.
Rob.
int numCol=4;
std::vector<std::string>
2011 Nov 07
1
Accessing ENVSXP and CLOSXP while processing parsed R code
Hello Guys,
Following up my earlier mail where I am trying to write an alternative
front-end for R, I had a question about accessing the closures and
environments in R code.
Here's the function taken and modified a little from "*Lexical Scope and
Statistical Computing*"
=====================================================================
f<-function(){
2003 Jun 06
2
little manipulation on data frame
Dear all,
I have data like 3 coulmns and many rows. Each entry
is less than 10.
Example
x y z
1 5 3 2
2 3 7 8
3 8 9 5
4 5 4 6
--------------------------
---------------------------
I have to sum entries of each coulmn (seperately) till
it be 10. This i have to start for each row. And I
want to assign no. of rows needed including that row
too(it to be 10 or 10+, the moment it exceeds 10, i
2007 Apr 18
1
Gentleman and Ihaka , 2000 paper question
In their paper, "Lexical Scope and Statistical Computing", the authors (
Gentleman and Ihaka ) go to great length explaining why R's use of
lexical scoping creates advantages when doing statistical computations.
If anyone has or is familiar with this paper, could they provide the
main program code for how the "newton" function would be called in their
example on page 500
2011 Aug 01
2
How to make a nomogam and Calibration plot
Dear R users,
I am a new R user and something stops me when I try to write a academic
article. I want to make a nomogram to predict the risk of prostate cancer
(PCa) using several factors which have been selected from the Logistic
regression run under the SPSS. Always, a calibration plot is needed to
validate the prediction accuracy of the nomogram.
However, I tried many times and read a lot of
2006 Oct 30
2
how to set debug breaks
Hi,
I am new in R and have some frustrations as how to set debug breaks during
emacs R debug. I use debug () as where or which function to debug. But
during the debug, e.g., I have a for loop at the beginning of the function
code and want the code execution to jump through that for loop and set a
break after that. How to do that? Is there a web site detailing the syntax
of the debugging of R?
2006 Apr 09
2
configure error
*I've been trying for several weeks to install R-2.2.1 on a PC with
an AMD Athlon 64 2800*+* processor running Mandriva 2006_64. After
unpacking R-2.2.1.tar.gz I ran ./configure. However, configure stopped
prematurely with the message *"configure:27295: WARNING: gfortran and
gcc disagree on int and double configure:27297: error: Maybe change
CFLAGS or FFLAGS?"* Altough
2011 Jun 01
2
Create Matrix with Float32 values
Dear R_Help:
The following gives me a matrix with integer values.
z= matrix(rep(10:1, each= 10), ncol= 10, byrow=TRUE)> str(z)?int [1:10, 1:10] 10 9 8 7 6 5 4 3 2 1 ...
How do I specify that I want Float32 values instead.
Thanks,Chris
2005 Nov 23
2
How to plot two different lines with different color with the same "plot" function?
Hi,R_Help!
I have done something like this:
>x<-seq(412,612,1)
>plot(x,dpois(x,512),col="blue",type="l")
>plot(x,dnorm(x,512,sd=sqrt(512)),col="red",type="l")
And now,I want to plot the two lines in the same picture or with the same "plot" action?
What should I do?
And any advises?
Thank you in advance!
仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭伖併佇伹
2011 Aug 11
2
sapply( ) a loop function
Hello R-universe...
I am having trouble writing a function which contains a loop so I can sapply() it to a list of data frames
Each data frame has 241 observations of 15 variables. My loop takes a random sample of one row until the 40 consecutive rows after the sample have a d2p(variable) sum greater than 5.
here is my loop code (it works fine when applied to a 241 observation data frame):