Displaying 20 results from an estimated 200 matches similar to: "Header of dataframe"
2006 Nov 07
1
Better way to create tables of mean & standard deviations
Hi
I'm trying to create tables of means, standard deviations and numbers
of observations (i) for
each laboratory (ii) for each batch number (iii) for each batch at
each laboratory for the attached data.
I created these functions:
summary.aggregate <- function(y, label, ...)
{
temp.mean <- aggregate(y, FUN=mean, ...)
temp.sd <- aggregate(y, FUN=sd, ...)
temp.length <-
2006 Oct 26
0
Generating tables
I am actually trying to write something above the first column ( in
the example the column with numbers 1 to 8) is this possible at all?
If not, is there another way to make a table which supports this? I am
merely using a data frame as a way to create a table I don't need the
data to be this data type.
Benjamin
On 10/26/06, Leeds, Mark (IED) <Mark.Leeds at morganstanley.com> wrote:
2007 Jan 08
4
Export dataframe to txt
Hi all,
Is there a function to export a dataframe to a text file?
I want to store a large set of data which I have saved in a dataframe
in my workspace and copy and past doesn't cut it.
Thank you,
Benjamin
2007 Mar 14
4
abs(U) > 0 where U is a vector?
Hi,
I am looking for a way to compare if every element of a vector is > 0.
i.e.
while(abs(U) > 0)
{
..
}
is there a function for this or do I have to write one?
I'd appreciate your help!
Benjamin
2007 Jan 08
3
Speeding things up
Hi,
is it possible to do this operation faster? I am going over 35k data
entries and this takes quite some time.
for(cnt in 2:length(sdata$date))
{
if(sdata$value[cnt] < sdata$value[cnt - 1]) {
sdata$ddtd[cnt] <- sdata$ddtd[cnt - 1] + sdata$value[cnt - 1] -
sdata$value[cnt]
}
else sdata$ddtd[cnt] <- 0
}
return(sdata)
Thank you,
Benjamin
2007 Jan 15
4
How to format R code in LaTex documents
Hi,
I am planning on putting some R script in an appendix of a LaTex
document. Can anyone recommend me a way of how to format it? Is there
a way to keep all line breaks without having to insert \\ in every
single line?
Thank you!
Benjamin
2007 Jan 09
2
Logical operations or selecting data from data.frames
Hi all,
why doesn't something like this does not work?
speedy <-
(sdata$VaR < sdata$DdtdAbs) && sdata$DdtdDuration >= qpois(pct,lambda) &&
sdata$Ddtd > MinDD
or sdata$Ddtd[sdata$Ddtd > 0 && sdata$VaR < sdata$DdtdAbs]
sdata looks like this:
dataId date value Ddtd VaR DdtdAbs DdtdDuration
18948 79637 2004-07-27 10085.10
2006 Nov 07
2
Boxplot
Hi,
I am new to R and am still trying to get a grip of it.
I have data in this format:
Run Lab Batch Y
1 1 1 1 608.781
2 2 1 2 569.670
3 3 1 1 689.556
4 4 1 2 747.541
5 5 1 1 618.134
6 6 1 2 612.182
7 7 1 1 680.203
8 8 1 2 607.766
9 9 1 1 726.232
and I want to make a boxplot of the Y values for each
2007 Feb 18
1
Help with pair plot
Hi,
I'm trying to create a plot using pair.
Currently I'm doing the following
pairs(~mpg + hp + wt , data=cars, labels = c("Miles per
Gallon","Horsepower","Weight"),pch = c(24,25)[unclass(cars$tr + 1)],
bg = c("red", "green3")[unclass(cars$tr + 1)],panel=panel.smooth)
for the attached dataset. However,instead of using panel.smooth I
2006 Nov 20
1
Basic R timeseries data manipulation
Hi,
suppose I have a time series rt. Why does this code not work?
rt <- data
n <- length(rt) - 2
at <- vector(length = n)
at = rt-(3.75101e-04 + 9.61877e-02 * rt[-1] - 2.48071e-02 * rt[-2])
Thank you,
Benjamin
2007 Mar 16
1
Create coef.table as in summary.glm (with Signif. codes)
Hi,
how do I create a coef.table as for example returned by summary.glm?
I don't see where the significance codes are assigned during summary.glm.
Thank you,
Benjamin
2007 Feb 17
1
Constraint maximum (likelihood) using nlm
Hi,
I'm trying to find the maximum (likelihood) of a function. Therefore,
I'm trying to minimize the negative likelihood function:
# params: vector containing values of mu and sigma
# params[1] - mu, params[2]- sigma
# dat: matrix of data pairs y_i and s_i
# dat[,1] - column of y_i , dat[,2] column of s_i
negll <- function(params,dat,constant=0)
{
for(i in 1:length(dat[,1]))
{
2007 Jan 14
2
ks.test not working?
Hi,
I am trying the following:
library(ismev)
library(evd)
fit <- gev.fit(x,show=FALSE)
ks.test(x,pgev,fit$mle[1],fit$mle[2],fit$mle[3])
but I am getting:
Warning message:
cannot compute correct p-values with ties in: ks.test(x, pgev,
fit$mle[1], fit$mle[2], fit$mle[3])
where x is:
[1] 239 38 1 43 22 1 5 9 15 6 1 9 156
25 3 100 6
[18] 5 100
2007 Feb 04
2
Download stock prices
gReetings:
Is there any way to download a (or a sample of a) crossection of stock market prices? Or is it possible to use get.hist.quote with a *wild card*?
Thanks,
mihai
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
[[alternative HTML
2006 Nov 10
1
Value at Risk historical simulation
Hi
Has someone got a package/script at hand to do a historical simulation
to calculate the Value at Risk?
If your not sure what Historical Simulation is:
In simple terms, Historical Simulation (HS) is just taking sample
percentiles over a moving sample. Suppose we want to use HS to predict
a portfolio's Value-at-Risk at a confidence level of 99 percent and
the window size is chosen to be 250
2006 Oct 12
3
Cross two dataframe
Dear r-users!
I would like to cross two data frame which have the same row number but
different in the number of column. Can anybody help me for this case ?
Thanks a lot in advance
--------------------------------------------------------------------------------
Majid Iravani
PhD Student
Swiss Federal Research Institute WSL
Research Group of Vegetation Ecology
Z?rcherstrasse 111
2006 May 23
1
after identify labels dissapear XP
Greetings:
Using 'identify' to label points on a plot works just fine. However, when
saving under 'metafile' or using the clipboard the labels dissapear. I
believe it's an SDI issue. I am running last R with last Tinn-r under XP up
to date. Anything I can do besides going back to MDI :-)?
Thanks,
Mihai Nica, ABD
Jackson State University
ITT Tech Instructor
170 East Griffith
2007 Mar 25
2
plot of computed vector
gReetings:
I apologize for the non-programming language. I found what seems to be a
strange behavior of plot(). The code follows:
#_____________________________
N=3030; gn=.04; tn=1:100
n=N/(1+(N-1)*exp(-gn*tn))
N=n*(1-exp(-gn*tn))/(1-n*exp(-gn*tn))
plot(N) #strange plot
N
N=rep(3030, 100)
plot(N) #behaves as expected
________________________________
Windows XP, R 2.4.0. or 2.4.1
Thanks,
2006 Oct 30
3
plot history
_______________________________________________________________________________________
Hi,
When I create multiple graphs subsequent graphs overwrite previous
graphs. How do I keep all my graphs in the current workspace (but not
all on the same page) so I can scroll through them?
thanks,
Rohini
Rohini Mulford
Senior Research Analyst
Technical Research
Research &
2006 Nov 06
7
Colour-coded Editor for R Code
Do any of you know any simple programming editors for R scripts which offer
basic colour-coding and bracket-matching facilities?
Dregging through scripts to find a missing comma or parentheses is something
I'd rather do less of...
Jon Minton
[[alternative HTML version deleted]]