On 26/03/2013 02:11, mjchi168 wrote:
Hi R,
I tried to install one local source package---"qtl" into R, but failed with the
following message. I am using Macbook OS 10.8.3 with Xcode 4.6.1.
This is the wrong list: it should have been R-sig-mac. Please follow up
there.
It seems you forgot
I hope this text does not come out unreadable as before. It is readable in R
Studio.. What I am trying to do is take a time-series of prices and create
a histogram of the run lengths, where a run is a sequence of all up moves or
all down moves.
Arun of length k is sequence of k moves all in th
Hi @all,
I am biting my nails with the following problem:
I have a data set of daily rainfall measurements for the last 20 years. What I
want to do is calculate the daily cumulative sum of rainfall but only for every
year which means that the cumulative sum has to be reset each year. After the
Hi Elisa,
Based on the formula you gave, this is what I got:
dat1<- read.csv("rate.csv",sep=",")
res<- do.call(cbind,lapply(seq_len(nrow(dat1)),function(i)
do.call(rbind,lapply(split(rbind(dat1[i,],dat1[-i,]),1:nrow(rbind(dat1[i,],dat1[-i,]))),
function(x) {x1<-rbind(dat1[i,],x);colnames(x1)<-
Hi R,
I tried to install one local source package---"qtl" into R, but failed with the
following message. I am using Macbook OS 10.8.3 with Xcode 4.6.1.
ld: warning: directory not found for option '-L/usr/local/lib'
ld: library not found for -lgfortran
collect2: ld returned 1 exit status
make: **
Sören Prehn iamo.de> writes:
> Dear all, I have a problem with gamma regression (glm - family =
> Gamma) and zeros in R. The problem is the following when I try to
> estimate a dataset without zeros (endogenous variable) there is no
> problem. However, if I try to do the same with zeros I always
Hi,
I would like to create M paths of 2 correlated brownian motion incrementals
where each path is of length N. I use mvrnorm to create all the increments,
i.e.
h <- 1.0;
COV <- matrix(c(1,0,0,1),nrow=2);
dW<- h * t(mvrnorm(n=N*M,mu=c(0,0),Sigma=COV));
The next step is that I'd like
Hello,
I'm working on a problem using nested for-loops and I don't know if it's a
problem with the order of the loops or something within the loop so any
help with the problem would be appreciated. To briefly set up the problem.
I have 259 trees (from 11 different species, of unequal count for e
Thanks!
On Mon, Mar 25, 2013 at 6:25 PM, Joshua Wiley wrote:
> Yep that's exactly right! :)
>
> On Mon, Mar 25, 2013 at 6:22 PM, Antonio P. Ramos
> wrote:
> > Just to clarify: I should include wealth - the categorical variable - as
> a
> > fixed effects *and* within the smooth using the argumen
Yep that's exactly right! :)
On Mon, Mar 25, 2013 at 6:22 PM, Antonio P. Ramos
wrote:
> Just to clarify: I should include wealth - the categorical variable - as a
> fixed effects *and* within the smooth using the argument "by". It that
> correct? thanks a bunch
>
>
> On Mon, Mar 25, 2013 at 6:18
Just to clarify: I should include wealth - the categorical variable - as a
fixed effects *and* within the smooth using the argument "by". It that
correct? thanks a bunch
On Mon, Mar 25, 2013 at 6:18 PM, Joshua Wiley wrote:
> Hi Antonio,
>
> If wealth is a factor variable, you should include the
Hi,
You could also try:
library(plyr)
df1<- df
df2<- df
df$y<-revalue(df$y,c("e"="others","f"="others","g"="others"))
df$y
#[1] a b c d others others others
#or
df1$y<-mapvalues(df1$y,from=c("e","f","g"),to=rep("others",3))
levels(df1$y)
#[1] "a" "b" "c" "d"
Hi Antonio,
If wealth is a factor variable, you should include the main effect in
the model, as the smooths will be centered.
Cheers,
Josh
On Mon, Mar 25, 2013 at 6:09 PM, Antonio P. Ramos
wrote:
> Hi all,
>
> I am not sure how to handle interactions with categorical predictors in the
> GAM
Just to clarify: gam.1 has wealth inside the smooths and as a fixed effect
predictor while gam.2 only have wealth inside the smooths. Thanks
On Mon, Mar 25, 2013 at 6:09 PM, Antonio P. Ramos <
ramos.grad.stud...@gmail.com> wrote:
> Hi all,
>
> I am not sure how to handle interactions with catego
Hi all,
I am not sure how to handle interactions with categorical predictors in the
GAM models. For example what is the different between these bellow two
models. Tests are indicating that they are different but their predictions
are essentially the same.
Thanks a bunch,
> gam.1 <- gam(mortality
Can anyone help me to compute manually de CP cost-parameter in library
rpart when the command printcp is executed in a Classification tree??
Thank you very much
Alberto Cebollada Solanas
Grupo de Genética de Micobacterias (http://genmico.unizar.es/)
CIBERes - CIBER Enfermedades Respiratorias (h
or just
levels(df$y)[5:7]<-"others"
Ista Zahn wrote
> Hi Lorenzo,
>
> On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella
> <
> lorenzo.isella@
> > wrote:
>> Dear All,
>> Probably something very easy, but I am looking for the most efficient
>> ways
>> to achieve this.
>> Consider the following sn
To the OP:
Sooner or later most R beginners are bitten by this all too
convenient shortcut. As an R newbie, think of R as your
bank account: overuse of $-extraction can lead to undesirable
consequences. It's best to acquire the '[[' and '[' habit early.
Peter Ehlers
On 2013-03-25 12:43, Bert G
Hi Lorenzo,
On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella
wrote:
> Dear All,
> Probably something very easy, but I am looking for the most efficient ways
> to achieve this.
> Consider the following snippet
>
> y<-c('a','b','c','d','e','f','g')
> x<-rnorm(length(y))
> df<-data.frame(y,x)
>
> lea
In full agreement with Sarah's comments.
That being said, the Magic 8 Ball has the following in the little window for
the OP:
?rle
Regards,
Marc Schwartz
On Mar 25, 2013, at 2:44 PM, Sarah Goslee wrote:
> This is unreadable. Please repost in plain text, ideally NOT using Nabble,
> and ple
This is unreadable. Please repost in plain text, ideally NOT using Nabble,
and please also tell us what you're trying to accomplish.
Sarah
On Monday, March 25, 2013, Newbie1234 wrote:
> There are probably many mistakes with this code. I am used to coding in C
> with a debugger, so I am very new
Dear All,
Probably something very easy, but I am looking for the most efficient ways
to achieve this.
Consider the following snippet
y<-c('a','b','c','d','e','f','g')
x<-rnorm(length(y))
df<-data.frame(y,x)
leading to
df$y
[1] a b c d e f g
Levels: a b c d e f g
Now, I would like to repla
Hello Starter
Before posting, please read relevant Help files!
?"$"
where it tells you:
"x$name is equivalent to x[["name", exact = FALSE]]. Also, the partial
matching behavior of [[ can be controlled using the exact argument."
..etc.
-- Bert
On Mon, Mar 25, 2013 at 12:21 PM, Andrew Lin wr
If you use the shortcut $ then R will use partial matching to hunt for the
list element you mean.
l$fo will also match.
l[["foo"]]
will not match - the full subsetting construct doesn't use partial matching.
I think the intro to R covers this, and you can also see
?"$"
?"[["
Sarah
On Monday, Ma
Thank you so much, Jorge.
I checked and your method is at least 200 times faster than mine!
Exactly what I was looking for.
Dimitri
On Mon, Mar 25, 2013 at 5:49 PM, Jorge I Velez wrote:
> Hi Dimitri,
>
> If I understood correctly, the following will do:
>
> system.time(sum1 <- apply(mycombos, 1,
Hi Max,
This is known as fuzzy matching. When using `$`, if R can uniquely
match the element name based on what is typed, it returns it. Thus,
in your example, foo uniquely matches foobar, but if you had foobar,
foobox, $foo would not be a unique match.
Cheers,
Josh
On Mon, Mar 25, 2013 at 1
Hi Dimitri,
If I understood correctly, the following will do:
system.time(sum1 <- apply(mycombos, 1, function(x) sum(values1[x])))
system.time(sum2 <- apply(mycombos, 1, function(x) sum(values2[x])))
system.time(sum3 <- apply(mycombos, 1, function(x) sum(values3[x])))
cbind(sum1, sum2, sum3)
HTH
This is another method I can think of, but it's also slow:
for(i in 1:nrow(mycombos)){ # i=1
indexes=rep(0,10)
myitems<-unlist(mycombos[i,1:4])
indexes[myitems]<-1
mycombos$sum1[i]<-sum(values1 * indexes)
mycombos$sum2[i]<-sum(values2 * indexes)
mycombos$sum3[i]<-sum(values3 * indexes
Hello!
# I have 3 vectors of values:
values1<-rnorm(10)
values2<-rnorm(10)
values3<-rnorm(10)
# In real life, all 3 vectors have a length of 25
# I create all possible combinations of 4 based on 10 elements:
mycombos<-expand.grid(1:10,1:10,1:10,1:10)
dim(mycombos)
# Removing rows that contain pai
My apologies, I didn't realize checking HTML format would produce unreadable
text. WIll repost after some more thought to the problem. Thank you.
--
View this message in context:
http://r.789695.n4.nabble.com/Newbie-code-to-count-runs-of-up-or-down-moves-tp4662423p4662431.html
Sent from the R
There are probably many mistakes with this code. I am used to coding in C
with a debugger, so I am very new to coding in R without one and different
syntax. My code in the upper left panel of R Studio
isz<-c(3,1,4,5,2,1,0,3,5,8)zlength(z)y<-c(0,0,0,0,0,0,0,0,0,0)ylength(y)zdiff
= diff(z)zdiffn<-le
Hi folks,
I am starter for R. While I tried list as following:
> l <- list()
> l$foo
NULL
> l$foobar <- 1
> l$foo
[1] 1
Apparently, foo and foobar are different name for elements in list (actually
foo does not exist). But why they are sharing same value?
Thanks a lot!
Max
[[alternativ
Hi Arun,
I finally got the output file (attached here). It has multiple rows. could
you help me read it in R?
On Fri, Mar 22, 2013 at 3:35 PM, arun kirshna [via R] <
ml-node+s789695n4662243...@n4.nabble.com> wrote:
> Hi,
> Try this:
> con<-file("Rout2122.text")
> Lines1<- readLines(con)
> clo
Dear all,
I have a problem with gamma regression (glm - family = Gamma) and zeros in R.
The problem is the following when I try to estimate a dataset without zeros
(endogenous variable) there is no problem. However, if I try to do the same
with zeros I always get an error message. In STATA and M
On Mar 25, 2013, at 9:09 AM, C Lin wrote:
>
> Anyone knows what does this error means? > library(RcppClassic) Error in
> gzfile(file, "rb") : cannot open the connection I thought I installed the
> package successfully: > install.packages('RcppClassic') Installing package(s)
> into ŒC:/Program
Your immediate problem is that 'y' is
not reset to 1.
Easier code to write would be to use
'for' loops rather than 'while' loops.
Better still would be to use neither if
possible. I suspect that you are in
Circle 3 of 'The R Inferno'.
http://www.burns-stat.com/documents/books/the-r-inferno/
P
while(x<=21)
{
while(y<=rown)
{
n<-as.numeric(df[[y]][x]);
if(n>0)
{
while(k<=lim)
{
k<-k+1;
} # while loop for k closes
opdf[[y]][x]<-sum;
} # if statement closes
y<-y+1;
} #while for y closes
x<-x+1;
} #while wi
On 25-03-2013, at 18:43, Sahana Srinivasan
wrote:
> Hi everyone,
> I'm using the following code to go over every element of a data frame (row
> wise). The problem I am facing is that the outer 'x' variable is not
> incrementing itself, thus, only one row of values is obtained, and the
> program
Hi, sorry that got sent without the output :
Please ignore the aligning in the input, I am re-adding that here as well :
1GENEACDEFGHIKLMNPQRSTVWY2amt:Amet_00012902334171612422939635201325342732312
3amt:Amet_000219315421218835254372613914212030084
Output:
1GENEACDEFGHIKLMNPQRSTVWY2amt:Amet_00010.8
Hi everyone,
I'm using the following code to go over every element of a data frame (row
wise). The problem I am facing is that the outer 'x' variable is not
incrementing itself, thus, only one row of values is obtained, and the
program does not proceed to the next row.
This is the code:
while(x<=
Hi ,
I would like to use ggplot2 to plot a matrix as an image.
You can copy paste the following
Data<-matrix(data=rnorm(900,80,20),nrow=30,ncol=30)
lengthOut<-5
Lengths<- 15
library(reshape2)
library(ggplot2)
tdm <- melt(Data)
ggplot(tdm, aes(x = Var2, y = Var1, fill =
factor(value)),l
res[res$EN==min(res$EN),]
# m1 n1 m n cterm1_P0L cterm1_P0H c11 c12 c1 c2 alpha beta T_error
#25 9 4 13 12 0.6302494 0.7565041 0.03 0.07 0.15 0.15 0.1 0.2 0.4403712
#27 9 4 13 12 0.6302494 0.7565041 0.03 0.07 0.15 0.20 0.1 0.2 0.4473437
#33 9 4 13 12 0.6302494 0.7565
I would like to add that using the labels argument without a levels
argument in factor(),
fdata<-factor(c("b","b","c","a","b","c"),labels=c("I","II","III"))
is a dangerous way to make your factor.
Consider what would happen if the 4th input value were not "a" but
was "d" or if you were in a loc
Hello,
Though I have the same doubt as Bert, the following seems to make more
sense.
seq_along(levels(fdata))
Hope this helps,
Rui Barradas
Em 25-03-2013 15:37, Dan Abner escreveu:
Hi everyone,
I understand the process of obtaining the internal integer codes for
the raw values of a facto
Hello,
The problem seems to be with the formula interface.
# Make up some data
var1 <- rnorm(100)
var2 <- rnorm(100)
var3 <- rnorm(100)
subject <- sample(4, 100, replace = TRUE)
time <- sample(10, 100, replace = TRUE)
var1[sample(100, 10)] <- NA
var2[sample(100, 10)] <- NA
var3[sample(100, 10)]
On 25/03/2013 11:37 AM, Dan Abner wrote:
Hi everyone,
I understand the process of obtaining the internal integer codes for
the raw values of a factor (using as.numeric() as below), but what is
the best way to obtain these codes for the levels() of a factor (since
the as.numeric() results don't r
Anyone knows what does this error means? > library(RcppClassic) Error in
gzfile(file, "rb") : cannot open the connection I thought I installed the
package successfully: > install.packages('RcppClassic') Installing package(s)
into C:/Program Files/R/library (as lib is unspecified) also in
Hi,
Try this:
con<-file("Routallnew.txt")
Lines1<- readLines(con)
close(con)
indx<-rep(rep(c(TRUE,FALSE),each=2),24)
Lines2<-Lines1[!grepl("[A-Za-z]",Lines1)]
res<-read.table(text=paste(gsub("^\\s+","",Lines2[indx]),gsub("^\\s+","",Lines2[!indx])),sep="",header=FALSE)
nm1<-unlist(strsplit(gsub("^
Hi,
although it takes some 10 minutes to do the calculation (the original
dataframe has more than 100 000 rows..), it seems to work ok.
Thanks for your time and help,
Zuzana
On 25 March 2013 15:37, Rui Barradas wrote:
> Hello,
>
> I believe the following solves your problem. It's a bit more co
Why do you think you need to do this?
(Feel free to ignore, however).
-- Bert
On Mon, Mar 25, 2013 at 8:37 AM, Dan Abner wrote:
> Hi everyone,
>
> I understand the process of obtaining the internal integer codes for
> the raw values of a factor (using as.numeric() as below), but what is
> the b
Dear members of this list,
I'd like to count missing values using the aggregate function.
Something like this:
count_nas <- function(arg1) {
return(sum(is.na(arg1)))
}
aggregate(cbind(var1, var2, var3) ~ subject + time, data = mydataset,
count_nas)
It's not working: I end up with a matri
Hi everyone,
I understand the process of obtaining the internal integer codes for
the raw values of a factor (using as.numeric() as below), but what is
the best way to obtain these codes for the levels() of a factor (since
the as.numeric() results don't really make clear which code maps to
which l
Le lundi 25 mars 2013 à 05:55 -0700, rm a écrit :
> Say, that I have two observations, one from time 0 to time 50, and a second
> from time 0 to time 100, both of which are known to have failed, i.e. no
> censoring. I would like to give double the weight to the second observation.
>
> This is what
Hello,
I believe the following solves your problem. It's a bit more complicated
but with the sample dataset you've provided the result is as wished.
tmp <- lapply(split(subz, subz$time), function(x) {
i1 <- which(as.character(x$fix) == "noon")[1]
i2 <- which(as.character(x$fi
Hi Rui,
thank you for your code, but unfortunately it doesn't work correctly. What
I got is this:
> subz
jultimedtime fixddawnddusk day
101608 15006 2011-02-01 19:14:49 19.24694 noon 7.916667 19.88333 1
101609 15006 2011-02-01 19:24:49 19.41361 mid
Say, that I have two observations, one from time 0 to time 50, and a second
from time 0 to time 100, both of which are known to have failed, i.e. no
censoring. I would like to give double the weight to the second observation.
This is what I’ve tried to implement in the both pieces of code. Both pi
Hi,
To Mason:
I like your idea with reshaping the dataframe. I've read the paper and
checked the help for the "cast" function, but I wasn't able to reshape it
to wanted form, which as you mentioned would be (column names):
jul timedtime ddawn.noon ddawn.midnight ddusk.noon ddusk.midnigh
try,
update.packages(ask='graphics', checkBuilt=TRUE)
?update.packages
?download.file
?url # file:// URLs
On 3/25/2013 6:09 AM, PIKAL Petr wrote:
Hi
Strange, I thought that only Windows users are sending Html mail and providing
sparse info describing their problems.
I presume, you use 2.15.
On Fri, Mar 22, 2013 at 1:48 PM, capricy gao wrote:
> as.dendrogram
?reorder.dendrogram
Jean
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting g
Hi,
you might also want to check out some nice helpers of the "opencpu"
and "opencpu.tools" packages made by Jeroen Ooms:
https://raw.github.com/jeroenooms/opencpu.tools/master/R/install.all.packages.R
Best,
Gergely
On 25 March 2013 11:21, Twaha Mlwilo wrote:
>
>
> Hello all,Good day,Internet a
The two confidence intervals should be different. In the first model you have 3
failures and the second one you have 300. More failures results in narrower
confidence intervals.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of rm
On 13-03-25 8:31 AM, Shane Carey wrote:
Hi
I was working with a script and I came across this %*%. What does this mean?
Thanks
help("%*%")
will tell you.
Duncan Murdoch
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
Matrix Multiplication ?"%*%"
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Shane Carey
Sent: Montag, 25. März 2013 13:31
To: r-help@r-project.org
Subject: [R] %*% what does this mean
Hi
I was working with a script and I came acr
Hi
I was working with a script and I came across this %*%. What does this mean?
Thanks
--
Shane
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
> capricy gao
> on Thu, 21 Mar 2013 06:07:12 -0700 writes:
> I am going to use clara for� gene expression analysis,
> so tried to play around with the examples from R document:
> http://127.0.0.1:10699/library/cluster/html/clara.html
> Everything looked fine until I
Hi there,
I am using R 2.15.2 under Win7 64. I hope to display progress bar when I
am running a loop. After the loop exit, the cursor is at the right
margin of the window. How can I make it to the left margin?
Here is the minimal example code.
combn.bar <- function(n, m) {
n <- choose(n,
As part of a research paper, I would like to draw both weighted and
unweighted Kaplan-Meier estimates, the weight being the ’importance’ of the
each project to the mass of projects whose survival I’m trying to estimate.
I know that the function survfit in the package survival accepts weights and
p
Hello All,
A very simple question about Tinn-R. I am able to use the send line
shortcut, but I want to be able to just copy the current line to the
clipboard and then paste in the current document or somewhere else.
It's so tedious to select the whole line and then copy it.
Thanks
_
Dear all,
I am trying to plot an image so I am trying this through raster layer.
You can copy paste the following
require('raster')
Data<-matrix(data=rnorm(900,80,20),nrow=30,ncol=30)
rasterData<-raster(Data)
lengthOut<-5
xAxisFrequencies<-seq(800,900,length.out=lengthOut)
plot(rasterData, ylab="
Hello,
I have a serialized Multilayer Perceptron trained using weka.
I would like to use R to re-evaluate the model.
How can I do this? I could not find an example of RWeca that applies
to Multilayer Perceptron.
Thanks,
Rui
__
R-help@r-project.org mail
Hi
Strange, I thought that only Windows users are sending Html mail and providing
sparse info describing their problems.
I presume, you use 2.15.3 R version.
There is some readme in Ubuntu CRAN repository and if you followed that and
fail it would be necessary to provide at least what you did
Hi
Your code is not reproducible but it probably does not matter. You use tab as
separator which means the file is readable directly by spreadsheet programmes
(Excel). Reading them as text shall be OK unless some values are not so long
that they exceed predefined tabs or unless they have some l
Hello all,Good day,Internet access have been a problem , and learning R forced
to download packages manual.I have google for script for automatic R update
didnt getPlease any one with help?am using ubuntu 12.04R-2.5.3Thank
you
[[al
On Mon, Mar 25, 2013 at 6:51 AM, Francisco J. Bido wrote:
> Hi, I'm new to OOP in R so please forgive the naiveness of some of the
> questions. Here are a couple of them. It would be great if you can contrast
> to OOP in Java.
Java is not the end-all of OOP (in fact S is a good bit older than
Dear R users,
I need to export a data frame, and I would like to have all the columns
perfectly aligned with the column names. At the time being, the output is not
satisfactory.
Here below there is a real example, with the R commands that I am using.
Is it possible? How can I do?
place MDI
Hi, I'm new to OOP in R so please forgive the naiveness of some of the
questions. Here are a couple of them. It would be great if you can contrast
to OOP in Java.
1. R's S4 appears to centered around a dispatch mechanism which in my
understanding is just a way to implement polymorphism. Now,
76 matches
Mail list logo