Displaying 20 results from an estimated 130 matches similar to: "Question on entry exit tabulating in any R finance package"
2010 Apr 14
4
Error: could not find function "tsts" tradesys package
Hi, I am pretty new to R and would like to follow the code in the paper
below, tradesys package. but I am stuck at the 2nd page where x<-tsts(spx)
is written. Could anyopne help me why I am getting an Error :"could not find
function "tsts" ". I guess I need function call "tsts". where can I find
that function ? I installed tradesys, zoo, RUnit packages but I
2010 Jul 15
1
scope of an argument in a function
Hi
I am trying to define a function fu() in the following way but when I try to
run I get the error that ma1 is not found. I am not sure where I am going
wrong? Does the scope of ma1 not extend to an expr.frame object?
expr.frame() is under library tradesys.
function (y,ma1,ma2)
{
x <- y[, c("Open","Close")]
d <- expr.frame(x, list(MAf=quote(SMA(Close, ma1)),
2009 Oct 02
3
Tabulating using arbitrary numbers of factors
Dear R-help,
First of all, thank you VERY much for any help you have time to offer. I
greatly appreciate it.
I would like to write a function that, given an arbitrary number of factors
from a data frame, tabulates the number of occurrences of each unique
combination of the factors. Cleary, this works:
> table(horse,date,surface)
<SNIP>
, , surface = TURF
2011 Sep 20
1
Tabulating Baseline Characteristics on specific observations
I have a data set with many missing observations. When I run a
regression, R of course discards the observations (the whole row) that
have "NA". I want to tabulate some baseline characteristics (column
means) but only for the observations that R used for the regression.
I tried to recreate this data frame by using na.omit on the original
data frame, but this will not work as this will
2010 Dec 20
2
tabulating 2 factors weighting by a third var
Hi,
This must be an easy one but so far I haven't find a way out...
I have a data frame such as:
$ v1 : Factor w/ 5 levels
$ v2 : Factor w/ 2 levels
$ v3 : Class 'difftime' atomic [1:6666]
basically v1 and v2 are factors, while v3 is a variable containing the duration of certain activities (values ranging from 11 to 45000 sec, no missing values)
How can I get a table
2003 Feb 28
3
Tabulating
Hello,
I wonder if someone could send me suggestions on how to solve the following problem:
I have a vector of an arbitrary size (ex. data<-c(10,10,11,10,12,11,10,12,11,11,10,11)) and use the table function, which gives the following result
10 11 12
5 5 2
that''s fine, but what I would like to do now is:
construct new classes based on the number of classes from table, 10
2008 Mar 29
1
Tabulating Sparse Contingency Table
I have a sparse contingency table (most cells are 0):
> xtabs(~.,data[,idx:(idx+4)])
, , x3 = 1, x4 = 1, x5 = 1
x2
x1 1 2 3
1 0 0 31
2 0 0 112
3 0 0 94
, , x3 = 2, x4 = 1, x5 = 1
x2
x1 1 2 3
1 0 0 0
2 0 0 0
3 0 0 0
, , x3 = 3, x4 = 1, x5 = 1
x2
x1 1 2 3
1 0 0 0
2 0 0 0
3 0 0 0
, , x3 = 1, x4
2007 Sep 02
1
how to sub-sample a variable on another file coordinates
Hello 'R' Users,
I have a monthly mean CO2 necdf data file defined on 1x1 lat by lon
coordinate. I want to sub-sample this variable CO2 on the coordinates
of another ASCII data file. The coordinates of another ASCII data file are
as:
-24.01 152.06 -18.58 150.19 -13.46 148.35 -8.29 147.03 -3.14 146.19 1.53
145.59 7.08 145.33 12.25 145.02 17.46 144.31 22.44 142.35 27.53 141.26 33.04
2009 Oct 28
1
Aggregate and cross tabulation
R-helpers:
I have a data frame containing 4 factor variables (let's say A,B,C,
and D) and 1 numerical variable (N). I would like to produce a
cross-tabulated data frame in which A,B,C are individual columns, each
factor of D is its own column, and the field is calculated as a given
function of N (I would like to have two output data frames, one with the
mean(N) and one with the
2008 Feb 29
2
Getting multiple tables when using table(dataframe) to tabulate data
I am having hard time tabulating data in a dataframe, and getting a single
"table" for an answer. I am trying to tabulate all "counts" for given
"status" on a given date.
I have a data frame such as:
delta_ts status count
1 2008-02-27 CLOSED 3
2 2008-02-27 NEW 56
3 2008-02-27 RESOLVED 5
4 2008-02-21 ASSIGNED 1
5
2010 Sep 23
1
scatterplot 3d equal axis sequence length limitation
I was wondering if anyone has a way out of the limitation that you must use
equal length
x,y, and z sequence lengths.
For instance,
x<-seq(1,100)
y<-seq(1,100)
z<-rnorm(100)
scatterplot3d(z,x,y)
works fine.
However, if I get some results that has a different y subset length, such as
x<-seq(1,100)
y<-seq(1,300)
z<-rnorm(100)
scatterplot3d(z,x,y)
I get the following error:
2008 Jan 11
0
Tabulations in command-line under linux
Hi everybody,
I'm trying to use R (2.4.1) undr Linux (debian) and a thing bothers me:
sometimes I paste lines from a text editor into the R command line and
tabulations are catched by the completing-names function of the csh.
How could this behaviour be inhibited?
thanks in advance
Eric Elguero
2011 Nov 01
0
package descr: create weighted cross tabulation
hello,
using the package "descr" i created a crosstab e.g.:
Table <- crosstab(age,question,weight=pond)
"age": being a variable that consists of the surveyed data of the ages of
children: the values are "6 years", "7 years" and "8 years".
"question": is a variable that consists of the answers of these children to
a question: the
2009 Jul 20
1
tabulate can accept NA values?
tabulate has
.C("R_tabulate", as.integer(bin), as.integer(length(bin)),
as.integer(nbins), ans = integer(nbins), PACKAGE="base")$ans
The implementation of R_tabulate has
if(x[i] != R_NaInt && x[i] > 0 && x[i] <= *nbin)
and so copes with (silently drops) NA. Perhaps the .C could have
NAOK=TRUE? This is useful in apply'ing tabulate to
2010 Oct 03
1
tabulate() does not check for input bounds
Dear all,
it looks like that tabulate() does not check for the bounds of the input.
Reproducible example:
> b <- 1:2
> tabulate(b[1:100])
[1] 1 1
> R.version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status Patched
major 2
minor 11.1
year 2010
month 09
day
2002 Dec 02
1
advanced tabulation
i make me thoughts about a "advanced tabulation" package similar to
commercial software products like Quantum or Wincross.
Before i'm beginning to fight with coding - is in the mailing-List anybody
doing something similar in the past and have a good starting point
and/or suggestions for me ?
My purpose ist to define for a dataset headers (i.e. sex,age-groupes..)
which should
2008 Feb 25
1
efficient is.na tabulation?
I am aware of
table(is.na(df$var))
but is there an efficient way of create a table that shows the number of
missing values in each variable of a data frame?
Right now I am forced to create a new variable, varna<-is.na(df$var), for
each variable of the data frame, bind them to a new data frame and tabulate
it, but surely there is a simpler way?
any help is greatly appreciated,
angelo
2009 Aug 14
1
cross tabulation for frequency distributions
Hi every one,
how to get frequency distributions for one variable across other variable.
ex: var1=age, var2=height i need frequency distribution of age across
height.
Thanks in Advance.
--
View this message in context: http://www.nabble.com/cross-tabulation-for-frequency-distributions-tp24968531p24968531.html
Sent from the R help mailing list archive at Nabble.com.
2009 Oct 10
2
Tabulation
Hi all,
I have a data set
x1 x2 x3
1 2 1
1 2 3
2 1 2
1 2 1
3 1 1
I want to tabulate in the following way.
1 2 3
x1 3 2 1
x2 2 3 0
x3 3 1 1
It is just like frequency distribution
Any help is highly appreciated
[[alternative HTML version deleted]]
2010 Nov 29
1
cross tabulate variables by subject id
Dear list,
I have data like this:
dat1 <- data.frame(subject=rep(1:10,2),
cond1=rep(c("A","B"),each=5),
cond2=rep(c("C","D"),each=10),
choice=sample(0:1,10,replace=TRUE))
I would like to compare subjects' "choice" for (cond1=="A" &
cond2=="C") vs