Hi, Dear R expert,
I am using:
OS: Linux VM (RedHat 6.2)
R: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i686-redhat-linux-gnu (32-bit)
I try to install package "gam" by install.packages("gam",
lib="/usr/qxiao") and g
Thanks for the reply, this is actually not a homework question but a question
on a past paper. I am doing exam prep, is this allowed?
--
View this message in context:
http://r.789695.n4.nabble.com/Customise-a-symbol-in-a-scatterplot-with-for-loop-tp4687386p4687389.html
Sent from the R help mai
Thank you Jim, unfortunately I have tried so many variations at this stage
and still cannot do it. I am unable to make a list of the coordinates for
each of my polygons. I have made lots of different shapes! It is just exam
prep, so hopefully nothing like this will be on my exam.
Best
A
--
V
Hi,
I am using the following dataset and fitting a 4 parameter logistical curve
using drm. However, there is no p value returned for any of the fitted
coefficients and a warning message of NaNs produced is returned. I tried using
both LL.4 and LL2.4. What does the warning message imply? The dat
He wants a[1] b[1] a[2] b[2] a[3] b[3]
I think you can do:
x = as.vector(rbind(a, b))
On Mon, Mar 24, 2014 at 2:39 PM, Frans Marcelissen <
fransiepansiekever...@gmail.com> wrote:
> Why not simply
>
> > a<-1:3
> > b<-4:5
> > c(a,b)
> [1] 1 2 3 4 5
>
>
> 2014-03-22 23:22 GMT+01:00 Tham Tran :
>
Hi Eliza
I think this comes close to what you want (escaping manual work).
library("maps")
library("sp") ## has a point.in.polygon function
ireland <- map("world", "ireland")
map.axes()
xr <- range(ireland$x, na.rm = TRUE)
yr <- range(ireland$y, na.rm = TRUE)
xseq <- seq(xr[1], xr[2], by = 0.1
Dear Stephen,
Thank you for your suggestion - I will give it a try. It looks like going
in the right direction with the by() function, but your assumption about
the successive observations is incorrect:
I want "all the date differences between successive observations of each
separate user.²
So I
On Mar 22, 2014, at 3:22 PM, Tham Tran wrote:
> Dear R users,
>
> Given two vectors x and y
> a=1 2 3
> b=4 5 6
>
> i want to combine them into a single vector z as 1 4 2 5 3 6
>
> Thanks for your help
Searching Stackoverflow for [r] interleave produced this idea fron @Arun, which
I think i
On 23/03/2014 22:49, qingqing.x...@rriny.com wrote:
Hi, Dear R expert,
I am using:
OS: Linux VM (RedHat 6.2)
R: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i686-redhat-linux-gnu (32-bit)
I try to install package "gam"
On 2014-03-24 07:22, David Winsemius wrote:
On Mar 23, 2014, at 9:14 PM, Lucy Leigh wrote:
Hi everyone,
I am currently attempting to simulate some survival data, based on
a Weibull model. I basically need to simulate some survival data so
that I can then test out a program I'm writing, befo
Hi guys
Just to follow up on Ted's comments.
See http://erich.realtimerendering.com/ptinpoly/ for other points in polygon
algorithms. Eric Haines has made some performance evaluation of the methods. I
quote here Eric:
The worst algorithm in the world for testing points is the angle summation
On 2014-03-24 09:34, Göran Broström wrote:
On 2014-03-24 07:22, David Winsemius wrote:
On Mar 23, 2014, at 9:14 PM, Lucy Leigh wrote:
Hi everyone,
I am currently attempting to simulate some survival data, based on
a Weibull model. I basically need to simulate some survival data so
that I c
Dear Roger,
thanks for pointing out
> This will only generate compliant behaviour when rgdal is loaded,
> converting
> +init=epsg:4326 to +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs
> +ellps=WGS84 +towgs84=0,0,0, so that is.projected(spdf) is FALSE
> which was the intention - either
Before plotting to an device, I would like check which
capabilities/properties it has to avoid
warnings such as:
In plot.xy(xy, type, ...) :
semi-transparency is not supported on this device: reported only once per page
--
Witold Eryk Wolski
__
R
I have some code to handle warnings thrown because a device does not
support some features:
bla = tryCatch(
plot(d$ratio,-log10(d$pvals),col="#0033",pch=19,xlab=xlab,
ylab=ylab),
warning=function(bla){dev.off(); return(1)}
)
if(!is.null(bla)){
plot(d$ratio,-log10(d$pval
Hello,
You can check the output of:
R> capabilities(what = NULL)
Regards,
Pascal
On Mon, Mar 24, 2014 at 8:57 PM, Witold E Wolski wrote:
> Before plotting to an device, I would like check which
> capabilities/properties it has to avoid
> warnings such as:
>
> In plot.xy(xy, type, ...) :
> se
Dear R users,
I am learning the OOP programming with R, in particular with reference classes.
If I have a class, e.g.
myclass <- setRefClass(class="myclass", fields=list(x="numeric"));
I know that if I do not want to set any class for x, I can just type
fields=list(x="ANY"). But what if
I want
HI ALL,
I have a package
[[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-project.org/posting-guide.html
and
HI ALL,
I made a package such that when i call the function inside the
package like "rabbit()" , it gives my GUI very well , now
I want to convert this package into a Dynamic link
library(DLL) ,such that I can use it in C# using RDOT NET
pack
Hi,
Try:
DF <- data.frame(Column1= c("{AA}","{BB}"))
DF$Column1 <- with(DF,gsub("[{}]","",Column1))
DF$Column1
#[1] "AA" "BB"
A.K.
Hi All,
I have a scenario, Like I have my output tabel X to be like
Table name : X
Column name : column 1
output
Column1
{AA}
{BB}
I want to remove the
I am trying to write an R script to do pollution routing in world rivers, and
need some help on selecting matrix cell coordinates and applying these to other
matrices of the same dimension.
My data: I have several matrices corresponding to hydrological parameters of
world rivers on a half degre
Hi R-experts,
I have a data.frame that I want to reshape to a certain format so I can use
it in a tool for further analysis.
Basicly I have a very long list with IDs of persons and their codes.
I create a row for every person with 25 of their codes. I a person has more
then 25 codes, I want to ad
Hi,
This would be a lot easier to answer if you provided a small test
dataset using dput(); I have trouble working through code if I have no
idea what the input data looks like.
One thing I did spot is a problem in your indexing:
j is a scalar, so indexing j[2] won't work. Presumably you got the
Dear Frede and Ted,
What an absolutely crackerjack for somebody who was begging for such a
solution. It worked and worked awfully well.
I am grateful!
Eliza
> From: fr...@vestas.com
> To: eliza_bo...@hotmail.com; r-help@r-project.org
> Date: Mon, 24 Mar 2014 08:09:26 +0100
> Subject: RE: [R] point
Hi,
You may try:
library(reshape2)
res <- setNames(melt(as.matrix(df))[,c(3,2)],c("values","ind"))
res2 <- stack(df, check.names = FALSE)
identical(res,res2)
#[1] TRUE
A.K.
Dears R Users,
I have another question on function "stack".
Given a data frame like:
df=data.frame(a=c(3,5),b=c(2,8)
On 24/03/2014 12:16, Pascal Oettli wrote:
Hello,
You can check the output of:
R> capabilities(what = NULL)
You can, but dev.capabilities() will be more useful.
Regards,
Pascal
On Mon, Mar 24, 2014 at 8:57 PM, Witold E Wolski wrote:
Before plotting to an device, I would like check which
To plot a bunch of pentagons I would suggest using the my.symbols and
ms.polygon functions in the TeachingDemos package.
If this is more to learn programming, then you can just loop over an
index of the vectors containing the x and y coordinates (are they in 2
vectors?, 2 columns of a data frame?,
Hi,
Try ?merge() or ?join from library(plyr)
If `dat1` and `dat2` are the datasets:
res <- merge(dat1,dat2,by="Code",all=TRUE)
res[is.na(res)] <- 0
res
# Code Cap04 Cap08
#1 2 120 120
#2 6 75 0
#3 7 220 112
#4 9 0 190
#5 17 4 4
A.K.
Hello,
I need t
Hi,
Given a matrix
set.seed(500)
matrix(round(runif(100,0,1)),
ncol=5,
dimnames=list(Subject=1:20,
Group=c('A','B','C','D','E')))
Is there an easy way to identify which combinations of groups exist,
i.e. subject2 is a member of group 'A+B+D+E' however no one is a member
of
Hi,
In your 'resultData", some observations seems to be omitted.
with(rawData,tapply(codes, PersonID,FUN=function(x) x))$Person3
#[1] 56177 61704 70879 69033 87224 68670 65602 25476 81209 62086 35492 39771
#[13] 14380 43858 53679 78023 43785 69884 12840 54021
resultData[4,]
# PersonId Code1 Code
Has anybody (successfully) tried to deconvolve a seismic signal (time
series in general) using R and package signal? I have the Matlab routines:
[bb,aa] = zp2tf(zero,pole',gain);
[bb,aa] = bilinear(bb,aa,df);
transfer = freqz(bb,aa,f,df);
But the (apparent) equivalents of R produce quite differen
Just to satisfy my curiosity:
> library(microbenchmark)
>
> a <- 1:10
> b <- 101:110
>
> microbenchmark(
+ m1=as.vector( rbind(a,b) ),
+ m2=c( rbind(a,b) ),
+ m3=as.vector( matrix(c(a,b), nrow=2, byrow=TRUE) ),
+ m4={x <- integer(length(a)*2); x[c(TRUE,FALSE)] <- a;
x[c(FALSE,TRUE)] <- b; x},
+ m5
Many thank for all your answers. it has helped me save time
--
View this message in context:
http://r.789695.n4.nabble.com/Merge-two-vectors-into-one-tp4687361p4687447.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.
Dears R Users,
I have another question on function "stack".
Given a data frame like:
df=data.frame(a=c(3,5),b=c(2,8),a=c(9,1),b=c(6,4),check.names=F)
a b a b
3 2 9 6
5 8 1 4
I would like to form a new data frame like:
values ind
1 3 a
2 5 a
3 2 b
4 8 b
Hello,
I need to combine two data sets into one. For example:
Dataset1:
Code Cap04
2120
6 75
7220
17 4
Dataset2:
Code Cap08
2120
7112
9190
17 4
I need the dataset to look like the following where it keeps every unique
'code'
Hi,
May be this helps:
val <- with(mydataset, diff(Lat))
indx <- cumsum(c(TRUE,val!=0 & !is.na(val)))
mydataset$Tr[indx==1]
#[1] 3 5 2 5
sum(mydataset$Tr[indx==1])
#[1] 15
mydataset$Tr[indx<=2]
#[1] 3 5 2 5 6
sum(mydataset[indx==6,-2])
#[1] 12.5
#or
sum(mydataset[indx==rev(unique(indx))[2],-2]
You'll have to do this in two stages. The merge is just a case of
specifying all=TRUE:
data1 <- data.frame(Code=c(2,6,7,17), Cap04=c(120,75,220,4))
data2 <- data.frame(Code=c(2,7,9,17), Cap08=c(120,112,190,4))
data.merge <- merge(data1,data2, all=TRUE)
data.merge
Code Cap04 Cap08
12 120
On 24/03/14 20:09, Frede Aakmann Tøgersen wrote:
:
> ## get ireland map as polygon, only for main island
> ## map.poly not exported so use maps:::map.poly
> ## use exact to leave out Achill Island and only get main island
> ie.polygon <- maps:::map.poly("world", "Ireland", exact = TRUE, as.polygon
On Thu, 20 Mar 2014, Gabor Grothendieck wrote:
Try this:
opar <- par(pin = c(5, 2))
plot(zoo(1:3))
par(opar)
Gabor,
opar <- par(pin = c(5, 2))
plot(s95.z(1:3))
Error in plot(s95.z(1:3)) :
error in evaluating the argument 'x' in selecting a method for function
'plot': Error: could not find
78023, 43785, 69884, 12840, 54021 are listed as PersonID 3 in
rawData, but PersonID 4 in resultData.
Here is another way to get there:
# Split codes by PersonID creating a single vector for each
step1 <- split(rawData$codes, rawData$PersonID)
# Figure out how many lines we need - here 3 lines
maxl
Apologies Greg for asking you more but what is tmp[,1] doing, I've tried
googling it and looking here for it but it's not making sense.
A
--
View this message in context:
http://r.789695.n4.nabble.com/Customise-a-symbol-in-a-scatterplot-with-for-loop-tp4687386p4687470.html
Sent from the R help
Thank you Arun Kirshna. That worked perfectly!
On Mon, Mar 24, 2014 at 2:49 PM, arun kirshna [via R] <
ml-node+s789695n4687459...@n4.nabble.com> wrote:
> Hi,
> Try ?merge() or ?join from library(plyr)
> If `dat1` and `dat2` are the datasets:
> res <- merge(dat1,dat2,by="Code",all=TRUE)
> res[is
Does this help?
set.seed(500)
mtx <- matrix(round(runif(100,0,1)),
ncol=5,
dimnames=list(Subject=1:20,
Group=c('A','B','C','D','E')))
groupCombo <- apply(mtx, 1, function(x){
x <- paste(
names(x)[as.logical(x)],
collapse='+'
);
return(x)
})
as.fa
That works, I added pch="" and let the radius =0.03 and I get exactly what I
wanted. I understand the for loop much better now. Thank you so much for
your help Greg.
I could get all the x values into a list and the y values also but I could
not get them to work in the code that I had. I am rea
The reshape2 package may be what you're looking for:
http://cran.r-project.org/web/packages/reshape2/index.html
install.packages("reshape2")
reshape2::melt(df)
On 2014-03-24 12:02, Tham Tran wrote:
Dears R Users,
I have another question on function "stack".
Given a data frame like:
df=dat
I sent that last email too quickly, the duplicate column names cause a
problem when melting. Transposing the data frame first gets around it:
reshape2::melt(t(df))[c('Var1', 'value')]
Var1 value
1a 3
2b 2
3a 9
4b 6
5a 5
6b 8
7a 1
8b
On Mon, Mar 24, 2014 at 4:30 PM, Rich Shepard wrote:
> On Thu, 20 Mar 2014, Gabor Grothendieck wrote:
>
>> Try this:
>> opar <- par(pin = c(5, 2))
>> plot(zoo(1:3))
>> par(opar)
>
>
> Gabor,
>
>
> opar <- par(pin = c(5, 2))
>>
>> plot(s95.z(1:3))
>
> Error in plot(s95.z(1:3)) :
> error in evalua
On Mon, 24 Mar 2014, Gabor Grothendieck wrote:
In the first case the error message seems pretty clear to me. You
have not invoked but not defined a function called s95.z.
Gabor,
Got it, thanks.
In the second case you are probably not using Microsoft Windows so there
is no windows() funct
On 03/25/2014 01:02 AM, Vermeulen, Lucie wrote:
I am trying to write an R script to do pollution routing in world rivers, and
need some help on selecting matrix cell coordinates and applying these to other
matrices of the same dimension.
My data: I have several matrices corresponding to hydrol
On 03/25/2014 04:50 AM, Tom Wright wrote:
Hi,
Given a matrix
set.seed(500)
matrix(round(runif(100,0,1)),
ncol=5,
dimnames=list(Subject=1:20,
Group=c('A','B','C','D','E')))
Is there an easy way to identify which combinations of groups exist,
i.e. subject2 is a member of gr
Dear Community,
I'm having a particularly nice problem: I need to do a Bayesian
regression based on a mixture of a Gaussian and two half-normal
distributions.
The scale ranges from 0 - 100 and the "modes" of the half-normal
distributions need to be fixed on these values, hence only the varia
On Thu, 20 Mar 2014, Gabor Grothendieck wrote:
opar <- par(pin = c(5, 2))
plot(~ s95.z$Se, main = "something", xlab = "Year", ylab = "Concentration
(mg/L)")
par(opar)
Is there a way to have the ylab value displayed on the plot rather than
x1? Nothing I see in ?plot or ?title suggests it is
On Mon, Mar 24, 2014 at 6:03 PM, Rich Shepard wrote:
> On Thu, 20 Mar 2014, Gabor Grothendieck wrote:
>
>> opar <- par(pin = c(5, 2))
>> plot(~ s95.z$Se, main = "something", xlab = "Year", ylab = "Concentration
>> (mg/L)")
>> par(opar)
>
>
> Is there a way to have the ylab value displayed on the
On Mon, 24 Mar 2014, Gabor Grothendieck wrote:
Please provide this in reproduble form by displaying the output of
dput(head(s95.z))
structure(c(85, 80, 85, NA, 90, 110, 8, 6, 5, NA, 14, 9, NA,
NA, NA, NA, NA, NA, 30, 1214, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, N
Hi,
Not sure I understand it correctly.
If you want to extract the dates with "02*":
Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
Col2<-c("02*", "02", "03", "04")
Col12 <- paste(Col1, Col2)
Col3 <- c("11/02/2008 02*", "11/02/2008 02", "11/02/2008 03", "11/02/2008 04")
Col
Thanks ray, I really appreciate your concern.
Eliza
> Date: Tue, 25 Mar 2014 08:35:15 +1300
> From: ray.brownr...@ecs.vuw.ac.nz
> To: fr...@vestas.com; eliza_bo...@hotmail.com; r-help@r-project.org
> Subject: Re: [R] points with-in boundaries of a map
>
> On 24/03/14 20:09, Frede Aakmann Tøgersen
If you are using the code, that's not really using randomForest directly. I
don't understand the data structure you have (since you did not show anything)
so can't really tell you much. In any case, that warning came from
randomForest() when it is run in regression mode but the response has fe
On Mar 24, 2014, at 9:02 AM, Tham Tran wrote:
> Dears R Users,
>
> I have another question on function "stack".
>
> Given a data frame like:
> df=data.frame(a=c(3,5),b=c(2,8),a=c(9,1),b=c(6,4),check.names=F)
> a b a b
> 3 2 9 6
> 5 8 1 4
>
I did not create your stack function which woul
deal and bnlearn
[[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-project.org/posting-guide.html
and provide commented, minimal,
Hi Soichi,
Could you please share with us exactly how you solved the issue with installing
the package to Mac OSX?
I am running into the same problem but could not figure out what to do…
Thank you very much!
KC
__
R-help@r-project.org mailing list
ht
I'm having a problem working with daylight savings dates in R.
I'm downloading data in two formats.
Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02*
Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
Col1<-c("02*", "02", "03", "04")
Another data set is someth
Please read the Posting Guide. One of the suggestions given there is to provide
a reproducible example... a sample of data is a good start.
You say this is related to daylight savings time in the subject line, but I
don't see how that relates in your description. Perhaps you should provide a
sa
Hi
Perhaps you can find something at
http://cran.r-project.org/web/views/Bayesian.html.
Yours sincerely / Med venlig hilsen
Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling
Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
fr...@vestas.com
http://www.
On Mar 24, 2014, at 3:26 PM, Chun Kuang wrote:
> Hi Soichi,
>
> Could you please share with us exactly how you solved the issue with
> installing the package to Mac OSX?
>
> I am running into the same problem but could not figure out what to do…
Therre is a binary package on CRAN and you have
On Mar 24, 2014, at 3:35 PM, jcrosbie wrote:
> I'm having a problem working with daylight savings dates in R.
>
> I'm downloading data in two formats.
>
> Format One Col 1: a date such as "11/03/2013" col 2: Hour ending = 02*
> Col1<-c("11/02/2008*", "11/02/2008", "11/02/2008", "11/02/2008")
>
65 matches
Mail list logo