Dear R-users,
Suppose I want to modify and use internal functions of an R-package as my
requirement. By any way is it possible to explore the internal coding
structure of a package and get a list of internal functions?
thanks.
--
View this message in context:
Sorry bit of a Newbie question, and I promise I have searched the forum
already, but I'm getting a bit desperate!
I have over-dispersed, zero inflated data, with variance greater than the
mean, suggesting Zero-Inflated Negative Binomial - which I attempted in R
with the pscl package suggested on
Duncan,
Thank you very much for your help. Your first work-around solved my
problem, even if the second one didn't. I'm not sure if it was the
elimination of the file() or the close() commands, or both, that did
it.
You got me going again after a couple of weeks of casting about. My hat
I have timstamped data like this:
sd[1:10,]
Tstamp Density Mesh50 Mesh70 Mesh100 Mesh150 Mesh200
2 2009/02/27 07:0030.50.7 10.721.432.841.6
3 2009/02/27 08:0032.21.6 12.423.334.543.0
4 2009/02/27 09:0032.74.8 13.024.0
strptime produces a POSIXlt result and you likely intended
POSIXct instead:
as.POSIXct(x, format = %Y/%m/%d %H:%M)
for storing in a data frame. Also to avoid time zone
problems down the line you might want to use chron:
library(chron)
as.chron(x, format = %Y/%m/%d %H:%M)
See R News 4/1.
On
spime wrote:
Dear R-users,
Suppose I want to modify and use internal functions of an R-package as my
requirement. By any way is it possible to explore the internal coding
structure of a package and get a list of internal functions?
The best way is to download the source to the package,
On 18-Jul-09 17:26:36, JPS2009 wrote:
Sorry bit of a Newbie question, and I promise I have searched the
forum already, but I'm getting a bit desperate!
I have over-dispersed, zero inflated data, with variance greater
than the mean, suggesting Zero-Inflated Negative Binomial - which
I
There is a function mh_test in the coin package.
library(coin)
mh_test(tt)
The documentation states, The null hypothesis of independence of row and
column totals is tested. The corresponding test for binary factors x and y
is known as McNemar test. For larger tables, Stuart’s W0 statistic
Michael,
If you have a big.matrix, you just want to iterate over the rows. I'm not
in R and am just making this up on the fly (from a bar in Beijing, if you
believe that):
foreach(i=1:nrow(x),.combine=c) %dopar% f(x[i,])
should work, essentially applying the functin f() to the rows of x? But
Hello David,Thank you for your answer.
Do you know then what does the mcnemar.test do in the case of a 3*3 table
?
Because the results for the simple example I gave are rather different (P
value of 0.053 VS 0.73)
In case the mcnemar can't really handle a 3*3 matrix (or more), shouldn't
there be
David Winsemius wrote:
On Jul 18, 2009, at 11:14 AM, Elizabeth Stanny wrote:
Frank,
I had already tried q=c(0.7,0.8,0.9,0.95) as an argument in
plot.summary.Design and it did not work (i.e., CIs were not plotted).
Could you point me to an example using plot.summary.Design that uses q
as
[was [R] end of daylight saving time]
Hi,
I got no reply with the previous subject line, probably a bad choice
of subject on my part, so here it is again.
I read from the help on DateTimeClasses and various posts on this list
that, quite logically, one needs to specify if DST is active or
Hello all,
I wish to perform a mcnemar test for a 3 by 3 matrix.
By running the slandered R command I am getting a result but I am not sure I
am getting the correct one.
Here is an example code:
(tt - as.table(t(matrix(c(1,4,1,
0,5,5,
Another thing to realize if you are doing this in parallel, f(x[i,]) is
being executed on each of the worker R sessions. Now, a big.matrix object
is essentially a pointer to an object created in C++ and, a pointer address
space is specific to a process (in this case the master R session). As a
Elizabeth Stanny wrote:
Hi,
1. I want 95% not 99% confidence intervals in my summary.Design plot
using the Design package. Putting conf.int http://conf.int/=.95 as an
argument in plot does not work. The default appears to be .99 not .95 as
stated in the package Design manual (p. 164).
Ana Quiterio wrote:
Dear All.
I can't execute X12GUI() from package x12. I have problems in the step :
Please choose the x12 binaries.
Can anyone help me?
Thanks in advance,
AnaQ
I know barely anything about the package. I gather from a bit of
googling that X12 is a time-series
[was [R] end of daylight saving time]
Hi,
I got no reply with the previous subject line, probably a bad choice
of subject on my part, so here it is again.
I read from the help on DateTimeClasses and various posts on this list
that, quite logically, one needs to specify if DST is
On 19/07/2009 11:23 AM, Denis Chabot wrote:
[was [R] end of daylight saving time]
Hi,
I got no reply with the previous subject line, probably a bad choice
of subject on my part, so here it is again.
I read from the help on DateTimeClasses and various posts on this list
that, quite
Thank you very much Duncan.
I'll follow your suggestion.
Why do I want to do what the designer did not think anyone would want
to do? I have data acquisition equipment taking measurements every 15
min or so for days at a time, and I need to compile all such
experiments in a master data
Have you considered the timeDate package?
Spencer
Denis Chabot wrote:
Thank you very much Duncan.
I'll follow your suggestion.
Why do I want to do what the designer did not think anyone would want
to do? I have data acquisition equipment taking measurements every 15
min or so for
Thanks for the suggestion, Spencer. I will take a look and will report
to the list if I find this a better solution for my situation. Might
take a couple of days though.
Denis
Le 09-07-19 à 12:42, spencerg a écrit :
Have you considered the timeDate package?
Spencer
Denis Chabot wrote:
Hi,
I hope I am not repeating a question which has been posed already.
I am trying to do the following in the most efficient way:
I would like to sample from a finite (large) set of integers n non-overlapping
intervals, where each interval i has a different, set length L_i
(which is the number
of
as.chron.POSIXt has an offset= argument and it may be
a vector:
args(chron:::as.chron.POSIXt)
function (x, offset = 0, tz = GMT, ...)
On Sun, Jul 19, 2009 at 9:10 AM, Denis Chabotchab...@globetrotter.net wrote:
[was [R] end of daylight saving time]
Hi,
I got no reply with the previous
It' true, but if you type -8^(1/3) returns -2, and if you type -8^1/3 it
returns -2.6, maybe there are some rules about parenthesis...
regards
Víctor
De: r-help-boun...@r-project.org en nombre de Dave DeBarr
Enviado el: sáb 18/07/2009 05:04
Para:
It is the order of operator precedence. Look at what you typed:
-8^1/3 is parsed as -(8^1)/3 = -2.6
On Sun, Jul 19, 2009 at 1:12 PM, Victor Manuel Garcia
Guerrerovmgar...@colmex.mx wrote:
It' true, but if you type -8^(1/3) returns -2, and if you type -8^1/3 it
returns -2.6, maybe
I read a table from Microsoft Access using RODBC. Some of the variables had
a name with a space in it.
R has no problem with it but I do.
I cannot find out how to specify the space
names(alltime)
[1] IDLVL7 Ref Pv No Ref Pv Name DOS
Pt Last Name Pt First Name
try:
# first argument of llik.nor has to be the parameter
llik.nor-function(theta,x){mu-theta[1];sig-theta[2];-length(x)*log(sqrt(2*pi))-length(x)*log(sig)-(1/(2*sig**2))*sum((x-mu)**2)}
# optim by default does minimization
# setting fnscale = -1 one obtains a maximization problem
optim(c(1,5),
Farrel Buchinsky-3 wrote:
I read a table from Microsoft Access using RODBC. Some of the variables
had
a name with a space in it.
R has no problem with it but I do.
I cannot find out how to specify the space
names(alltime)
[1] IDLVL7 Ref Pv No Ref Pv Name
cls59 wrote:
The following might work:
alltime[grep(MIDDLE EAR EXPLORE,alltime[[ CPT Desc ]] ]
-Charlie
ACK! Terribly sorry about the double post- but I forgot to close the quote.
It should be:
alltime[grep(MIDDLE EAR EXPLORE,alltime[[ CPT Desc ]] ]
Maybe I should wait until AFTER
I sifted some more and read about a workaround for the problem. I could
simply rename the columns so that there were no more spaces
names(alltime) -gsub( ,., names(alltime))
names(alltime)
[1] IDLVL7 Ref.Pv.No Ref.Pv.Name DOS
Pt.Last.Name Pt.First.Name MRN
On Jul 19, 2009, at 1:05 PM, Hadassa Brunschwig wrote:
Hi,
I hope I am not repeating a question which has been posed already.
I am trying to do the following in the most efficient way:
I would like to sample from a finite (large) set of integers n non-
overlapping
intervals, where each
use 'make.names'
make.names(MIDDLE EAR EXPLORE)
[1] MIDDLE.EAR.EXPLORE
On Sun, Jul 19, 2009 at 2:32 PM, Farrel Buchinskyfjb...@gmail.com wrote:
I read a table from Microsoft Access using RODBC. Some of the variables had
a name with a space in it.
R has no problem with it but I do.
I cannot
Hello, I am having trouble using optim.
I want to maximalise a function to its parameters [kind of like: univariate
maximum likelihood estimation, but i wrote the likelihood function myself
because of data issues ]
When I try to optimize a function for only one parameter there is no
problem:
Farrel Buchinsky-3 wrote:
I sifted some more and read about a workaround for the problem. I could
simply rename the columns so that there were no more spaces
names(alltime) -gsub( ,., names(alltime))
That would certainly be a solution. The method I was trying to demonstrate
is that in
Hi
I am not sure what you mean by sampling an index of a group of
intervals. I will try to give an example:
Let's assume I have a vector 1:100. Let's say I have 10 intervals
of different but known length, say,
c(4,6,11,2,8,14,7,2,18,32). For simulation purposes I have to sample
those 10
Sorry for the lack of the plot. It's is just a simple xy plot with xvalues
formated as shown in my post (strptime()).
Anyway, here a working example:
rm(list=ls())
x-c(100*1500:1559, 100*1600:1659)
x-strptime(x, format=%H%M%S)
y-c(CO2$conc, CO2$conc[1:36])
plot(x, y, pch=18,
On Sun, 19 Jul 2009, Tal Galili wrote:
Hello David,Thank you for your answer.
Do you know then what does the mcnemar.test do in the case of a 3*3 table
?
print(mcnemar.test)
will show you what it does.
Because the results for the simple example I gave are rather different (P
value
On Jul 19, 2009, at 3:11 PM, Hadassa Brunschwig wrote:
Hi
I am not sure what you mean by sampling an index of a group of
intervals. I will try to give an example:
If you had a dataframe of the following sort:
dfint
start stop
3 7
12 20
40 45
60 72
And you wanted to
On Sun, 19 Jul 2009, Hadassa Brunschwig wrote:
Hi
I am not sure what you mean by sampling an index of a group of
intervals. I will try to give an example:
Let's assume I have a vector 1:100. Let's say I have 10 intervals
of different but known length, say,
c(4,6,11,2,8,14,7,2,18,32). For
The reason that you need the 'as.POSIXct' is that the 'abline'
function does not recognize variables with POSIXlt class.
methods(abline)
no methods were found
Warning message:
In methods(abline) : function 'abline' appears not to be generic
methods(plot)
[1] plot.acf*
Charles C. Berry wrote:
The test mcnemar.test() constructs is one of symmetry, which is
equivalent to marginal homogenity in hierarchical log-linear models as I
recall from Bishop, Fienberg, and Holland's 1975 opus on count data.
Umm, er... Symmetry in the 3x3 table is a 3DF hypothesis,
On Sun, Jul 19, 2009 at 7:33 PM, jim holtmanjholt...@gmail.com wrote:
-8^1/3 is parsed as -(8^1)/3 = -2.6
However the following is evaluated as one would expect:
8^(1/3)
[1] 2
-8^(1/3)
[1] -2
Perhaps it is parsed in this way:
-(8^(1/3))
[1] -2
Liviu
On Sun, Jul 19, 2009 at 12:28 AM, jim holtmanjholt...@gmail.com wrote:
First of all, read FAQ 7.31 to understand that 1/3 is not
representable in floating point. Also a^b is actually exp(log(a) * b)
and log(-8) is not valid (NaN).
If this is so, why would the following evaluate as expected?
Noah Silverman wrote:
Hello,
I'm using the e1071 library for SVM functions.
I can quickly train an SVM with:
svm(formula = label ~ ., data = testdata)
That works well.
I want to tune the parameters, so I tried:
tune.svm(label ~ ., data=testdata[1:2000, ], gamma=10^(-6:3), cost=10^(1:2))
Adam D. I. Kramer wrote:
Dear colleagues,
I've been running some principal components analyses, which generate
tables of loadings that I'm interested in looking at.
print(f1$rot$load,cutoff=.4) is what I use, and it gives me what I want.
However, I'm now interested in comparing
If the power that a number is being raised to is integer, then is does
evaluate honoring the unary minus.
(-2) ^ 5 #integer power
[1] -32
(-2) ^ 5.1
[1] NaN
-8^(1/3)
is parsed as -(8^(1/3)) according to operator precedence.
On Sun, Jul 19, 2009 at 4:49 PM, Liviu
Hi,
In my data.frame I wanted to essentially write
If(Test) c*d else c+d
but that doesn't work. I found I could do it mathematically, but it
seems forced and won't scale well for nested logic. I have two
examples below writing columns e f, but I don't think the code is
self-documenting as
On 19/07/2009 5:17 PM, Mark Knecht wrote:
Hi,
In my data.frame I wanted to essentially write
If(Test) c*d else c+d
but that doesn't work. I found I could do it mathematically, but it
seems forced and won't scale well for nested logic. I have two
examples below writing columns e f, but I
use ifelse:
DF - data.frame(cbind(a=1:4, b=1:2, c=1:8, d=1:16, e=0, f=0))
DF$Test - with(DF, a == b)
DF$e = (DF$c*DF$d) * DF$Test + (DF$c+DF$d) * !DF$Test
DF$f = with(DF, (c*d)*Test + (c+d)*!Test)
#or
DF$f.1 - ifelse(DF$Test, DF$c * DF$d, DF$c + DF$d)
head(DF)
a b c d e f Test f.1
1
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Mark Knecht
Sent: Sunday, July 19, 2009 2:18 PM
To: r-help
Subject: [R] ifelse choices in a data.frame?
Hi,
In my data.frame I wanted to essentially write
If(Test) c*d
That's much better. thanks!
I was sure I'd looked at that but then for some reason stuck with just if.
Again, as a total a newb I appreciate the help.
- Mark
On Sun, Jul 19, 2009 at 2:26 PM, Duncan Murdochmurd...@stats.uwo.ca wrote:
On 19/07/2009 5:17 PM, Mark Knecht wrote:
Hi,
In my
On 20/07/2009, at 9:13 AM, jim holtman wrote:
If the power that a number is being raised to is integer, then is does
evaluate honoring the unary minus.
(-2) ^ 5 #integer power
[1] -32
(-2) ^ 5.1
[1] NaN
snip
I was vaguely aware of this ... but it now triggers in my mind the
Hi,
How can I perform the following
y1y2y3y4
1 0 3 2
0 1 2 1
3 2 0 1
0 5 1 0
into ...
y
1 0 3 2 0 1 2 1 3 2 0 1 0 5 1 0
Please cc me on reply as I subscribe to the digest.
Thanks!
Chris
It also works for raising a number to a negative integer:
(-3)^(-3)
[1] -0.03703704
On Sun, Jul 19, 2009 at 6:23 PM, Rolf Turnerr.tur...@auckland.ac.nz wrote:
On 20/07/2009, at 9:13 AM, jim holtman wrote:
If the power that a number is being raised to is integer, then is does
evaluate
Try this:
x
y1 y2 y3 y4
1 1 0 3 2
2 0 1 2 1
3 3 2 0 1
4 0 5 1 0
as.vector(t(x))
[1] 1 0 3 2 0 1 2 1 3 2 0 1 0 5 1 0
On Sun, Jul 19, 2009 at 7:25 PM, Christopher
Desjardinscddesjard...@gmail.com wrote:
Hi,
How can I perform the following
y1 y2 y3 y4
1 0
Thanks. That worked.
Chris
On 7/19/09 6:41 PM, jim holtman wrote:
Try this:
x
y1 y2 y3 y4
1 1 0 3 2
2 0 1 2 1
3 3 2 0 1
4 0 5 1 0
as.vector(t(x))
[1] 1 0 3 2 0 1 2 1 3 2 0 1 0 5 1 0
On Sun, Jul 19, 2009 at 7:25 PM, Christopher
On Sun, 19 Jul 2009, Peter Dalgaard wrote:
Charles C. Berry wrote:
The test mcnemar.test() constructs is one of symmetry, which is equivalent
to marginal homogenity in hierarchical log-linear models as I recall from
Bishop, Fienberg, and Holland's 1975 opus on count data.
Umm, er...
Question 2a)
I am also working with arules package and I have the following problem
let suppose the matrix b like:
b-matrix(c(1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1),nrow=6)
rownames(b)=c(T1, T2, T3, T4, T5, T6)
colnames(b)=c(It1, It2, It3, It4)
bt-as(b, transactions)
rules-apriori(bt,
On Jul 19, 2009, at 6:09 PM, Tal Galili wrote:
Hello Charles,
Thank you for the detail reply.
I am still left with the leading question which is: which test
should I use
when analyzing the 3 by 3 matrix I have? The mcnemar.test or the
mh_test?
Is the one necessarily better then the
I try to use integrate command to get theoretical mean and variance, and then
solve for a and b. I have an error as follows,
Iteration: 0 ||F(x0)||: 2.7096
Error in integrate(InverseF1, tau, 1, mu = mu2, sigma = sigma2, a = a, :
non-finite function value
Any suggestion?
#R code:
Dear R-helpers
I have 2 variables
x1=rgamma(6000, 2, 1) and x2=rgamma(6000, 3,2). I have to sort (descending)
each one and split it into groups. After this each two groups must be merged
into one until all population becomes one group. A dummy vector must be created
for each group (8, 4, 2, 1)
Hi everyone!
I'm new to R, and I'm stuck on a problem I don't know how to approach.
I have calculated a regression in the form of M ~ D + O + S, and I would
like to take this regression and test it with other samples, 5 at a time(5
meaning 5 set, each consisting M, D, O, and S of a specific
Hi,
Is there anyone know if BUGS language allows the combination of variables as
response
such as
Y[i] - a*X1[i]+b*X2[i]
Y[i] ~ dnorm(c,d)
It seems doesn't work in my model. The problem is between two ##.
The error message is
modelCheck(BayesBioMarker.BUGS)
model is syntactically
Hi ,everyone ,
I draw some boxplot figure with the command boxplot.But in the
figure,there are some bubbles at the top part of the figure.
Can anyone tell me what the correct meaning of these bubbles?and how to
remove it?
--
TANG Jie
Email: totang...@gmail.com
Tel: 0086-2154896104
Shanghai
for a beginner, it's probably even easier to it by hand if it is just five
datasets.
bind the 5 datasets together in one dataset and create and index variable (1
to 5) for each of the observations according to the dataset the obersvation
comes from
then run five regressions using
Dear R-helpers,
I have a problem converting an object made with the 'chron' function
to a POSIXct object:
# Make date based on DOY
dat - chron(dates=232, origin.=c(month=1, day=1, year=2008))
dat
#[1] 08/20/08
# Converting to POSIXct uses current timezone (Sydney):
as.POSIXct(dat)
#[1]
as.POSIXct.dates does not make use of tz:
as.POSIXct.dates
function (x, ...)
{
if (inherits(x, dates)) {
z - attr(x, origin)
x - as.numeric(x) * 86400
if (length(z) == 3L is.numeric(z))
x - x + as.numeric(ISOdate(z[3L], z[1L], z[2L],
0))
as.POSIXct.dates does not make use of tz:
Ok, but it is supposed to, right? Or maybe the documentation can be
updated, because ?as.POSIXct does seem to imply the timezone is used
(as it is for other methods of as.POSIXct).
thanks,
Remko
-
Thanks Chuck.
Ups, did not think of the problem in that way.
That did exactly what I needed. I have another complication to this problem:
I do not only have one vector of 1:1e^6 but several vectors of
different length, say 5.
Initially, my intervals are distributed over those 5 vectors and the
Thanks for the suggestion, but I think I might not have made myself very
clear. I actually have about 2000 sets of M, D, O, and S, so it's probably
not efficient to make each a separate set and then index. I've put
everything into a data frame, so I would like to test how well the
regression fit
Another possibility, if the total length of your intervals is small in
comparison to the big interval is to choose the starting points of all your
intervals randomly and to dismiss the entire set if some of the intervals
overlap. Most probably you will not have too many such cases (assuming,
Hi everyone!
I'm new to R, and I've sent this message as a non-member, but since it's
pretty urgent, I'm sending it again now I'm on the mailing list (Thanks
Daniel for your suggestion nevertheless).
I have calculated a regression in the form of M ~ D + O + S, and I would
like to take this
72 matches
Mail list logo