tajo.ucsd.edu> writes:
>
> Alexandra imm.dtu.dk> writes:
>
[snip]
Close, but not quite. The problem lies in terms()
Here are the attr(terms(...),"factors") matrices:
> attributes(terms(Y ~ x:A + A:B,data=dat))$factors
x:A A:B
Y 0 0
x 2 0
A 2 2
B 0 1
> attr
Jeff Newmiller dcn.davis.ca.us> writes:
> Nope. Most users get speed by using vectorized calculations. If you
> have already identified how to get correct answers, the next step is
> something like Rcpp or linking to a shared library written in your
> language of choice.
> But seriously, vecto
Hi Again,
I am writing a 'for loop' to create a matrix of randomly sampled colors.
I've written this loop in matlab and it works fine. I then tried to do it
in R and apparently there is something wrong with my syntax b/c every time I
run the script, the for loop "blows up" at a different point i
Hard to help without a short example dataset (please read posting guide!)
posted with dput().
You likely want to "paste" together a title for your graph.
see
?paste
Rambler1 wrote
>
> Another simple question that is driving me crazy:
> I have a for loop that loops through a matrix and pulls d
Thanks. I've played around with pure R solutions. The fastest re-write of diff
(for the 1 lag case) I can seem to find is this:
diff2 = function(x) {
y = c(x,NA) - c(NA,x)
y[2:length(x)]
}
#Compiling via 'cmpfun' doesn't seem to help (or hurt):
require(compiler)
diff2 = cmpfun(diff2)
But th
On 01/27/2012 07:40 AM, uday wrote:
I have some satellite data which contains latitude and longitude information
.
> From this data I would like to calculate distance between first location
(scalar latitude and longitude) and all other (vectors latitude and
longitude)
How I should solve this pr
If you use logspline estimation (logspline package) instead of kernel density
estimation then this is simple as there are cumulative area functions for
logspline fits.
If you need to do this with kernel density estimates then you can just find the
area over your region for the kernel centered a
Facts:
1. R does not by default compile bytecode. It uses a read-parse-eval
cycle as described in the R Language Manual.
2. However, as of 2.14.0 (anyway) there is a "compiler" package that
is shipped as part of the standard distribution. Written by Luke
Tierney and his graduate student minions,
Nope. Most users get speed by using vectorized calculations. If you have
already identified how to get correct answers, the next step is something like
Rcpp or linking to a shared library written in your language of choice.
But seriously, vectorizing is enough for most applications, and making s
Simple question: is there a way to compile R scripts to native code? If not is
there anything else that might improve speed? I'm not even sure that R
compiles internally to byte code or not. I assume it does since all modern
languages seem to do this. Maybe there's a JIT compiler? Yes, I ha
On Jan 28, 2012, at 5:06 PM, Branimir Hackenberger wrote:
Dear all!
I am using wireframe function from lattice package.
Is it possible to remove box around the plot but to keep axis (x,
y, z)?
First hit on a search "make box transparent lattice sarkar":
http://finzi.psych.upenn.edu/R/R
Dear all!
I am using wireframe function from lattice package.
Is it possible to remove box around the plot but to keep axis (x, y, z)?
Thanks in advance!
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
htt
Hello,
If it helps...:
Lines <- "pet gender
dog male
dog female
dog male
cat female
cat female
cat male
"
d.f <- read.table(textConnection(Lines), header=T, as.is = TRUE)
d.tab<-table(d.f$pet, d.f$gender)
d.f.tab<-as.data.frame(table(d.f$pet, d.f$gender))
names(d.f.tab)<-c('pet','gender', 'Fre
On Jan 28, 2012, at 3:45 PM, Dimitris Rizopoulos wrote:
how about
x[x < 10 & !is.na(x)]
Besides this and the which() strategy there is also:
subset(x, x<10)
I hope it helps.
Best,
Dimitris
On 1/28/2012 9:36 PM, Federico Calboli wrote:
Dear All,
just a quick example:
x = 1:25
x[
how about
x[x < 10 & !is.na(x)]
I hope it helps.
Best,
Dimitris
On 1/28/2012 9:36 PM, Federico Calboli wrote:
Dear All,
just a quick example:
x = 1:25
x[12] = NA
x
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
y = x[x<10]
y
[1] 1 2 3 4 5
Hi,
which(x < 15)
omits the NA (treated as false).
HTH,
b.
On 29 January 2012 09:36, Federico Calboli wrote:
> Dear All,
>
> just a quick example:
>
>
>> x = 1:25
>> x[12] = NA
>
>> x
> [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
>
>> y = x[x<10]
>> y
> [1] 1 2
x[which(x < 10)]
Michael
On Sat, Jan 28, 2012 at 3:36 PM, Federico Calboli
wrote:
> Dear All,
>
> just a quick example:
>
>
>> x = 1:25
>> x[12] = NA
>
>> x
> [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
>
>> y = x[x<10]
>> y
> [1] 1 2 3 4 5 6 7 8 9 NA
>
> Is
I have successfully used the digitize package for this purpose ...
http://cran.r-project.org/web/packages/digitize/index.html
wrote:
>
> I want to take some published graphs and digitise them to allow me to
> run some analysis on them.
> Is this possible using any of R's
> plugins. I don't thi
Dear All,
just a quick example:
> x = 1:25
> x[12] = NA
> x
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
> y = x[x<10]
> y
[1] 1 2 3 4 5 6 7 8 9 NA
Is there any way of NOT getting NA for y = x[x<10]? Similarly
> y = x[x<15]
> y
[1] 1 2 3 4
It might help if you say what exactly you are struggling with. Even
better would be to provide code and data using dput() (just for the
data -- copy and paste the code).
If you can write a function to do whatever it is use need on a single
year, then tapply() will be useful for splitting by year,
Is there a reason you answer a 3.5 years old message?
Uwe Ligges
On 27.01.2012 12:37, kingsly wrote:
According to the source code of embed function, it will stop work if
dimention is<1 or>n . Part of the embed source code is mention below for
your reference.
if ((dimension< 1) | (dimension>
On 27.01.2012 11:04, Alex Hofmann wrote:
Hi,
I have a huge collection of 6-channel .wav files containing audio and
sensor recordings, which I need to analyse, across all 6 channels.
I'm thinking about what will be easier to do.
1. Just split the channels in an external audio-editor and than r
On 25.01.2012 18:50, Jin Minming wrote:
Hello Uwe,
Yes. These packages are what I used for the test in Windows 7 and vista system:
R-2.14.1 in 32-bit
BRugs version 0.7-5
OpenBUGS version (3.2.1)
On a Win 7 32 bit with the same software as described above, I cannot
reproduce a crash (e
On Jan 28, 2012, at 1:08 PM, Rohit Pandey wrote:
Hello R community,
I have two questions:
The first might be one of the silliest ever posted here and I
apologize if I've missed some thing very obvious. It relates to using
this digest. When I subscribed to the forum, I had chosen the "digest"
o
On 28 January 2012 at 11:46, Dirk Eddelbuettel wrote:
|
| On 28 January 2012 at 16:20, Hans W Borchers wrote:
| | R. Michael Weylandt gmail.com> writes:
| | >
| | > I'd write your own diff() that eliminates the method dispatch and
| | > argument checking that diff -> diff.default does.
| | >
|
Hello R community,
I have two questions:
The first might be one of the silliest ever posted here and I
apologize if I've missed some thing very obvious. It relates to using
this digest. When I subscribed to the forum, I had chosen the "digest"
option that bundles all mails every day into a single
On 28 January 2012 at 16:20, Hans W Borchers wrote:
| R. Michael Weylandt gmail.com> writes:
| >
| > I'd write your own diff() that eliminates the method dispatch and
| > argument checking that diff -> diff.default does.
| >
| > x[-1] - x[-len(x)] # is all you really need.
| > (# you could also
R. Michael Weylandt gmail.com> writes:
>
> I'd write your own diff() that eliminates the method dispatch and
> argument checking that diff -> diff.default does.
>
> x[-1] - x[-len(x)] # is all you really need.
> (# you could also try something like c(x[-1], NA) - x which may be
> marginally fast
On Fri, Jan 27, 2012 at 2:26 PM, Sam Albers wrote:
> Hello,
>
> I am looking for a way to subset a data frame by choosing the top ten
> maximum values from that dataframe. As well this occurs within some
> factor levels.
>
> ## I've used plyr here but I'm not married to this approach
> require(ply
Hi,
On Sat, Jan 28, 2012 at 5:42 AM,
wrote:
>
>
> I want to take some published graphs and digitise them to allow me
> to run some analysis on them.
You can do this manually with locator(), but it's more efficient to use
something like ImageJ if you have a lot to do.
Or, you know, just email th
ehm... this doesn't take very many ideas.
x = runif(n=10e6, min=0, max=1000)
x = round(x)
system.time( {
y = x[-1] - x[-length(x)]
})
I get about 0.5 seconds on my old laptop.
HTH
Peter
On Fri, Jan 27, 2012 at 4:15 PM, Kevin Ummel wrote:
> Hi everyone,
>
> Speed is the key here.
>
> I ne
On 12-01-28 4:45 AM, PUTRI AYU OCTAVIANI wrote:
Dear R help team,
I am trying to open R 2.13.0 to continue my analysis but it doesn't want to
open and I get this message "fatal error unable to restore saved data in
.rdata". I don't know what went wrong ( iam using Windows 7). Could you
please
On Fri, Jan 27, 2012 at 1:26 PM, Sam Albers wrote:
> Hello,
>
> I am looking for a way to subset a data frame by choosing the top ten
> maximum values from that dataframe. As well this occurs within some
> factor levels.
>
> ## I've used plyr here but I'm not married to this approach
> require(ply
Try this:
mine <- 1:6
table.combos <- matrix(data = 1:12, nrow = 10, ncol = 6, byrow)
row.is.a.match <- apply(table.combos, 1, identical, mine)
match.idx <- which(row.is.a.match)
total.matches <- sum(row.is.a.match)
On Sat, Jan 28, 2012 at 2:10 AM, Jason J. Pitt wrote:
>
> Hi Melissa,
>
> Well,
Dear R help team,
I am trying to open R 2.13.0 to continue my analysis but it doesn't want to
open and I get this message "fatal error unable to restore saved data in
.rdata". I don't know what went wrong ( iam using Windows 7). Could you
please help me on this? Thanks a lot
Putri -Indonesia
I want to take some published graphs and digitise them to allow me
to run some analysis on them.
Is this possible using any of R's
plugins. I don't think it is but I never cease to be amazed at what R
can do and it'd be great if it was as it would almost certainly be more
powerful than doing
'library' in R has a different meaning: I've altered the subject to be
more accurate 'libR'.
This is what R CMD SHLIB is for: it does all this for you in a portable way.
But if you want to DIY, you can use R CMD config to find out the
appropriate linker incantation.
BTW, I think it is Octave
On Jan 28, 2012, at 07:25 , Berend Hasselman wrote:
>
> On 27-01-2012, at 21:45, Ty Canuck wrote:
>
>> What accounts for the different result?
>>
>>> as.numeric(as.POSIXct("2012-01-13 08:10:00") - as.POSIXct("2012-01-13
>> 00:00:00") , units='secs')
>> [1] 29400
>>
>>> trunc(as.numeric(as.POS
What does this have to do with date formats?? Please do not use "reply" to
discuss unrelated matters; even if you change the header, threading mail
readers will become confused.
Approach is a non-factor (the output says so), so treated as numerical, i.e.
you are effectively doing a linear regre
39 matches
Mail list logo