Dear Stefano,
A practical way might be as the following
R acc-read.table(acc.txt,header=T) #reading your data into R
R acc.may-acc[acc[,3]==5,] #subsetting data with respect to may
R acc.may.order-acc.may[order(acc.may[,4]),] #ordering with respect to day
R mean(acc.may.order[1:7,5]) # mean of
Since I thought this was a cool question, I posted it to StackOverflow.
Vincent Zookynd's answer is amazing and really exercises the power of R.
http://stackoverflow.com/questions/10150161/ordering-117-by-perfect-square-pairs/10150797#10150797
On Fri, Apr 13, 2012 at 10:06 PM, Bert Gunter
Hi Felipe
On 22 March 2012 10:13, Felipe Nunes felipnu...@gmail.com wrote:
I'm using censReg() to run a random effects model, but R is having an error.
Can you help me understanding why?
When I run this model, everything works fine:
tob1 - censReg(transfers.cap ~ factor(year) + district2 +
Thank you very much Luke,
With regards,
Tal
Contact
Details:---
Contact me: tal.gal...@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
Hello deari Uwe,
What you explain about enableJIT makes sense, except that I would not
expect it to slow down the function in an order of magnitude.
If it was only adding a constant time to the startup time, I would
understand, but I suspect that this is not the case here. For example, see
this
Hi all, I had the same problem and I was trying to solve with several ways.
However it was the most simple thing. While I was extracting the file from
Excel to a csv file I was using , instead of . inside my numbers (for
example 9,28 instead of 9.28) and each column was seperated with a ;
instead
Hi there,
I have been having trouble running negative binomial regression (glm.nb)
using library MASS in R v2.15.0 on Mac OSX.
I am running multiple models on the variables influencing the group size of
damselfish in coral reefs (count data). For total group size and two of my
species, glm.nb
i am running one script for many files,
Script file atttached:-
http://r.789695.n4.nabble.com/file/n4556770/AR_anarkali_aic.r
AR_anarkali_aic.r
warnings are given as below
what is meaning of these warnings?
Warning messages:
1: In optim(coef, err, gr = NULL, hessian = TRUE, ...) :
one-diml
On 14-04-2012, at 08:33, sagarnikam123 wrote:
i am running one script for many files,
Script file atttached:-
http://r.789695.n4.nabble.com/file/n4556770/AR_anarkali_aic.r
AR_anarkali_aic.r
warnings are given as below
what is meaning of these warnings?
Warning messages:
1: In
Hi all.
I found one situation, on my OS - Windows 7, where R stops working
with reported error R for Windows GUI front-end has stopped working.
Here is the example:
library(plyr)
DF - data.frame(x=c(1:3, NA, NA), y=factor(sample(1:3,5,rep=T),levels=1:5))
DF[DF$x3, ]
#this works properly
Yes, that causes a segmentation fault on OSX too
--
ddply(DF[DF$x3, ], .(y), nrow, .drop=FALSE)
*** caught segfault ***
address 0x0, cause 'memory not mapped'
Traceback:
1: .Call(split_indices, index, group, as.integer(n))
2: split_indices(seq_along(splitv), as.integer(splitv),
On 13-04-2012, at 22:20, Gene Leynes wrote:
I can't figure out why this is returning an NA for the slope in one case,
but not in the other.
I can tell that R thinks the first case is singular, but why isn't the
second?
## Define X and Y
## There are two versions of x
## 1) as is
Hi,
For my master thesis I have 24 micro-plots on which I did measurements during 3
months.
The measurements were:
- Rainfall and runoff events throughout 3monts (runoff being dependant on the
rainfall, a coefficient (%) has been made per rainfall event and per 3 months)
- Soil texture (3
Easy question a bit. So here's my code:
http://pastebin.com/F4iQPVy5
I am trying to read in a series of timestamps. However with POSIXlt as FUN
in read.zoo, the output is merely two numbers and is not the output that I'm
hoping for. The code above should reproduce the error.
Here is code that
On Sat, 14 Apr 2012, knavero wrote:
Easy question a bit. So here's my code:
http://pastebin.com/F4iQPVy5
I am trying to read in a series of timestamps. However with POSIXlt as
FUN in read.zoo, the output is merely two numbers and is not the output
that I'm hoping for. The code above should
On 12-04-13 4:45 PM, Waichler, Scott R wrote:
Hi, I've read up on readBin() and chapter 6 in the R Data Import/Export manual,
but I still can't read a binary file. Here is how the creator of the file
described the code that would be needed in Fortran:
You need to see what's in the file.
Hello Drs. Colosimo and Harrell,
Thank you for your replies to my question. From Dr. Colosimo, I was able to
determine that the SAS results can be replicated by adding the
option conf.type=log-log to my code as in :
survobj - survfit(survfrm, conf.type=log-log, data=Survival)
Originally,
On 12-04-13 6:20 PM, Lee Hachadoorian wrote:
I'm use RPostgreSQL to access data on a Postgres server. I would like to
keep my SQL statements in external files, as they're easier to write and
debug in pgAdmin, then I use readLines to bring them into R and feed to
dbGetQuery.
Here's the problem.
Hi, I've written some R code that runs through a loop a certain number of
times. I want to save the output of each loop under a new variable name,
but I seem unable to do so.
I have a [10,1] matrix of stock tickers, and I want to save the output to
the variable name:
Francesca Sorbie fsorbie at hotmail.com writes:
Hi,
For my master thesis I have 24 micro-plots on which I
did measurements during 3 months.
The measurements were:
- Rainfall and runoff events throughout 3monts
(runoff being dependant on the rainfall, a coefficient (%)
has
On 12-04-13 8:32 PM, Whit Armstrong wrote:
Is putting a variable into a list a deep copy (and is tracemem the
correct way to confirm)?
Yes, it is a deep copy, but done in a lazy way so tracemem won't show
it. The copying won't be done until necessary, i.e. you modify it.
On 14-04-2012, at 15:16, johnny123 wrote:
Hi, I've written some R code that runs through a loop a certain number of
times. I want to save the output of each loop under a new variable name,
but I seem unable to do so.
I have a [10,1] matrix of stock tickers, and I want to save the output
Monroe, Melanie melanie.monroe at yale.edu writes:
I have reconstructed ancestral character states on a phylogeny using
MuSSE in the diversitree package and plotted the character state
probabilities as pie charts on the nodes. I would, however, like to
colour the character states of my extant
Your function is giving NaN's during the optimization.
The R-forge version of optimx() has functionality specifically intended to deal
with this.
NOTE: the CRAN version does not, and the R-forge version still has some
glitches!
However, I easily ran the code you supplied by changing optim to
On 14.04.2012 09:01, Tal Galili wrote:
Hello deari Uwe,
What you explain about enableJIT makes sense, except that I would not
expect it to slow down the function in an order of magnitude.
If it was only adding a constant time to the startup time, I would
understand, but I suspect that this is
Use lists.
e.g.
results - lapply(1:10,function(i,...){ do stufff } )
will give you a list of results that you can name if you wish to.
You can also explicitly fill the list with the loop if you don't like
lapply -- some folks don't like anonymous functions, for example,
along the lines of:
Well, this Olympiad challenge led to some interesting responses.
First, Bert Gunther noted that the arragement of 1:17 must have
17 at one end, allowing it to be solved on paper in a few minutes.
That would definitely be in the spirit of the Olympiad, where
'In the Olympiad it's about starting
LNadler lauren.e.nadler at gmail.com writes:
Hi there,
I have been having trouble running negative binomial regression (glm.nb)
using library MASS in R v2.15.0 on Mac OSX.
I am running multiple models on the variables influencing the group size of
damselfish in coral reefs (count
Thank you Berend and Mark,
It seems pretty clear, the problem is with the numbers and not with R.
Intuitively, I didn't think that regressing on Y on X would give different
results than regressing Y on X - C (where C is a constant). So, I thought
that R was doing something strange with
Hello everyone,
I have a data frame (tt), see below (I only show 2 genes, actually I have a
lot):
groupgene1 gene2 Control 28.9776 9.9355
Control 28.9499 10.0997 Control 29.5468 14.2995 Control 29.5246 13.9561
Test1 29.1864 9.7718 Test1 29.2048 10.0388 Test1
On 14.04.2012 00:24, Katharine Miller wrote:
Hi,
I have some C++ code that I compiled into a dll for use in 32 bit R and
would like to recompile for use in 64bit R. I thought it would be as easy
as going to R-2.15.0\bib\x64 and running R CMD SHLIB mfregRF.c
Is this Windows?
1. If so, is
On 14.04.2012 04:41, Kjetil Halvorsen wrote:
see below.
On Fri, Apr 13, 2012 at 8:50 PM, Kjetil Halvorsen
kjetilbrinchmannhalvor...@gmail.com wrote:
I am experimenting with rSymPy, and it seems to work nice.
However, I dislike the need to wrap all sympy expressions within
quotes, it leads
I guess you just want one data.frame with the columns part1 and part2?
Then:
merge(part1, part2)
should do thr trick.
If you aim at something different, please explain you expected result.
Uwe Ligges
On 14.04.2012 01:33, Johnny Liseth wrote:
I am trying to merge two data frames, but one of
Hi everyone,
I have a quick question about the random part in lme().
Here is the code:
lme(WBEING~HRS+LEAD+G.HRS,random=~LEAD|GRP)
I want to specify both random intercept and random slope of LEAD. Is the
random intercept already in it? or should I specify it like:
Hi,
Sorry - I should have said that I was using Windows 7 on a 64 bit computer
in my earlier post.
I used the installer to install R, I did not do a build from source. I
have read the installation instructions. Both R and Rtools are first in my
path, but by toolchain do you mean that I need to
On 14.04.2012 19:01, Katharine Miller wrote:
Hi,
Sorry - I should have said that I was using Windows 7 on a 64 bit computer
in my earlier post.
Which Windows 7? 64-bit or 32-bit?
I used the installer to install R, I did not do a build from source. I
have read the installation
Could everyone help me?
--
View this message in context:
http://r.789695.n4.nabble.com/could-not-find-function-when-compiling-PDF-tp4555489p4557250.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
On 14.04.2012 16:01, damiloveu wrote:
Could everyone help me?
First of all, read the posting guide to this mailing list - and try to
avoid the Nabble interface!
Other issues:
1. Learn to ask your question precisely.
2. Learn to use a mailing list and quote the former messages in the
I used log-log in my book too until Terry Therneau alerted me to the
significant problems this creates. In the 2nd edition it will use log S(t).
Frank
Paul Miller wrote
Hello Drs. Colosimo and Harrell,
Thank you for your replies to my question. From Dr. Colosimo, I was able
to determine
Hello,
When the ar.ols function (in the package stats) is run with an argument
that has a variance of zero, it returns an error:
ar.ols(c(1,1,1))
Error in qr.default(x) : NA/NaN/Inf in foreign function call (arg 1)
I believe that the reason is because the time series is automatically
Dear r experts,
Sorry for this basic question, but I can't seem to find a solution…
I have this data frame:
df - data.frame(id = c(id1, id1, id1, id2, id2, id2), A =
c(11905, 11907, 11907, 11829, 11829, 11829), v1 = c(NA, 3, NA,1,2,NA), v2 =
c(NA,2,NA, 2, NA,NA), v3 = c(NA,1,NA,1,NA,NA), v4 =
On Apr 14, 2012, at 11:40 AM, Junyu Lee wrote:
Hello everyone,
I have a data frame (tt), see below (I only show 2 genes, actually I
have a
lot):
Shouldn't you be working with a statistician to get advice about how
to handle the multiple comparison issues you are most certainly facing?
On Apr 14, 2012, at 14:40 , Berend Hasselman wrote:
On 13-04-2012, at 22:20, Gene Leynes wrote:
I can't figure out why this is returning an NA for the slope in one case,
but not in the other.
I can tell that R thinks the first case is singular, but why isn't the
second?
## Define X
On 14-04-2012, at 21:45, peter dalgaard wrote:
On Apr 14, 2012, at 14:40 , Berend Hasselman wrote:
On 13-04-2012, at 22:20, Gene Leynes wrote:
I can't figure out why this is returning an NA for the slope in one case,
but not in the other.
I can tell that R thinks the first case is
OK. So, I have 64 bit Windows 7 and I have installed R 2.15.0
Thanks
2012/4/14 Uwe Ligges lig...@statistik.tu-dortmund.de
On 14.04.2012 19:01, Katharine Miller wrote:
Hi,
Sorry - I should have said that I was using Windows 7 on a 64 bit computer
in my earlier post.
Which Windows 7?
Hi,
I'm trying to obtain a measure of how similar two matrices are. Each is a
representation of the level of a variable (say A and B respectively) on a
two-dimensional lattice, where any matrix entry exactly corresponds to the
level of the variable at those coordinates on the lattice.
After
try this:
x # print data
id A v1 v2 v3 v4 v5 numMiss
1 id1 11905 NA NA NA N 0 3
2 id1 11907 3 2 1 Y 0 0
3 id1 11907 NA NA NA N 0 3
4 id2 11829 1 2 1 Y 1 0
5 id2 11829 2 NA NA N 0 2
6 id2 11829 NA NA NA N 0 3
# select best data
Peterso wrote
Uwe:
I was actually trying to stack one table on top of the other. All column
names are the same except for the Part1 and Part 2. My final table should
look like the table below. Maybe it is possible to change the names of
Part1 and Part 2 to Part?
A B C Part
1 0 1 550
Hello everyone,
I posted a question this morning, when I got replies, I realized that the
data I posted was messy. So I am going to re-post it.
Here is my data frame:
groupgene1 gene2
Control 28.9776 9.9355
Control
On 04/14/2012 09:37 AM, Duncan Murdoch wrote:
sql - sub(\uFEFF, , sql)
Thank you, this worked exactly.
Best,
--Lee
--
Lee Hachadoorian
PhD, Earth Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu
On Fri, Apr 13, 2012 at 9:50 PM, Kjetil Halvorsen
kjetilbrinchmannhalvor...@gmail.com wrote:
I am experimenting with rSymPy, and it seems to work nice.
However, I dislike the need to wrap all sympy expressions within
quotes, it leads to ugly calls like
library(rSymPy)
Var(x,y,z)
On Sat, Apr 14, 2012 at 5:44 AM, a.f.fen...@lse.ac.uk wrote:
Hello
I'm trying to get the proportion true for dichotomous variable for
various subgroups in a survey.
This works fine, but obviously doesn't give proportions directly:
svytable(~SurvYear+problem.vandal, seh.dsn, round=TRUE)
On Apr 14, 2012, at 4:44 PM, Junyu Lee wrote:
Hello everyone,
I posted a question this morning, when I got replies, I realized
that the
data I posted was messy. So I am going to re-post
It's still a mess.
Here is my data frame:
Learn to use dput:
dfrm -
structure(list(group =
Both specifications are the same model. An intercept is added by default unless
you use +0 or -1
like ~0 + LEAD|GRP or ~ -1 + LEAD|GRP
Van: r-help-boun...@r-project.org [r-help-boun...@r-project.org] namens YA
[xinxi...@163.com]
Verzonden: zaterdag 14
Peter,
thanks for clarification.
Andrija
On Sat, Apr 14, 2012 at 12:11 PM, peter dalgaard pda...@gmail.com wrote:
Yes, that causes a segmentation fault on OSX too
--
ddply(DF[DF$x3, ], .(y), nrow, .drop=FALSE)
*** caught segfault ***
address 0x0, cause 'memory not mapped'
Achim Zeileis-4 wrote
You just need to declare that the index is in two columns (1 and 2) and
then provide a function that extracts a suitable object from it:
read.zoo(test.txt, header = FALSE, index = 1:2,
FUN = function(x, y) strptime(paste(x, y), %d/%m/%Y %H:%M))
Use an
My solution:
SP - split(df, df[, 1:2])
minner - function(x, col = 'numMiss') { x[which.min(unlist(x[,col])), ,
drop=FALSE]}
NEW - do.call('rbind', lapply(SP, minner))SP2 - split(NEW, NEW[,
'id'])do.call('rbind', lapply(SP2, function(x) minner(x, 'A')))
Cheers,Tyler
Date: Sat, 14 Apr 2012
Achim Zeileis-4 wrote
You just need to declare that the index is in two columns (1 and 2) and
then provide a function that extracts a suitable object from it:
read.zoo(test.txt, header = FALSE, index = 1:2,
FUN = function(x, y) strptime(paste(x, y), %d/%m/%Y %H:%M))
Use an
Hi,
I work on MacOS, trying to Sweave an UFT8 document.
AFAI remember R 2.14 used to render a warning when the encoding was not
declared when using Sweave.
With R 2.15 it seems to render an error.
Sweave(sim_pi.Rnw)
Error: 'sim_pi.Rnw' is not ASCII and does not declare an encoding
Declaring an
Hi,
I know this is probably a basic question... But I don't seem to find the
answer.
I'm fitting a GLM with a Poisson family, and then tried to get a look at the
predictions, however the offset does seem to be taken into consideration:
On Apr 14, 2012, at 6:47 PM, smfa wrote:
Hi,
I know this is probably a basic question... But I don't seem to find
the
answer.
I'm fitting a GLM with a Poisson family, and then tried to get a
look at the
predictions, however the offset does seem to be taken into
consideration:
On Sat, Apr 14, 2012 at 5:06 PM, knavero knav...@gmail.com wrote:
Achim Zeileis-4 wrote
You just need to declare that the index is in two columns (1 and 2) and
then provide a function that extracts a suitable object from it:
read.zoo(test.txt, header = FALSE, index = 1:2,
FUN =
Hi,
I was wondering what the best equivalent to SAS's FASTCLUS and PROC CLUSTER
would be. I need to be able to test the significance of the clusters by
comparing the probability of obtaining an equal or greater pseudo F to the
Bonferroni-corrected level. I will also need to plot r squared
I am wrestling with the following in creating a barplot in R:
I have a data set with 18 entries. It is plotted in a bargraph. The x-axis
should have 18 tick marks each with its own label. What happens is, only a few
labels are shown; there is not enough space for all labels. The tick marks are
On Apr 14, 2012, at 8:11 PM, Fino Fontana wrote:
I am wrestling with the following in creating a barplot in R:
I have a data set with 18 entries. It is plotted in a bargraph. The
x-axis should have 18 tick marks each with its own label. What
happens is, only a few labels are shown; there
On Apr 14, 2012, at 9:21 PM, David Winsemius wrote:
On Apr 14, 2012, at 8:11 PM, Fino Fontana wrote:
I am wrestling with the following in creating a barplot in R:
I have a data set with 18 entries. It is plotted in a bargraph. The
x-axis should have 18 tick marks each with its own label.
I am running two mixed effects regressions. One (fitRandomIntercept) has a
random intercept, the second (fitRandomInterceptSlope) has a random intercept
and a random slope. In the random slope regression, the fixed effect for time
is not significant. In the random intercept random slope model,
Hi,
I am working on ranking algo? I have data which is in the form of vectors
(feature) for each class and i need to rank them based on feature vector.
class1-c(1,3,4,-2,0)
class2-c(2,0,0,-3,0)
class3-c(2,3,1,4,5)
class4-c(-4,-5,1,0,0)
I need to rank class1, class2, class3, class4 class5. How
Hi John,
R-help is not really for statistical questions (see something like
statsexchange) or mixed models in R (there is a SIG mailing list for
those). Just a note for next time.
1) The estimate for the time effect when it is a fixed effect versus
random effect are different things. The
Hi,
I am currently stuck on the following problem: I have a matrix where each
element is a list of numbers of differing lengths. I am wondering what would
be the best way to send this to my C function using .C?
Cheers,
Chris
--
View this message in context:
This question is too vague. There are probably an infinite number of ways to
rank them. Are apples better than bananas? Is the second element of the vector
more important than the third? By how much?
---
Jeff Newmiller
71 matches
Mail list logo