print(as.matrix(raw.count),quote=F)
cat(as.character(raw.count$Var1))
Jacques VESLOT
CEMAGREF - UR Hydrobiologie
Route de Cézanne - CS 40061
13182 AIX-EN-PROVENCE Cedex 5, France
Tél. + 0033 04 42 66 99 76
fax+ 0033 04 42 66 99 34
email jacques.ves...@cemagref.fr
>-Me
Dear all,
I have the following data frame:
> raw.count
Var1
Freq
1 AA 707
2 AC14
3 AT 3
But why when printint it using 'cat',
1) We didn't get the attachment. The allowed types are given in the
posting guide and are pretty restrictive: the suggestion is to put binary
files on the web for download.
2) We don't have the version information asked for in the posting guide. I
would only expect this to work in foreign 0.8
Hi,
?sapply will tell you
'sapply' is a user-friendly version of 'lapply' by default
returning a vector or matrix if appropriate.
so 'x' has lost its class in sapply(); e.g.
## iris is a data.frame
> str(iris)
'data.frame': 150 obs. of 5 variables:
$ Sepal.Length: num 5
Hello,
Something like this should work:
table(test$V1[!test$V2 %in% c("NM","QC")])
Cheers,
Gustavo.
On Wed, Dec 24, 2008 at 3:06 AM, Gundala Viswanath wrote:
> Dear all,
>
> I have the following data frame:
>
> V1 V2
> aaachr1
> aaachr2
> aaaNM
> aaaQC
> aaachr10
> att
Dear Prof. FOX,
Good starting values are very critical in real applying cases. If sem
package could automatically delete one or some variables to fit an embedded
small model, just to automatically provide good starting values, I think it
could be more useful. Moreover, I think starting value searc
Dear all,
I have the following data frame:
V1 V2
aaachr1
aaachr2
aaaNM
aaaQC
aaachr10
att NM
att chr7
What I want to do is to count the string (V1).
But the condition of counting is: if the V2 of the string
is "NM" or "QC" then the count is not increased.
Henc
Hi guys:
When I use the ROracle package, I found the function 'dbWriteTable'
can't work.
The data frame can't be written to 10g Oracle Data Base. Here is what
happened to me.
>library(DBI)
>library(ROracle)
>drv <- Oracle()
>con <- dbConnect(drv , 'uid','pw','db')
>mm <- data.frame(CO2)
> dbW
Hello, I'm trying to use fitdistr() from the MASS package to fit a gamma
distribution to a set of data. The data set is too large (1167 values) to
reproduce in an email, but the summary statistics are:
Min. 1st Qu. Median Mean 3rd Qu. Max.
116.7 266.7 666.7 1348.0 1642.0 16720.0
The call I'm
I am trying to import a SPSS.sav file into R. The attached file is not
technically the file I am trying to import, but does replicate my
problem. The actual file is much too large to attach. No matter what I
do, I can not get R (base or Hmisc) to apply the value labels in
the .sav file to the dataf
On Dec 23, 2008, at 10:02 PM, David Winsemius wrote:
On Dec 23, 2008, at 5:18 PM, Bill McNeill (UW) wrote:
i use the GUI version of R on OS X. I launch it by double-clicking
on the R
icon. The process always starts in my home directory which means
that the
only .RData file that is ever r
You can use setwd() to change the working directory.
Merry X-mas
On Wed, Dec 24, 2008 at 6:18 AM, Bill McNeill (UW)
wrote:
> i use the GUI version of R on OS X. I launch it by double-clicking on the R
> icon. The process always starts in my home directory which means that the
> only .RData fil
In the
R for Mac OS X FAQ
(available in the Help menu)
see
4.5.4 Misc Menu
and
4.5.5 Workspace Menu
This is an R-sig-mac question, so posting there would have been preferred.
Chuck
On Tue, 23 Dec 2008, Bill McNeill (UW) wrote:
i use the GUI version of R on OS X
Hi Mike,
Yup, that's a bug that will be fixed in the next version. In the
meantime one easy fix is to add an \n on the end of the title string.
Hadley
On Tue, Dec 23, 2008 at 7:02 PM, Mike Lawrence wrote:
> On my machine (Mac OS 10.5.6, R 2.8.1) the following plot is drawn such that
> a substa
On Tue, 23 Dec 2008, Sean Zhang wrote:
Dear R-Helpers:
I am a entry level user of R.
You need to read
An Introduction to R
particularly this section:
2.7 Index vectors; selecting and modifying subsets of a data set
...
2. A vector of positive integral qua
Khawaja, Aman wrote:
>
> I need to answer one of the question in my open source test is: What are
> the four questions asked about the parameters in hypothesis testing?
>
>
Please check the posting guide.
* We don't answer homework questions ("open source" doesn't mean
that other people answ
How about this?
value.vec[which.vec]
HTH,
Jorge
On Tue, Dec 23, 2008 at 9:52 PM, Sean Zhang wrote:
> Dear R-Helpers:
>
> I am a entry level user of R.
>
> Have the following question. Many thanks in advance.
>
>
> # value.vec stores values
> value.vec <- c('a','b','c')
> # which.vec stores t
> sapply(which.vec, function(x){ value.vec[x] } )
[1] "c" "b" "b" "a"
On Dec 23, 2008, at 9:52 PM, Sean Zhang wrote:
# value.vec stores values
value.vec <- c('a','b','c')
# which.vec stores the locations/indexs of values in value.vec.
which.vec <- c(3, 2, 2, 1)
# How can I obtain the followin
I would like to be able to preform a DWT and filter out everything
except for 2^0 and then take that back into the time domain. Does
anyone have any suggestions. I am using wmtsa to try and do this.
--
Stephen Sefick
Let's not spend our time and resources thinking about things that are
so litt
On Dec 23, 2008, at 5:18 PM, Bill McNeill (UW) wrote:
i use the GUI version of R on OS X. I launch it by double-clicking
on the R
icon. The process always starts in my home directory which means
that the
only .RData file that is ever read in is the one in my home
directory. I
would inst
Dear R-Helpers:
I am a entry level user of R.
Have the following question. Many thanks in advance.
# value.vec stores values
value.vec <- c('a','b','c')
# which.vec stores the locations/indexs of values in value.vec.
which.vec <- c(3, 2, 2, 1)
# How can I obtain the following vector based on t
I need to answer one of the question in my open source test is: What are
the four questions asked about the parameters in hypothesis testing?
Thanks.
Aman
- CONFIDENTIAL-
This email and any files transmitted with it are confide...{{dropped:9}}
__
R-he
i use the GUI version of R on OS X. I launch it by double-clicking on the R
icon. The process always starts in my home directory which means that the
only .RData file that is ever read in is the one in my home directory. I
would instead like to have different R sessions saved in different
direct
On my machine (Mac OS 10.5.6, R 2.8.1) the following plot is drawn such that
a substantial portion of the descender of the title is covered by the plot:
library(ggplot2)
qplot(x=1:10,y=1:10,main='p q j g')
--
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University
www.thatmik
Please provide me the info on what are the 4 questions about the
parameters in hypothesis testing
Thanks.
Aman
- CONFIDENTIAL-
This email and any files transmitted with it are confide...{{dropped:9}}
__
R-help@r-project.org mailing list
https://stat.e
On 23/12/2008 6:55 PM, Thomas Mang wrote:
Hello,
Before I get into troubles I ask here:
I make a call to a C function using .C. What I would like to know is if
the arguments in the .C call can also be 'temporary' objects.
An example will illustrate this:
# here we don't have a temporary
Obj
Dear Kirk,
Actually, co2 isn't a data frame but rather a "ts" (timeseries) object. A
nice thing about R is that you can query and examine objects:
> class(co2)
[1] "ts"
> str(co2) # structure of object
Time-Series [1:468] from 1959 to 1998: 315 316 316 318 318 ...
> unclass(co2)
[1] 315.42 3
Hello,
Before I get into troubles I ask here:
I make a call to a C function using .C. What I would like to know is if
the arguments in the .C call can also be 'temporary' objects.
An example will illustrate this:
# here we don't have a temporary
Obj1 = 5
.C("Func", as.integer(Obj1 ), ...) #
> class(co2)
[1] "ts"
> is.data.frame(co2)
[1] FALSE
If you try these functions on your test.data I am guessing that the
results will differ from above.
--
David Winsemius
On Dec 23, 2008, at 6:29 PM, Kirk Wythers wrote:
I need some help understanding how on of the example data sets is
for
I need some help understanding how on of the example data sets is
formatted in the basic R installation. If I load the Mona Loa CO2
data, with the command:
> data(co2)
I can view the data with:
> co2
And the data are in the form of 11 rows labeled as years (1994-2004)
and 12 columns labe
Hi ronggui,
I believe it is "dear Adrian and Prof. Gott" :)
(at least I feel more comfortable being called directly)
Thanks very much for this, I am developing a series of functions for fuzzy-set
operations to be included in the next release of the QCA package, and your
function seems to do a g
sp wrote:
Dr. Harrell,
Thanks for your patient replies. I've two more questions:
1) Is your book appropriate for beginners or is it more for advanced users?
It is in the middle of those two.
2) f <- ols(y ~ rcs(x,3), data=mydata)
Function(f)
does not produce anything for me (i.e.) it's emp
Dr. Harrell,
Thanks for your patient replies. I've two more questions:
1) Is your book appropriate for beginners or is it more for advanced users?
2) f <- ols(y ~ rcs(x,3), data=mydata)
Function(f)
does not produce anything for me (i.e.) it's empty.
Sincerely,
sp
--- On Tue, 12/23/08, Frank E
sp wrote:
Sincere thanks for both the replies.
0. I agree, I'm waiting for my copy of a regression book to arrive. Meanwhile,
I'm trying to read on google.
1. My bad, I'm using Gaussian noise.
2. I didn't have x^3 b/c that co-efficient happens to be zero in this fitting.
That's strange.
On Tue, 23 Dec 2008, Ken Schmidt wrote:
Greetings. I am attempting to add NetCDF libraries within R, and have
failed. We have R version 2.8, and are running on a 64-bit Redhat Linux
2.6.18 kernel:
Red Hat Enterprise Linux Client release 5.2 (Tikanga)
Linux halfmoon.ncdc.noaa.gov 2.6.18-92.1
Sincere thanks for both the replies.
0. I agree, I'm waiting for my copy of a regression book to arrive. Meanwhile,
I'm trying to read on google.
1. My bad, I'm using Gaussian noise.
2. I didn't have x^3 b/c that co-efficient happens to be zero in this fitting.
3. I used lines() b/c I wanted t
Dear Colleagues,
I fit this model:
mod1 <- lmer(x~category*comp+(1|id),data=impchiefsrm)
where category has 4 levels and comp has 8 levels.
These work:
glht(mod1, linfct=mcp(category="Tukey")
glht(mod1, linfct=mcp(comp="Tukey")
What I'd like is (conceptually):
glht(mod1, linfct=mcp(category:c
On Tue, 23 Dec 2008, Geraldine Henningsen wrote:
Hello,
I have interval censored data, censored between (0, 100). I used the
tobit function in the AER package which in turn backs on survreg.
Actually I'm struggling with the distribution. Data is asymmetrically
distributed, so first choice would
Greetings. I am attempting to add NetCDF libraries within R, and have
failed. We have R version 2.8, and are running on a 64-bit Redhat Linux
2.6.18 kernel:
Red Hat Enterprise Linux Client release 5.2 (Tikanga)
Linux halfmoon.ncdc.noaa.gov 2.6.18-92.1.22.el5 #1 SMP Fri Dec 5
09:28:22 EST 200
I think you are making it too hard. See if one of these is a path to
the answer you seek:
> get(dframe.vec)
V1 V2
1 1 2
#
> n.obs <- function(x) dim(x)
> n.obs(get(dframe.vec))
[1] 1 2
#---
> ng.obs <- function(x) dim(get(x))
> ng.obs(dframe.vec)
[1] 1 2
#-
> ng1.obs <- funct
If I remember correctly, frame 1 is the evaluation frame that comes into
existence with each evaluation, then goes away at the end of the evaluation.
The main use of it is to get past the fact that S-PLUS searches the current
functions variables, but not the ones the current function is nested
Dear R friends:
Can someone help me with the following problem? Many thanks in advance.
# Problem Description:
# I want to write functions which take a (character) vector of dataframe
names as input argument.
# For example, I want to extract the number of observations from a number of
dataframes.
On Tue, Dec 23, 2008 at 1:38 PM, David Winsemius wrote:
> On Dec 23, 2008, at 1:41 PM, kathie wrote:
>>
>> Dear R users...
>>
>> I need to change the S+ code below to R code.
>>
>> I am wondering if there is a R statement equivalent for "assign" statement
>> in S-plus.
>>
>
> ?assign #
T
I take a similar approach by storing my vcv's in a list w/ the date
stored as a character vector "%y-%m-%d" as the list names. That way
you can easily grab the vcv you need by casting your date to a string
and using it to index the list.
not sure if that will work for you.
hth,
Whit
On Tue, De
The old fashioned solution is to have the N x N x T
array and use character strings of the dates as the
dimnames on the third dimension.
Is there something you think you need to do that is
hard with such a setup?
Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
On Dec 23, 2008, at 1:41 PM, kathie wrote:
Dear R users...
I need to change the S+ code below to R code.
I am wondering if there is a R statement equivalent for "assign"
statement
in S-plus.
?assign #
prime <- functi
Surv() allows left, right, or interval censoring.
Try left censoring instead of interval censoring. For the weibull or
lognormal, think of your data as <=100 instead of [0,100].
-Don
At 8:08 PM +0100 12/23/08, Geraldine Henningsen wrote:
Hello,
I have interval censored data, censored betwee
>What are you going to do with an agglomerative hierarchical clustering of
22283 objects? It will not be interpretible.
As a matter of fact I was ask to do a clustering analysis on gene
expression. Something
http://www.ncbi.nlm.nih.gov/projects/geo/gds/analyze/analyze.cgi?datadir=UCorrelationUP
Hello,
I have interval censored data, censored between (0, 100). I used the
tobit function in the AER package which in turn backs on survreg.
Actually I'm struggling with the distribution. Data is asymmetrically
distributed, so first choice would be a Weibull distribution.
Unfortunately the Wei
I have to agree with Daniel Nordlund regarding not creating subsidiary
problems when the main problem has been cracked. Nonetheless, ...
might you be happier with the result of changing the last data.frame()
call in calcProfit to c()?
I get a matrix:
> str(Results2)
num [1:14, 1:16] 3.00e
Hi,
I am inquiring as to what are the best practices with respect to storing and
manipulating ordered multi-dimensional arrays. For example, suppose I have
a sequence of time-varying covariance matrices of asset returns. The data
is ordered, but the ordering is not necessarily regular (e.g. daily
Stephan Kolassa wrote:
>
> Dear guRus,
>
> is there a package that calculates the Approximate Entropy (ApEn) of a
> time series?
>
> RSiteSearch only gave me a similar question in 2004, which appears not
> to have been answered:
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/28830.html
>
FWIW:
Good advice below! -- after all, the first rule of optimizing code is:
Don't!
For the record (yet again), the apply() family of functions (and their
packaged derivatives, of course) are "merely" vary carefully written for()
loops: their main advantage is in code readability, not in efficien
Ben,
thanks a lot for that! I have a (reasonably) good idea about what ApEn
should be, and I'll try to understand your translation of Kaplan's
Matlab code.
Best,
Stephan
Ben Bolker schrieb:
Stephan Kolassa wrote:
Dear guRus,
is there a package that calculates the Approximate Entropy (A
Dear R users...
I need to change the S+ code below to R code.
I am wondering if there is a R statement equivalent for "assign" statement
in S-plus.
prime <- function(x)
{
1*(abs(x) < chuber)
}
assign("prime",prime,frame=
More simple:
aggregate(x$ZIP_CODE, list(CODE_NAME = x$CODE_NAME), paste, collapse = ",")
On Tue, Dec 23, 2008 at 3:27 PM, Henrique Dallazuanna wrote:
> Try this:
>
> do.call(rbind,
>lapply(split(x, x$CODE_NAME),
> function(cod)
>
Avoiding multiple nested for loops (as requested in the subject) is usually
a good idea, especially if you can take advantage of vectorized functions.
You were able redesign your code to use a single for loop. I presume there
was a substantial improvement in program speed. How much additional tim
Folks,
I am creating a small package which builds just fine but fails the check
during the installation phase, as it can not find the files I am
source()ing:
cannot open file 'c:\PROGRA~1\R\R-28~1.0\library\nla\nlamets.r': No
such file or directory
The path to the files are predicated on
Try this:
do.call(rbind,
lapply(split(x, x$CODE_NAME),
function(cod)
data.frame(CODE_NAME =
unique(cod$CODE_NAME),
ZIP_CODE =
paste(cod$ZIP_CODE, collapse = ","))
Dear R-Users,
Suppose I have data in the following format:
CODE_NAME ZIP_CODE
John 12345
John 23456
John 34567
Jane 13242
Jane 22123
I want to transpose / convert it into:
CODE_NAME ZIP_CODE
John
David, Tobias,
Thanks for your pointers to the various HTML and OpenOffice tools. I will
look into them. odfWeave looks particularly promising since "OpenOffice can
be used to export the document to MS Word, rich text format, HTML, plain
text or pdf formats." It looks as though I have to learn
thanks David.
Dhruv
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Tue 12/23/2008 12:40 AM
To: Sharma, Dhruv
Cc: r-help@r-project.org
Subject: Re: [R] sorting regression coefficients by p-value
Assuming that you are using the example in the lm help page
--
Problem Description: (reproducible code below)
On Dec 23, 2008, at 10:56 AM, Brigid Mooney wrote:
Thank you again for your help.
snip
-
With the 'apply' call, Results2 is of class list.
Results2 <- apply(CombParam, 1, calcProfit, X, Y)
--
Prof Brian Ripley wrote:
A Date object is not a vector. In released versions of R, data.frame()
only knows how to replicate vectors and factors.
That's a rather oblique way of saying that it actually does work with
the unreleased version:
> head(transform(airquality,Date=as.Date("1950-01
Thank you again for your help.
I updated the parsing at the beginning of the calcProfit function with:
if (class(IterParam) == "numeric")
{
long <- IterParam["long"]
short <- IterParam["short"]
investment <- IterParam["investment"]
stoploss <- IterParam["
On Tue, 23 Dec 2008, Tom La Bone wrote:
Gavin Simpson wrote:
It says that the two arguments have different numbers of observations.
The reason for which should now be pretty obvious as you provided a
single Date whereas airquality has 153 observations.
Thanks. I did look at ?transform b
Hello,
I've got a function f(x) with this function. For x in -2 : 2 i've
generated a vector y with function values. There is also a data set and
I've constructed an estimator which should find values similar to y.
My question is, what is the best way to compare these vectors?
A simple exampl
On Dec 23, 2008, at 9:55 AM, Brigid Mooney wrote:
I have used some of your advice in making some changes to my
function and function call before reposting.
Instead of nesting many 'for' loops, I have gotten to the point
where I only have one.(Also, please note, I am pasting the
funct
Gavin Simpson wrote:
>
>
> It says that the two arguments have different numbers of observations.
> The reason for which should now be pretty obvious as you provided a
> single Date whereas airquality has 153 observations.
>
Thanks. I did look at ?transform but I was a bit confused because t
I have used some of your advice in making some changes to my function and
function call before reposting.
Instead of nesting many 'for' loops, I have gotten to the point where I only
have one.(Also, please note, I am pasting the function calcProfit at the
end of this message as it is a bit lon
In addition to David's excellent response, I'll add that your problems
seem to be statistical and not programming ones. I recommend that you
spend a significant amount of time with a good regression text or course
before using the software. Also, with Design you can find out the
algebraic for
> I would like to add a column to the airquality dataset that contains the date
> 1950-01-01 in each row. This method does not appear to work:
>
> > attach(airquality)
> > data1 <- transform(airquality,Date=as.Date("1950-01-01"))
>
> Error in data.frame(list(Ozone = c(41L, 36L, 12L, 18L, NA, 28L,
or not using transform at all:
data1 <- airquality
data1$Date <- as.Date("1950-01-01")
# or in just one line:
data1 <- replace(airquality, "Date", as.Date("1950-01-01"))
On Tue, Dec 23, 2008 at 9:06 AM, Gavin Simpson wrote:
> On Tue, 2008-12-23 at 05:24 -0800, Tom La Bone wrote:
>> I would li
On Tue, 2008-12-23 at 05:24 -0800, Tom La Bone wrote:
> I would like to add a column to the airquality dataset that contains the date
> 1950-01-01 in each row. This method does not appear to work:
>
> > attach(airquality)
> > data1 <- transform(airquality,Date=as.Date("1950-01-01"))
>
> Error in
I would like to add a column to the airquality dataset that contains the date
1950-01-01 in each row. This method does not appear to work:
> attach(airquality)
> data1 <- transform(airquality,Date=as.Date("1950-01-01"))
Error in data.frame(list(Ozone = c(41L, 36L, 12L, 18L, NA, 28L, 23L, 19L, :
On Dec 22, 2008, at 11:38 PM, sp wrote:
Hi,
I read data from a file. I'm trying to understand how to use
Design.rcs by using simple test data first. I use 1000 integer
values (1,...,1000) for x (the predictor) with some noise (x+.02*x)
and I set the response variable y=x. Then, I try rcs
Dear guRus,
is there a package that calculates the Approximate Entropy (ApEn) of a
time series?
RSiteSearch only gave me a similar question in 2004, which appears not
to have been answered:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/28830.html
RSeek.org didn't yield any results at all.
Hopefully an easy question. When drawing a rectangles in a lattice plot
key, how do you omit the black borders?
Here is an example adapted from one on the xyplot help page:
bar.cols <- c("red", "blue")
key.list <- list(
space="top",
rectangles=list(col=bar.cols),
text=list(c("foo", "ba
On Mon, 22 Dec 2008, iamsilvermember wrote:
dim(data)
[1] 2228319
dm=dist(data, method = "euclidean", diag = FALSE, upper = FALSE, p = 2)
Error: cannot allocate vector of size 1.8 Gb
That would be an object of size 1.8Gb.
See ?"Memory-limits"
Hi Guys, thank you in advance for h
You forgot to RTFM. From ?arima
Different definitions of ARMA models have different signs for the
AR and/or MA coefficients. The definition used here has
'X[t] = a[1]X[t-1] + ... + a[p]X[t-p] + e[t] + b[1]e[t-1] + ... +
b[q]e[t-q]'
and so the MA coefficients differ in sign
81 matches
Mail list logo