R does not, to my knowledge, have anything quite like Python's
docstrings (which seems to be what you are talking about) but you
might look at Roxygen2 on CRAN which should get you started in this
direction.
Best,
Michael
On Thu, Jul 5, 2012 at 7:37 AM, purushothaman purushothama...@ge.com
It is possible to put dimensionality on a list (i.e., a generic
vector), which might be what you're looking for.
x - list(1:4, letters[1:4], function(x,y) x + y, rnorm(50))
dim(x) - c(2,2)
x[[1,2]]
x[[2,2]]
x[[3,2]] # Error
Best,
Michael
On Thu, Jul 5, 2012 at 8:19 AM, Thomas C.
Could you make a reproducible example?
[http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example]
I can't run any of your code as is. A few comments inline.
On Thu, Jul 5, 2012 at 9:44 AM, Wageningen-eR igor.milosavlje...@wur.nl wrote:
Hello,
I am a Masters student
library(sos)
findFun(scor)
will get you going in the right direction but I'm not sure I see a
scor function (I presume you're looking for the robust correlation
metric). Do you have a citation for such a function? For a work
around, robust::covRob gives robust covariance which possibly could be
On Jul 5, 2012, at 1:28 PM, Rich Shepard rshep...@appl-ecosys.com wrote:
On Thu, 5 Jul 2012, Rich Shepard wrote:
I wonder if the issue is with the logical columns; I've not used them
before, only dates, factors, and numerals. I'll try without the logicals
and see if there's a difference.
On Thu, Jul 5, 2012 at 1:03 PM, craigcitro craigci...@gmail.com wrote:
Is there a way to suppress the output of 'install.packages()'? I have
seen that the 'download.file' function has a 'quiet' option but I do
not know how to use it.
I do not see any good reason to allow that. A user should
I might think replicate() is slightly more idiomatic, but I'm not in a position
to check if simplify=FALSE will keep a list.
Best,
Michael
On Jun 30, 2012, at 7:13 PM, Rui Barradas ruipbarra...@sapo.pt wrote:
Hello,
You can avoid the loop using lapply.
f - function(x) sample(100, 10)
Don't (can't) use paste0 with sep='' -- that's redundant, and I'm surprised not
an error.
Michael
On Jun 29, 2012, at 7:18 PM, arun smartpink...@yahoo.com wrote:
Hi,
I knew that you already got many replies.
Here is my contribution.
Take a look at scan and/or readLines
Michael
On Jun 28, 2012, at 9:02 AM, HIMANSHU MITTAL hm3...@gmail.com wrote:
Hello all,
I have a txt file with some data which isn't in any organized form like a
table, but just simple text.
Is there any way to read the file char by char and store the
How do you want your output? If you want a character vector of
lowercase letters, just use gsub([^::A-Z::],, t) to substitute
for all non-uppercase characters. strsplit() can lead you to a vector
of the single-letter upper case letters.
Best,
Michael
On Wed, Jun 27, 2012 at 2:15 PM, mdvaan
take a look at
library(zoo)
example(plot.zoo)
which shows one way to do this,
Best,
Michael
On Wed, Jun 27, 2012 at 6:50 PM, denissearchundia
denissearchun...@yahoo.com.mx wrote:
hi
i try to do a graph who shows 2 time series at the same time
thanks!
--
View this message in context:
Hi David,
I believe you left out saying what color scheme you would prefer, so
it's hard to help, but you might be a start by looking at the
appropriate parts of Hadley's website here: http://had.co.nz/ggplot2/,
particularly the scales section.
Best,
Michael
On Wed, Jun 27, 2012 at 11:07 AM,
On Tue, Jun 26, 2012 at 10:54 PM, Erin Hodgess erinm.hodg...@gmail.com wrote:
Dear R People:
I have dates as factors in the following:
poudel.df$DATE
[1] 1/2/2011 1/4/2011 1/4/2011 1/4/2011 1/6/2011 1/7/2011 1/8/2011
[8] 1/9/2011 1/10/2011
Levels: 1/10/2011 1/2/2011 1/4/2011
Please don't change subject lines for follow-on comments. It messes up
threading in most readers: e.g.,
https://stat.ethz.ch/pipermail/r-help/2012-June/thread.html
Michael
On Tue, Jun 26, 2012 at 11:57 PM, Erin Hodgess erinm.hodg...@gmail.com wrote:
Hello again:
Here is a solution to the
On Fri, Jun 22, 2012 at 3:45 PM, APOCooter mikeedinge...@gmail.com wrote:
[snip and rearrange]
try to put your data in a proper time series class (zoo/xts if I
might give a personal-ish plug) which will make all these calculations
much easier.
I thought that's what I was doing with
To elaborate on what Bert said:
Lists are a variable length data structure which can hold most
anything (even other lists) in them and are a great way to organize
the sort of data you're working with. You can think of them as
generic vectors. You can assign them names and access/subset them by
Are you sure it's not working? That's exactly what the console is
supposed to display (the message means you've switched from the jpeg
_to_ the null device) -- check again to make sure the file wasn't
created -- I think you'll be pleasantly surprised.
If you're not sure where to check, look in
On Fri, Jun 22, 2012 at 2:18 PM, John Kane jrkrid...@inbox.com wrote:
Hi and welcome to the R-help list.
It would be much better for readers to get your data in a more easily used
format.
There is a function called dput() that will output your data in a way that R
can read easily.
We
I believe that useDynLib() in the NAMESPACE file should do it for you.
Best,
Michael
On Fri, Jun 22, 2012 at 1:36 PM, xuan zhao xuan.z...@sentrana.com wrote:
I have built a R package including the C code. My question is:
Can the shared object get loaded automatically as we load the R package?
I think the OP might also be tripped up on the fact that R is
pass-by-value so effects on df inside DropLikeSAS won't have impact
outside the function's scope. The df inside of DropLikeSAS() is
changed as expected, but that has no effect on the df outside that
function.
To the OP: There are ways
On Fri, Jun 22, 2012 at 5:53 PM, Rui Barradas ruipbarra...@sapo.pt wrote:
Hello,
2L is an integer, 2 might be or not. In the case of apply(), there is no
difference.
All possible values for margin? Any possible(*) combination of the
dimensions of 'x' in
apply(x, margin, function)
(*)
On Fri, Jun 22, 2012 at 4:00 PM, jeka12386 jeka12...@hotmail.co.uk wrote:
Dear all
I am trying to calculate the value of n using uniroot. Here is the message
I am having:
Error in uniroot(integ, lower = 0, upper = 1000, n) :
'interval' must be a vector of length 2
Please would you
On Fri, Jun 22, 2012 at 5:13 AM, Mohan Radhakrishnan moh...@fss.co.in wrote:
Hi,
Is there a way to calculate variance directly by specifying
confidence interval using R ? I am specifically asking because I wanted
to investigate how this could be useful for project schedule variance
This has the distinctive sound of homework and we unfortunately can't
help with that.
You might want to look at fitdistr in the MASS package though.
Best of luck to you though,
Michael
On Thu, Jun 21, 2012 at 7:10 AM, Noor.v.d.Assem
noor.v.d.as...@gmail.com wrote:
Hi,
For some dataset I have
Hi, this has the distinctive sound of homework, so I hesitate to give
too much help, but two things I note immediately.
In defining resx / resy (good preallocation!) you probably mean n
instead of N.
A standard way to check how often a condition occurs is something like:
x - rnorm(50)
mean(x
Hi Amanda,
I can't reproduce this without your data set. Would it be possible for
you to give us dput(head(data, 20)) if you need further help?
Also, if you could supply the output of sessionInfo()? That's often
helpful for anything that crashes [that term means many things to
different people
I don't have a Matlab license or enough experience with it to know what
gradient does, but I know there's a Matlab-to-R dictionary out there that
many folks find helpful. It might have what you need (or just be generally
useful).
http://cran.r-project.org/doc/contrib/Hiebeler-matlabR.pdf
Not
This might be a question more suited for the R-SIG-Finance list.
Best,
Michael
On Wed, Jun 20, 2012 at 3:44 AM, rahul deora rahulsparx2...@gmail.com wrote:
Dear All,
Are there any packages in R to carry out the jump detection test and find
the jump sizes and its its time of occurence on high
Hi Anthony,
No, I don't believe this exists on CRAN already (happy to be proven
wrong though) but I might suggest you approach things a different way:
instead of defining this operator by operator with infix notation, why
not go after `+`, `` directly? If you put a class on your vectors,
you can
R-helpers,
I'm looking to set up multi-screen plots with layout() or
par(mfrow/mfcol = ) but I'm not sure if there's an easy way to go
backwards among the panels. E.g.
layout(1:2)
plot(1:4)
plot(1:8)
Here I'd like to put some more on the 1:4 plot (e.g., some points or a
line or a legend) but
. Michael Weylandt
michael.weyla...@gmail.com wrote:
Hi Anthony,
No, I don't believe this exists on CRAN already (happy to be proven
wrong though) but I might suggest you approach things a different way:
instead of defining this operator by operator with infix notation, why
not go after
On Wed, Jun 20, 2012 at 4:46 PM, Richard M. Heiberger r...@temple.edu wrote:
?par
read about mfg
which allows you to index into the arrangement set by mfrow and mfcol
Rich
On Wed, Jun 20, 2012 at 5:27 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
R-helpers,
I'm looking to set
Something like:
X - as.character(data.name)
X - as.double(gsub(%,, X))/100
mean(X)
quantile(X)
etc.
Untested [I'm not at my computer so the args for gsub() might be out of order]
but one possible solution pattern.
Michael
On Jun 20, 2012, at 8:26 PM, C W tmrs...@gmail.com wrote:
Hi R
Most modelling functions take a weights= argument so once you decide
what sort of model you are looking for, that should be the way to
proceed. But do be forewarned that there are a few kinds of weights
in statistics and it's not standardized which is the default across
different statistical
What does any of this mean?
Can you give a concrete example of the transformation you hope to accomplish?
Michael
On Mon, Jun 18, 2012 at 3:10 AM, arunkumar akpbond...@gmail.com wrote:
hi
I have a data and have to convert it into the given expression
like
data=1000:2000 and
Possibly Amelia: http://cran.r-project.org/web/packages/Amelia/index.html
Best,
Michael
On Mon, Jun 18, 2012 at 3:19 AM, Kamontip Srihaset
kamonti...@student.chula.ac.th wrote:
Dear all members,
I am Phd. candidate student at Chulalongkorn U., Thailand. I am interested in
expectation
No, this is rather the nature of floating point calculations.
You may perhaps be looking for ?all.equal or R FAQ 7.31 (I think that's the
one) which is google-able. It's a complicated subject, but those should get you
started.
Best,
Michael
On Jun 18, 2012, at 2:58 PM, hamoreno
I might try something like:
data[data$flag1 == 1, flag2] - runif(sum(data$flag1 == 1)) 0.95
and similarly for the other case.
Hope this helps,
Michael
On Mon, Jun 18, 2012 at 12:29 PM, nqf n.j.frank...@pgr.reading.ac.uk wrote:
Dear R-help,
I am trying to write a function to simulate
You are perhaps not using suppressPackageStartupMessages() correctly
if you're getting those warnings: my .Rprofile has these lines:
suppressPackageStartupMessages(library(quantmod))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(lattice))
but produces no
sapply() won't be notably faster.
What you might try (no guarantee) is wrapping things up as if you were
going to use sapply() but instead use mclapply() from the parallel
package -- that will parallelize the results and should be faster by
roughly as many cores as you use. The no guarantee
The help function in R is just that -- a function -- so you have to
invoke it, e.g., as help(mean) rather than just typing Help. You might
also try help.start() which opens a fuller help system in your
browser.
To see the available functionality of the package, the easiest way is
to check its
Short answer: don't. R is built around vectors and lists. Trying to
put individual variates in their own scalar variables is almost
always a bad idea.
Long answer: you can do it with assign() but I won't tell you how in
light of my short answer.
Michael
On Sun, Jun 17, 2012 at 8:30 AM, Cassie
It's requested to cc the list on our back-and-forths so that i) you
can get help faster (I was moving all yesterday and it's a Hallmark
holiday in the US today) since others may respond; ii) others can
benefit by reading the archives.
On Sun, Jun 17, 2012 at 4:34 AM, Giulia Motta
Take a look at the parallel package which ships with all current versions of R.
Michael
On Jun 17, 2012, at 11:39 AM, Gary Dong pdxgary...@gmail.com wrote:
Dear R users,
I'm wonder if there is a easy way to make R use multi-CPUs on my computer.
My computer has four CPUs but R uses only
at 1:23 PM, Gary Dong pdxgary...@gmail.com wrote:
Thanks for all replied.
I read the introduction of R parallel. Is it for loops only?
Gary
On Sun, Jun 17, 2012 at 10:04 AM, R. Michael Weylandt
michael.weyla...@gmail.com michael.weyla...@gmail.com wrote:
Take a look at the parallel package
On Jun 16, 2012, at 1:56 PM, capital_P peterv...@hotmail.com wrote:
David Winsemius wrote
Try
dat2 - data.frame(do.call(cbind, dat), stringsAsFactors=FALSE)
Use instead:
dat2 - data.frame( dat, stringsAsFactors=FALSE)
Both do not seem to work:
dat2 -
Grammar is quite complicated, but for spelling you might try this
wonderful article by Peter Norvig:
http://norvig.com/spell-correct.html
Michael
On Fri, Jun 15, 2012 at 12:10 AM, raishilpa raishilpa@gmail.com wrote:
hello
I want a code which can correct the spelling mistakes as well as
Just to take a stab at it, I'd suggest you don't actually need apply()
and could simply get what you need with
hist(DATA[,4:6])
if your data is as described.
Michael
On Fri, Jun 15, 2012 at 7:23 AM, Jean V Adams jvad...@usgs.gov wrote:
Frans,
I'm not sure I understand what you're after.
I
General rule of thumb: use POSIXct rather than POSIXlt for such things
and only convert to POSIXlt (losslessly) at the end of your
calculations when you need it for display reasons. Internally, POSIXct
is just a double, so it is nice to do calculations on, while POSIXlt
is a list-like object which
I'm somewhat confused:
i) What does this have to do with your subject line?
ii) There does not exist -- to my knowledge -- an implementation of R
which runs on the JVM.
iii) Have you simply looked into R's native parallel computing
options? That seems to be (maybe?) what you are trying to do.
On Fri, Jun 15, 2012 at 1:48 AM, raishilpa raishilpa@gmail.com wrote:
hello,
I am using the following code
s-I am very happy, excited, and optimistic.I am very scared, annoyed, and
irritated.Iraq’s political crisis entered its second week one step closer to
the potential.dissolution of
with the linked code is that
it doesn't define out before using it.
I might suggest you actually read the entire page -- the fix is
already posted there.
Michael
I am unable to remove the error...can anyone help in removing the error...?
On Fri, Jun 15, 2012 at 6:40 PM, R. Michael Weylandt
As of recent versions of R, you can actually go for what are
officially recognized as ultimate speed functions .rowSums() and
friends.
You might also use the compiler() package to byte-compile that inner
loop. [The function going to sapply] It won't be massive, but perhaps
another 3 or 4x
On Fri, Jun 15, 2012 at 9:48 AM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
As of recent versions of R, you can actually go for what are
officially recognized as ultimate speed functions .rowSums() and
friends.
Sorry, perhaps that wasn't totally clear. Regarding .rowSums() note
Honestly, given what a pain dates are in Excel, I might simply import
them as strings and do the conversion on the R side of things. Also,
I'd recommend you use Date objects rather than POSIXct to cut out the
unnecessary complexity of timezones, DST, etc. [See Gabor's article in
RNews 4/1 for a
on rJava which allows both-way connectivity and probably places nicer
with R than proprietary windows projects.
Best,
Michael
Thanks again
Angelo
-Messaggio originale-
Da: R. Michael Weylandt [mailto:michael.weyla...@gmail.com]
Inviato: venerdě 15 giugno 2012 16.16
A: LINARDI
I don't think you need loops at all actually :-) [The main thing to
working with R vs. C is vectorization -- embrace it now and life
will be much better]
You could do something like this:
library(MASS) # Provides a multivariate normal distribution
mvrnorm(100, c(1,5), matrix(c(2,1,1,2), ncol =
)
but data integrity should be guaranteed.
Michael
Thanks again for you kindness and help.
Angelo
-Messaggio originale-
Da: Oliver Ruebenacker [mailto:cur...@gmail.com]
Inviato: venerdì 15 giugno 2012 17.36
A: R. Michael Weylandt
Cc: LINARDI ANGELO; r-help@r-project.org
Oggetto: Re
On Fri, Jun 15, 2012 at 10:35 AM, Oliver Ruebenacker cur...@gmail.com wrote:
Hello,
On Fri, Jun 15, 2012 at 10:15 AM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
ii) There does not exist -- to my knowledge -- an implementation of R
which runs on the JVM.
I think he means
On Fri, Jun 15, 2012 at 4:39 PM, Debs Majumdar debs_st...@yahoo.com wrote:
Hi,
I am trying to save multiple plots in a single pdf file when the plots are
generated by a single plot command. I am using the lordif package which
generates multiple plots with one command.
pdf(education.pdf)
American))
dev.off()
pdf
2
- Original Message -
From: R. Michael Weylandt michael.weyla...@gmail.com
To: Debs Majumdar debs_st...@yahoo.com
Cc: r-help@r-project.org r-help@r-project.org
Sent: Friday, June 15, 2012 3:48 PM
Subject: Re: [R] Save multiple plots
On Fri, Jun 15, 2012 at 6:56 AM, Al Ehan aehan3...@gmail.com wrote:
Hi,
I would like to make a replication of 10 of a linear, first order
Autoregressive function, with respect to the replication of its innovation,
e. for example:
#where e is a random variables of innovation (from GEV
It does seem that as.POSIXct.date doesn't respect the tz= argument the
generic suggests it would. I'd think this is a bug that could be
changed without breaking back-compatibility, but I don't have the
power to make such things happen.
R-Core ruling?
Michael
On Fri, Jun 15, 2012 at 2:25 AM,
On Fri, Jun 15, 2012 at 11:26 PM, David Winsemius
dwinsem...@comcast.net wrote:
On Jun 15, 2012, at 11:18 PM, R. Michael Weylandt wrote:
It does seem that as.POSIXct.date doesn't respect the tz= argument the
generic suggests it would.
Why would a date function have a TZ? `as.Date` wouldn't
sample() takes a prob = argument which lets you supply weights, which
need not sum to one so, if I understand you, you could just pass TRUEs
and FALSEs for those rows you want. If I'm wrong about that last bit,
I'm still pretty confident sample(prob = ) is the way to go.
Best,
Michael
On Thu,
But there are multiple shapes for matrices with 12 elements -- how did
you get 3x4 ? You also could have had 1x12, 2x6, 3x4, 4x3, 6x2,12x1
If you have an R object, you can use dim() on it. [Or perhaps slightly
more robustly, NCOL() and NROW()]
Michael
On Thu, Jun 14, 2012 at 7:51 AM,
are equally important. I need simply that my
subset has in each column the same frequency of 1 that in the original
dataset
Thank you again
Guido
2012/6/14 R. Michael Weylandt michael.weyla...@gmail.com
sample() takes a prob = argument which lets you supply weights, which
need not sum to one
You have been asked before (by me!) to give reproducible examples
using dput()...
You might need the diff() function.
Michael
On Thu, Jun 14, 2012 at 5:08 AM, Rantony antony.akk...@ge.com wrote:
Hi,
Here, i have a matrix like this
MyMatrix -
*DATETIME HEADER1 HEADER2*
I do think this is more of a Bioconductor question -- but no worries,
they're all much nicer there than we are here and won't flame you if
you double post :-)
Best,
Michael
On Thu, Jun 14, 2012 at 12:37 PM, Hans Thompson
hans.thomps...@gmail.com wrote:
I know that there are quite a few packages
Your problem is that n.keep is less than 0. Why that is I cannot tell
without appropriate context.
E.g.,
x - 1:10
x[2:5]
x[0:1]
x[(-3):1]
Michael
On Tue, Jun 12, 2012 at 6:01 AM, sanshine s.a.j.van_der_ze...@lumc.nl wrote:
Hello everyone,
I`m trying to normalize and analize an illumina
grepl
Michael
On Tue, Jun 12, 2012 at 8:51 AM, anjali jeevi...@gmail.com wrote:
Hi ,
Is there any inbuilt functions to check whether a substring is present in a
string and give the result as boolean
Thanks
--
View this message in context:
Short answer: no.
Long answer: use a closure if for some bizarre reason you just can't
use a loop.
Bonus tip: change the last three lines to:
d - c 5
for speed and clarity!
Michael
On Tue, Jun 12, 2012 at 9:25 AM, Rantony antony.akk...@ge.com wrote:
Hi,
here i have some code...
a -1
Probably Spector
(http://www.amazon.com/Data-Manipulation-R-Use/dp/0387747303) if you
want a dead-tree book. Otherwise, just read the archives of this list
and the R-bloggers aggregator and you should be able to pick up most
everything you need.
Michael
On Tue, Jun 12, 2012 at 9:58 AM, XINLI LI
I think you are looking for
mt[cbind(vt, seq_along(vt))]
which uses some trickines known as matrix indexing (basically, the two
columns created by cbind() are considered row col indices -- then
seq_along() gives the col1,col2, bit as needed.
HTH,
Michael
On Tue, Jun 12, 2012 at 10:28 AM,
TTR::stockSymbols
Michael
On Tue, Jun 12, 2012 at 1:12 PM, Vikram Bahure
economics.vik...@gmail.com wrote:
Dear R users,
I was working on get.hist.quote to download data, but for this I need to
know yahoo quotes (for stocks) from the beginning. Is there any simple way
to get all symbols for
As noted below:
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
For more on how to do that see:
i) https://github.com/hadley/devtools/wiki/Reproducibility
ii)
? text
Michael
On Tue, Jun 12, 2012 at 8:49 PM, Manish Gupta mandecent.gu...@gmail.com wrote:
Hi,
I am working on R plot but i need to write some text for the bars where the
value is = 0
counts
3 4 5
0 12 0 4
1 3 0 1
http://r.789695.n4.nabble.com/file/n4633190/1.png
My
On Wed, Jun 6, 2012 at 2:43 AM, bestbird bestbird7...@gmail.com wrote:
hi,
I met some problems in R, plz help me.
1. How to do a intersect operation among several groups in one list, without
a loop statement? (I think It may be a list)
create data:
myData - data.frame(product =
They aren't quite lists --- they are actually data.frame()s which are
a special sort of list with rownames and other nice things.
To your immediate question, I think you're looking for the formula interface:
boxplot(Value ~ State.Fips, data = CB_un)
The data= argument is important so boxplot
It is possible to chain together uses of `[[` -- e.g.,
x - list(1:5, list(letters[1:5], list(LETTERS[1:5])))
x[[c(1,2)]] # 2L
x[[c(2,1,3)]] # c
x[[c(2,2,1,3)]] # C
which is sometimes useful.
Best,
Michael
On Mon, Jun 11, 2012 at 4:35 PM, Onur Uncu onuru...@gmail.com wrote:
Rui and the
There's no such thing as cran r -- there's just R, possibly using
the binaries distributed by CRAN. [Both are capitalized, por favor]
With that said, I believe the term you are looking for is Sweave or,
for a slightly different take on things, knitr. Both are well
documented with a little bit of
Untested guess -- are you reloading MASS in the new R session? I don't
believe loaded packages are saved in the session image... If MASS
isn't around, R won't know how to plot an lda object.
Best,
Michael
On Mon, Jun 11, 2012 at 4:55 PM, dga...@huskers.unl.edu
dga...@huskers.unl.edu wrote:
, 2012 at 12:49 AM, Majid Einian einia...@gmail.com wrote:
I am working on the package datation and it is not on CRAN.
On Sun, Jun 10, 2012 at 8:28 AM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
I presume your problem is that you are looking for non-exported
methods in some unstated
Take a look at ?replicate.
Michael
On Jun 9, 2012, at 5:16 AM, Rody rodric_seu...@hotmail.com wrote:
Hi everyone
I need to make a work for school in R and one of my questions is to create
225 datasets of 100 observations and they need to be t_225 distributed. So,
I know how to make one
Take a look at this:
x - matrix(1:9, 3)
x[2,2] - Inf
x[3,1] - NA
rowMeans(x * is.finite(x), na.rm = TRUE)
I at first thought you could simply use x[is.finite(x)] but that
looses the matrix-ness of it so instead, we use the fact that 0 * Inf
= NaN which gets killed by na.rm = TRUE. Also see my
Perhaps something like this:
x - c(11, 001100, 001001) # Test data
strsplit(x,) # See what strsplit does
do.call(rbind, strsplit(x,)) # Now combine the list elements nicely.
Incidentally, your question was grossly malformed, involving both
incomplete data and that in a non-reproducible
No worries -- it's an important question and it introduces you to one
of the most important R idioms. [And you get bonus points for having a
well formed question!]
You're probably looking for something like this:
apply(testframe, 1, function(x) testfun(x[2]))
Which goes row-by-row and
I presume your problem is that you are looking for non-exported
methods in some unstated package.
Generally the pattern is something like this
methods(plot) # shows all plot.* methods
methods(class = lm) # shows all *.lm methods
Those marked with a star are not exported but you can get at them
greatly apreciate your help,
Sincerely,
Andras
gunter.ber...@gene.com wrote:
From: Bert Gunter gunter.ber...@gene.com
Subject: Re: [R] Re-creating distributions
To: R. Michael Weylandt michael.weyla...@gmail.com
Cc: Andras Farkas motyoc...@yahoo.com, r-help@r-project.org
Date: Friday
Well, I know that ROCR and gplots are on CRAN so you should probably
be installing them with install.packages() on your magical and
unspecified OS and version of R.
Michael
On Fri, Jun 8, 2012 at 2:07 AM, guoshicheng2005
guoshicheng2...@yeah.net wrote:
I meet lots of problem when installing the
You need to set the frequency attribute of your time series.
E.g.,
HoltWinters(ts(sample(100)))
HoltWinters(ts(sample(100), frequency = 4)) # Quarterly data
See ?ts for what frequency is and to figure out what makes sense for
your problem.
Best,
Michael
On Fri, Jun 8, 2012 at 9:49 AM,
For the matter and hand, you can probably get to it by simply trying
base:::diag. In this case, it's not too hard because what you're
seeing is the S4 generic that the Matrix package is defining _over_
the regular base function generic.
More generally, going down the rabbit hole of S4:
As it
On Fri, Jun 8, 2012 at 5:31 PM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
For the matter and hand, you can probably get to it by simply trying
base:::diag. In this case, it's not too hard because what you're
seeing is the S4 generic that the Matrix package is defining _over_
In two steps, you could use ave() to split by hour and find the
maximum of price and then use an ifelse clause on the resulting vector
to see when that actually equals the given price and assign Y/N
appropriately,
I'll leave the implementation as an exercise to the reader :-)
Best,
Michael
On
Short answer: no, those are (in general) insufficient parameters to
characterize a distribution.
Long answer: unfortunately, it's not uncommon that those summary
statistics are the only ones reported based on someone or other's
limited experience with the Gaussian. There are a few things you
Thanks for the great reproducible example -- I can confirm on the
devel version of zoo.
I'd venture it's a buglet in that maxgap gets passed (by way of dots)
to na.spline -- na.spline.zoo -- na.spline.default -- na.spline.vec
-- to both .fill_short_gaps (good) and spline (bad) which is where
the
I'm not really an expert on BLAS-y things, but wouldn't there be more
problems upstream with R if it weren't able to find the local BLAS? I
was under the impression that R shipped it's own BLAS but could also
be directed to one at compile time -- either way, I would guess that
many other would
Note that in R = 2.15 you can also use paste0 for this operation more
efficiently.
Michael
On Thu, May 31, 2012 at 1:58 AM, Özgür Asar oa...@metu.edu.tr wrote:
Dear Sebastian,
The following will create the names
paste(sb,1:5,sep=)
paste(sw,1:5,sep=)
paste(Lw,1:5,sep=)
paste(Lb,1:5,sep=)
Ozgur -- No, this is not what the OP seems to be asking for (and it's
bad code anyways -- I've mentioned the importance of pre-allocation to
you before):
OP, if I understand you, you are looking for a cumsum() operation:
something like:
t - rbinom(1000, 1, 0.5)
t[t==0] - (-1)
cumsum(t)
My guess (unconfirmed) is that read.table() gives you a data frame but
density.lf expects an atomic (= not a list = not a data frame) vector.
Perhaps try density.lf(x[,1]) to just send the column -- the drop
behavior should make sure this is an atomic vector.
If that doesn't help, please do
601 - 700 of 2207 matches
Mail list logo