Merci Arun
Michel
Le 17/09/2013 22:41, arun a écrit :
Hi Arnaud,
You could also try:
indx<- Df1$Mat[-1]==Df1$Mat[-nrow(Df1)]
indx1<-c(indx,FALSE)
indx2<-c(FALSE,indx)
Df1[indx1,]
Df1[indx2,]
A.K.
From: arun
To: Arnaud Michel
Cc: R help
Sent: Tuesday, Sep
Hello,
Apologies. findFn('cov2cor') did not find it...
Regards,
Pascal
2013/9/18 Pascal Oettli
> Hello,
>
> From where this function comes?
>
> Regards,
> Pascal
>
>
> 2013/9/18 Guy Wachsman
>
>> Hi there,
>>
>> Can anyone explain this function, I have the function for the covariance
>> and
Hello,
>From where this function comes?
Regards,
Pascal
2013/9/18 Guy Wachsman
> Hi there,
>
> Can anyone explain this function, I have the function for the covariance
> and
> I need to write the transformation to correlation (no worries, I am doing
> this for myself, not for credit). Since i
Hi there,
Can anyone explain this function, I have the function for the covariance and
I need to write the transformation to correlation (no worries, I am doing
this for myself, not for credit). Since it is already out there, I would
like to understand it. What does every line mean especially the
Hi Everyone,
So I am trying to use the clusterboot function in the fpc package in R. Really
I want some measures of cluster stability. I would love to get something like
p-values on the different branches of the dendrogram. I've tried to use this
function now but I haven't yet been able to. I'
Good morning,
I am an economist. I try to build a strategic - tactical portfolio based on
my forecasts on different assets. I would want to use the BLCOP package.
The strategic portfolio would be based on one-year expectation on the
return of each asset
The tactical portfolio, with a monthly re
Quoting "Zhang Weiwu" :
Jim Holtman asked me to elaborate the problem:
It is a common problem in reading sparse variable-lenght record data
file. Records are stored in file one next to another. The length of
each record is known in advance, but a lot of them records are invalid,
You could use findInterval to find which interval each element is in, then
use table to count up how many are in each interval:
> table(findInterval( 1:10, c(3,5,6,10) + 10*.Machine$double.eps ) )
0 1 2 3
3 2 1 4
On Tue, Sep 17, 2013 at 4:15 AM, wrote:
> I can do this:
>
> 1:10 %in% c(3, 5,
I'm not sure why either, but here's a simpler (and much faster)
illustration of the problem:
library(microbenchmark)
A <- matrix(1:9,3)
replicate(10, microbenchmark(colMeans(A), times = 4)$time)
replicate(10, microbenchmark(A, times = 4)$time)
Hadley
On Mon, Sep 16, 2013 at 8:11 AM, Christophe
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Lorenzo Isella
> Sent: Tuesday, September 17, 2013 2:26 PM
> To: r-h...@stat.math.ethz.ch
> Subject: [R] Generation of a Markov Chain
>
> Dear All,
> While looking for a way to g
The alternatives you mention are all forms of serialization, so they are all
subject to this limitation. As Luke said, it would be a lot of work to fix
this, so if the answer were as easy as using a different function then they
would already have done that.
--
On 13-09-17 6:36 PM, meng wrote:
Thanks for your reply.
Is "fitted(lm(...))" the same as "values" of lines(values)?
If yes,then why the range of lines(values) is different from
range(fitted(lm(...)))?
You are plotting against the wrong x axis, and you don't see all the values.
Duncan Murdoch
All,
Trying to avoid using attach and detach while teaching class in Intro Stats.
data=read.delim("dataset1.dat",header=TRUE)
with(data,{
sort(age)
length(age)
(age[10]+age[11])/2
})
However, this code only produces output for the last line between the curly
braces. Granted, as we type the
Hi Arnaud,
You could also try:
indx<- Df1$Mat[-1]==Df1$Mat[-nrow(Df1)]
indx1<-c(indx,FALSE)
indx2<-c(FALSE,indx)
Df1[indx1,]
Df1[indx2,]
A.K.
From: arun
To: Arnaud Michel
Cc: R help
Sent: Tuesday, September 17, 2013 4:21 PM
Subject: Re: [R] delete some l
Thanks for your reply.
Yes, abline is much better,but it can only add straight line,and
lines(fitted(lm(y~x)) ~ x) can do the same thing but not constrain to straight
line.
At 2013-09-17 20:45:08,"Bretschneider (R)" wrote:
Dear
meng,
Re:
Hi all:
I met a question about "lines".
atta
Dear Dave
Thanks a lot for your reply and pointing out the important differences between
ncdf4 and RNetCDF!
Exactly as you write, RNetCDF is currently limited to the version 3 data model.
There are still plans to implement the new data model, however we will need to
make some restrictions on d
Thanks for your reply.
Is "fitted(lm(...))" the same as "values" of lines(values)?
If yes,then why the range of lines(values) is different from
range(fitted(lm(...)))?
If no, what "values" refers to?
At 2013-09-17 20:56:04,"Duncan Murdoch" wrote:
>On 13-09-17 8:06 AM, meng wrote:
>> Hi a
At this point R's serialization format only preserves sharing of
environments; any other sharing is lost. Changing this will require an
extensive rewrite of serialization. It would be useful to have this,
especially as we are trying to increase sharing/decrease copying, but
it isn't likely any tim
Thank you Arun
but the values of other columns may be different !!!
Michel
Le 17/09/2013 20:56, arun a écrit :
Hi,
Try:
Df1[duplicated(Df1),]
Df1[duplicated(Df1,fromLast=TRUE),]
A.K.
- Original Message -
From: Arnaud Michel
To: R help
Cc:
Sent: Tuesday, September 17, 2013 2:14 PM
S
On 09/18/13 07:26, Arnaud Mosnier wrote:
Hi all,
I want to present a figure including the uppercase and lowercase version of
the greek letter phi.
I know that I can use "expression" to have the symbol like in:
plot(1~1, main = expression(phi))
But, is there somewhere things like upper(phi) or
On Tue, 2013-09-17 at 14:39 -0500, luke-tier...@uiowa.edu wrote:
> At this point R's serialization format only preserves sharing of
> environments; any other sharing is lost. Changing this will require an
> extensive rewrite of serialization. It would be useful to have this,
> especially as we are
On 09/18/2013 02:23 AM, Ahmed Attia wrote:
-- Forwarded message --
From: Ahmed Attia
Date: Tue, Sep 17, 2013 at 11:17 AM
Subject: axis lab font in r
To: r-help-requ...@r-project.org
I have an a question about the axis lab font in r. I use font.lab, but
r changes the font of x a
You seem to be applying the syntax for the within function to the with
function. You should compare the documentation for them and choose your
approach accordingly.
Also once inside a code block of any type, simply typing a variable name no
longer prints it, so you need to use the appropriate fu
Hello,
I recently started using PAM to analyze my microarrays
(http://cran.r-project.org/web/packages/pamr/pamr.pdf). Firstly does anyone
know of a specific forum or help section for this package?
Currently with ?pamr.from.excel you can only have one line of labels, ie
control vs treatmen
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
We need a bit of information and code about how you are using font.ab.
As far as I can see both x and y axes should be affected.
See this example from
http://r.789695.n4.nabble.com/font-lab-and-font-axis-td3
Dear All,
While looking for a way to generate a Markov chain given a transition
matrix, I found this
http://bit.ly/1a1CFl8
but the example provided does not work on my machine
y<-numeric(100)
x=matrix(runif(16),4,4) for(i in 2:100) {
+ y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])
Saving and loading data is roughly doubling memory use. I'm trying to
understand and correct the problem.
R1 was an R process using just over 2G of memory.
I did save(r3b, r4, sflist, file="r4.rdata")
and then, in a new process R2,
load(file="r4.rdata")
R2 used just under 4G of memory, i.e., alm
Shouli Li utu.fi> writes:
>
> I have the same problem. I am wondering have you solved the problem already?
>
> [[alternative HTML version deleted]]
>
>
It's completely unclear from this message what the context is,
so it's unanswerable -- sorry. (Perhaps there was a link to
the ori
On 17/09/2013 3:26 PM, Arnaud Mosnier wrote:
Hi all,
I want to present a figure including the uppercase and lowercase version of
the greek letter phi.
I know that I can use "expression" to have the symbol like in:
plot(1~1, main = expression(phi))
But, is there somewhere things like upper(phi
Hi,
Try:
Df1[duplicated(Df1),]
Df1[duplicated(Df1,fromLast=TRUE),]
A.K.
- Original Message -
From: Arnaud Michel
To: R help
Cc:
Sent: Tuesday, September 17, 2013 2:14 PM
Subject: [R] delete some lines of a dataframe
Hi
I have a dataframe Df1
dput(Df1)
structure(list(Mat = c(141, 14
Hi Arnaud,
In that case:
Try:
Df1[duplicated(Df1$Mat),]
Df1[duplicated(Df1$Mat,fromLast=TRUE),]
#or
A.K.
- Original Message -
From: Arnaud Michel
To: arun
Cc: R help
Sent: Tuesday, September 17, 2013 4:00 PM
Subject: Re: [R] delete some lines of a dataframe
Thank you Arun
but th
There is no difference, the same query structure is in the both cases:
"6683"
"character"
"character"
"select * from students where student_id = 6683 order by date_time"
"4738D"
"character"
"character"
"select * from students where student_id = 4738D order by date_time"
and still is the same error
Hello everyone.
I am very much a beginner with R and I am trying to turn the following if-then
statement into R code. More detail. I want to create a new variable: "inperiod"
that will be a numeric code. So if a specific event start date (StartDate) is
greater or equal to a testing date (Beg1Da
Hi all,
I want to present a figure including the uppercase and lowercase version of
the greek letter phi.
I know that I can use "expression" to have the symbol like in:
plot(1~1, main = expression(phi))
But, is there somewhere things like upper(phi) or lower(phi) ?
Thanks for your help !
Arna
On Tue, 2013-09-17 at 12:06 -0700, Ross Boylan wrote:
> Saving and loading data is roughly doubling memory use. I'm trying to
> understand and correct the problem.
Apparently I had the process memories mixed up: R1 below was the one
with 4G and R2 with 2G. So there's less of a mystery. However..
thanks, Jeff,
good point... I'll try that
On Tue, Sep 17, 2013 at 9:43 AM, Jeff Newmiller wrote:
> Why don't you print the 'query' variable with each id value and consider
> what the SQL syntax is for number and string literals. Then study the use
> of escaping in strings ("\\") to fix the quer
I am not sure how exactly the history is implemented internally, and it
could be different depending on where and how you run R. It looks like the
general rule for `savehistory` is to overwrite with the entire history
every time that you run it.
One way to get the behavior that you describe would
Hi all,
I have a data set made of 12 years each one with a number of males and a
number of females. I tested the relationship between the sex ratio
(proportion of males over the total) weighted for the number of
individuals of each year.
In R:
glm.1<-glm(cbind(males,females)~predictor,bino
Why don't you print the 'query' variable with each id value and consider what
the SQL syntax is for number and string literals. Then study the use of
escaping in strings ("\\") to fix the query.
---
Jeff Newmiller
Hello,
I tried to compute the covariance (between the columns) of a matrix with
>20.
This failed ...
Error: cannot allocate vector of size 691.2 GB
Ok, this is rather huge. But ... On the other hand ... Is there an
alternative to cov?
Maybe one could combine combn with cov - so it is rather
I have the same problem. I am wondering have you solved the problem already?
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-pro
OOhhh I am sorry I didnt notice the return before the function. Everything
works.
Thank you :)
Best regards.
--
View this message in context:
http://r.789695.n4.nabble.com/foreach-returns-null-first-object-in-the-list-tp4676303p4676344.html
Sent from the R help mailing list archive at Nabble.c
Yes, you are right... the other is definitely not a valid query.
thanks
On Tue, Sep 17, 2013 at 11:22 AM, Jeff Newmiller
wrote:
>
> id <- c("21328","78789D")
>>
>> query <- paste(paste("select * from tbl_user where student_id = ",
>>
> id,sep=""), " order by date_time", sep="")
>
>> query
>>
>
id <- c("21328","78789D")
query <- paste(paste("select * from tbl_user where student_id = ",
id,sep=""), " order by date_time", sep="")
query
[1] "select * from tbl_user where student_id = 21328 order by date_time"
[2] "select * from tbl_user where student_id = 78789D order by date_time"
No
Hi
I have a dataframe Df1
dput(Df1)
structure(list(Mat = c(141, 141, 157, 157, 188, 188, 232, 232,
253, 253, 253, 254, 254, 254, 254, 256, 256, 264, 264), Prenom =
c("Pierre",
"Pierre", "Jean-Claude", "Jean-Claude", "Jean-Louis", "Jean-Louis",
"Philippe", "Philippe", "Christophe", "Christophe",
Hi,
when I generate query using sqldf library, like this:
query = paste(paste("select * from tbl_user where student_id = ", id,
sep=""), " order by date_time", sep="")
student <- sqldf(query)
everything works fine in case the id is "21328", "82882", or something like
that. But, w
This is the output with the debugging message. I don't really understand what
is the problem.
> post.ls <- foreach(i =1:2, .verbose=T) %dopar% {
+
+ fun <- func.list[[i]]
+ if(i==1){fun(Xa,Sa)}
+ if(i==2){fun(Ta,Sa)}
+
+ }
numValues: 2, numResu
Thanks William,
actually, the combination that works is:
with(list(id=c("1234","abcd")), paste(paste("select * from tbl_user where
student_id = '78789D'", sep=""), " order by date_time", sep=""), maybe I
should try to replace double quotes with single (opposite of what I was
doing...)
On Tue, Se
As far as I know, RNetCDF does not support version 4 format netcdf files,
while ncdf4 (which is the current version and should be used in preference
to ncdf) does.
They also differ philosophically. RNetCDF is closer to being a
straightforward implementation of the C language interface to the netcd
Maybe you should escape the single quotes something like " ' " id " ' "?
On Sep 17, 2013, at 6:03 PM, srecko joksimovic
wrote:
> Hi,
>
> when I generate query using sqldf library, like this:
> query = paste(paste("select * from tbl_user where student_id = ", id,
>sep=""), " ord
-- Forwarded message --
From: Ahmed Attia
Date: Tue, Sep 17, 2013 at 11:17 AM
Subject: axis lab font in r
To: r-help-requ...@r-project.org
I have an a question about the axis lab font in r. I use font.lab, but
r changes the font of x axis lab only. How I can change the font of y
Use an extra call to 'return()' as posted below.
On Sep 17, 2013, at 5:55 PM, pakoun wrote:
> This is the output with the debugging message. I don't really understand what
> is the problem.
>
>> post.ls <- foreach(i =1:2, .verbose=T) %dopar% {
> +
> + fun <- func.list[[i]]
> +
Look at the query strings your code produces:
> with(list(id=c("1234","abcd")), paste(paste("select * from tbl_user where
> student_id = ", id,
sep=""), " order by date_time", sep="")
)
[1] "select * from tbl_user where student_id = 1234 order by date_time"
[2] "select * from
Dear package authors, dear r-help list,
are there any big differences between the ncdf and the RNetCDF package,
especially with regards to the support of different netcdf versions,
future maintenacne or speed? I have looked at both packages and their
capabilities seem to be quiet identical (w
Thanks a lot. It works great now!
Cc: R help
Sent: Friday, September 13, 2013 11:46 PM
Subject: Re: [R] problem with grep under loop
Hi,
dat1<- read.table("gao.txt",sep="",header=FALSE,stringsAsFactors=FALSE)
dat1
# V1 V2 V3
Have a look at
?draw.key
I have not got any code at hand as it is too late
Regards
Duncan
Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mac...@northnet.com.au
-Original Message-
From: r-help-boun...@r-project.org [mailto
?sweep() would be a bit slower compared to other two methods.
b1<-do.call(rbind,replicate(1e6,b,simplify=FALSE))
system.time(res1<- t(a*t(b1)))
# user system elapsed
# 0.044 0.000 0.044
system.time(res2<- sweep(b1,2,a,"*"))
# user system elapsed
# 0.14 0.00 0.14
system
On 09/17/2013 07:49 PM, palad...@trustindata.de wrote:
Hello,
I have got a data frame looking like this:
Country Sectorm-value
USA Banks 38.5
USA Media 17
USA hospitals 2.3
Germany Banks 56
Germany real estate 1
Italy Banks 34
Italy Media 23
Italy real estate 78
Italy Beverage 23
.
Use an extra call to return:
post.ls <- foreach(i =1:2, .verbose = TRUE) %dopar% {
fun <- func.list[[i]]
if (i == 1) return(fun(Xa, Sa))
if (i == 2) return(fun(Ta, Sa))
}
Best
Simon
On Sep 17, 2013, at 11:55 AM, pakoun wrote:
> Dear all,
>
>
On 13-09-17 8:15 AM, Milan Bouchet-Valat wrote:
Le lundi 16 septembre 2013 à 20:04 +0400, Maxim Linchits a écrit :
Here is that old post:
http://r.789695.n4.nabble.com/read-csv-and-FileEncoding-in-Windows-version-of-R-2-13-0-td3567177.html
A taste: "Again, the issue is that opening this UTF-8 e
On 13-09-17 8:06 AM, meng wrote:
Hi all:
I met a question about "lines".
attach(cars)
plot(dist ~ speed)
#add the regression line to the plot
lines(fitted(lm(dist~speed)) ~ speed)
plot(dist ~ speed)
#what kind of curve does the following command add to the plot?
lines(fitted(lm(dist~speed))
Dear
meng,
Re:
> Hi all:
> I met a question about "lines".
>
>
> attach(cars)
>
>
> plot(dist ~ speed)
> #add the regression line to the plot
> lines(fitted(lm(dist~speed)) ~ speed)
>
>
> plot(dist ~ speed)
> #what kind of curve does the following command add to the plot?
> lines(fitted(lm
Hi all:
I met a question about "lines".
attach(cars)
plot(dist ~ speed)
#add the regression line to the plot
lines(fitted(lm(dist~speed)) ~ speed)
plot(dist ~ speed)
#what kind of curve does the following command add to the plot?
lines(fitted(lm(dist~speed)))
My question is :
what kind of c
Dear listers
I am using a system() call to my machine (OSX 10.8, R 3.0.1. 32GB memory
available):
system(paste("awk 'NR==2'", file.genepop), intern = TRUE)
and when processing big files, getting numerous helpful error messages
system(paste("awk 'NR==2'", file.genepop), intern = TRUE, ... :
Andrea,
The argument na.action controls how missings are treated. is this what
you wanted?
aggregate(cbind(IND, DUM)~.,data=net1,sum, na.action=na.pass)
Dave
>Date: Mon, 16 Sep 2013 11:42:07 -0400
>From: Andrea Goijman
>To: arun
>Cc: R help
>Subject: Re: [R] Aggregate rows with same fields,
Dear all,
I am sending you a copy of a demo that i am trying to make that work and
embedded in a more complicated structure. The problem is that i want to get
a list of 2 objects (matrices in specific, and thats why i am not specifing
a .combine argument if i am not wrong..), but the first element
Hello,
I have got a data frame looking like this:
Country Sector m-value
USA Banks 38.5
USA Media 17
USA hospitals 2.3
Germany Banks 56
Germany real estate 1
ItalyBanks 34
ItalyMedia
hello all
I am really confusing that how predict(,type = "terms",) gets the desired
result. For example,
sample <- matrix(nrow = 10, ncol = 2)
colnames(sample) <- c("y","x")
sample[,1] <- c(rep(1,times = 5), rep(0,times = 5))
sample[,2] <- c(1,1,0,1,1,0,1,0,0,1)
sample <- as.data.frame(samp
Dear all,
I will express my opinion without knowing the details of the posts John would
like to be removed.
In the current state, people posting on this and other servers have no clear
way to go when trying to remove their posts.
It is a likely event that the number of people attempting the rem
Le lundi 16 septembre 2013 à 20:04 +0400, Maxim Linchits a écrit :
> Here is that old post:
> http://r.789695.n4.nabble.com/read-csv-and-FileEncoding-in-Windows-version-of-R-2-13-0-td3567177.html
>
> A taste: "Again, the issue is that opening this UTF-8 encoded file
> under R 2.13.0 yields an erro
On 17-09-2013, at 12:41, Berend Hasselman wrote:
>
> On 17-09-2013, at 12:15, gildororo...@mail-on.us wrote:
>
>> I can do this:
>>
>>> 1:10 %in% c(3, 5, 6, 10)
>> [1] FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE
>>
>> but what I wish to get is:
>>
>> [1] 3 2 1 4
>>
>> let m
Quoting "PIKAL Petr" :
diff(c(0,which(1:10 %in% c(3, 5, 6, 10
[1] 3 2 1 4
That solves the problem! Thanks.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org
Hi
I am not sure if my solution is general enough
diff(c(0,which(1:10 %in% c(3, 5, 6, 10
[1] 3 2 1 4
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of gildororo...@mail-on.us
> Sent: Tuesday, September 17, 2
I believe you want to use 'diff' and 'which' as in:
> diff(which(c(TRUE, 1:10 %in% c(3, 5, 6, 10) )))
[1] 3 2 1 4
Pat
On 17/09/2013 11:15, gildororo...@mail-on.us wrote:
I can do this:
1:10 %in% c(3, 5, 6, 10)
[1] FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE
but what I wi
On 17-09-2013, at 12:15, gildororo...@mail-on.us wrote:
> I can do this:
>
>> 1:10 %in% c(3, 5, 6, 10)
> [1] FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE
>
> but what I wish to get is:
>
> [1] 3 2 1 4
>
> let me explain:
>
> 3 # [1:3] ends with TRUE, i.e. FALSE FALSE TRUE
> 2
I can do this:
1:10 %in% c(3, 5, 6, 10)
[1] FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE
but what I wish to get is:
[1] 3 2 1 4
let me explain:
3 # [1:3] ends with TRUE, i.e. FALSE FALSE TRUE
2 # [4:5] ends with TRUE, i.e. FALSE TRUE
1 # [6:6] ends with TRUE, i.e. TRUE
4 #
To you have an explanation to this operation ? I don't understand why it is
working !
Thank you !
Edouard Hardy
On Tue, Sep 17, 2013 at 8:47 AM, Edouard Hardy wrote:
> Thank you so much. This is perfect.
>
>
> Edouard Hardy
>
>
> On Tue, Sep 17, 2013 at 5:38 AM, Pascal Oettli wrote:
>
>> Hell
In the bash shell we can use PROMPT_COMMAND="history -a" to tell bash to
always append the last command to the history file. It will do this with
every command so that if bash crashes or an ssh connection is lost, the
command history will still be available in the history file.
With R, I see
I have now resorted to installing a full X server on the server and run a
screen there (i.e. log in a user automatically), whenever the server
restarts. Then I can set DISPLAY=:0 before starting R. Not the most elegant
solution but it works. Apart from Xvfb not working, I could also not find a
VNC
Thank you so much. This is perfect.
Edouard Hardy
On Tue, Sep 17, 2013 at 5:38 AM, Pascal Oettli wrote:
> Hello,
>
> To complete Arun's response, you also have:
>
> > sweep(b,2,a,'*')
> [,1] [,2]
> [1,]18
> [2,]2 10
> [3,]3 12
>
> or
>
> > b %*% diag(a)
> [,1] [
I would like to thank David for letting me publish this and discuss it openly.
I must acknowledge from the answers that I received to my post, that the
administrators of this list are doing what seems to be fair to me: what most
people demand or understand that is right.
However I don't share yo
81 matches
Mail list logo