Re: [R] OpenAir package help!!
Hi Diana, As far as I can see, polarPlot (openair) does not specify the colors for the labels. One possibility is to redefine the default foreground color and see what happens: par(fg="red") but this will almost certainly change other elements in the plot. Unfortunately the panel.levelplot function in lattice which is called doesn't seem to have an argument for label colors either. I cannot even try to persuade you to use the polar.plot function in the plotrix package as the radial.grid function does not have a label color argument. If you are really desperate for this, it can probably be programmed... Jim On Mon, Jan 11, 2016 at 11:28 PM, DIANA MARGARITA wrote: > Dear all, > > I just wondered if anyone could help me on how to change the color of > labels of a polar coordinate in a polar plot using the openair package of R. > > Kindest regards, > > Diana > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] [Q] It it possible to create the data frame only non-zero data column?
Hello Ulrik, Ashis and Petr Thank you for replying. I'll use dat[dat==0] <- NA. Thanks 2016年1月11日(月) 16:17 PIKAL Petr : > Hi > > as.matrix is rather dangerous, it converts all values to lowest mode > which, if there is text column, is character. > > And if I understand correctly original post was about removing all zero > columns. > > Using plain zero comparison can be dangerous due to possibility of > compensating negative and positive values. > > dat<-data.frame(a=c(-1,0,1), b=c(0,0,0), c=c(0,0,1)) > > dat >a b c > 1 -1 0 0 > 2 0 0 0 > 3 1 0 1 > > colSums(dat)==0 > a b c > TRUE TRUE FALSE > > Remove incorrectly first column too. > > I would proceed with NA substitution, which is safer. > > > dat[dat==0]<-NA > > colSums(is.na(dat))==nrow(dat) > a b c > FALSE TRUE FALSE > > > > And even this can be problematic if values in dat are not integers. > > Cheers > Petr > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ulrik > > Stervbo > > Sent: Friday, January 08, 2016 6:06 PM > > To: Hiroyuki Sato; r-help@r-project.org > > Subject: Re: [R] [Q] It it possible to create the data frame only non- > > zero data column? > > > > Could you use rowsum and select rows larger then 0? > > > > Something like: > > > > result[rowsum(as.matrix(result) > 0, ] > > > > On Fri, 8 Jan 2016 at 18:00 Hiroyuki Sato wrote: > > > > > Hello all. > > > > > > I re-post this question by e-mail. > > > (I posted via google-group. But It's not posted yet.) > > > > > > I'm newbie GNU R. > > > > > > I would like to compare two datas. > > > How to select columns which has non-zero datas?. > > > It it possible to create the data frame only VAL3(non-zero data) > > > column with command? > > > > > > Formatted sample. > > > https://gist.github.com/hiroyuki-sato/cb36584f6cd5845b6c3e > > > > > > sample1.txt > > > > > > ID,VAL1,VAL2,VAL3 > > > ID1,0,2,3 > > > ID2,0,2,3 > > > ID3,0,2,3 > > > > > > real data has 5000 columns. > > > > > > sample2.txt > > > > > > ID,VAL1,VAL2,VAL3 > > > ID1,0,2,3 > > > ID2,0,2,3 > > > ID3,0,2,2 > > > > > > The difference sample1 and sample2 is ID3/VAL3. > > > sample1: 3 > > > sample2: 2 > > > > > > R commands. > > > > > > sample1 <- read.table("sample1.txt",header=T,sep=',') > > > sample2 <- read.table("sample2.txt",header=T,sep=',') > > > > > > result <- sample1[,2:4] - sample2[,2:4] > > > result > > > VAL1 VAL2 VAL3 > > > 1000 > > > 2000 > > > 3001 > > > > > > I would like to create data frame which has non-zero value columns. > > > Could you tell me how to do it? > > > > > > Best regards. > > > > > > -- > > > Hiroyuki Sato. > > > > > > [[alternative HTML version deleted]] > > > > > > __ > > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > > 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, self-contained, reproducible code. > > > > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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, self-contained, reproducible code. > > > Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou > určeny pouze jeho adresátům. > Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě > neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie > vymažte ze svého systému. > Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email > jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat. > Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi > či zpožděním přenosu e-mailu. > > V případě, že je tento e-mail součástí obchodního jednání: > - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření > smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu. > - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; > Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany > příjemce s dodatkem či odchylkou. > - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve > výslovným dosažením shody na všech jejích náležitostech. > - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za > společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn > nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto > emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich > existence je adresátovi či osobě jím zastoupené známá. > > This e-mail and any documents attached to it may be confiden
Re: [R] embedding expression into title in R plot
On 1/11/2016 2:08 PM, William Dunlap wrote: I tend to use bquote, as in x_label <- bquote(bold(species) ~ (italic(N1))) plot(1:10,main=bquote("This is the expression for" ~ .(x_label) * "!")) Thanks -- I thought I'd tried something very close to this in my various attempts, but it would seem, not close enough. I'll give your suggestion a try. It isn't a critical feature/need on my end (since I can live without elements of the title being bold, or italic), but I'm always happier knowing what to do if I *need* do - in future. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] different coloured axis title labels for different axes
On 1/11/2016 1:54 PM, William Dunlap wrote: The following shows how to get different colors for most features of a scatterplot: plot(1:11,log(1:11),ann=FALSE,axes=FALSE,col="pink",pch=16) box(col="gray") title(xlab="X Axis Label", col.lab="light blue") title(ylab="Y Axis Label", col.lab="light green") axis(side=1, at=c(2,3,5,7,11), lab=as.expression(lapply(1:5, function(i)bquote(pi[.(i)]))), col.axis="red", col="orange") axis(side=2, at=log(c(2,3,5,7,11)), lab=as.expression(lapply(1:5, function(i)bquote(lambda[.(i)]))), col.axis="blue", col="green") title(main="Main Title", col.main="magenta", sub="(subtitle)", col.sub="yellow") See help(par) for details. The 'cex' and 'font' parameters have same subtypes as 'col'. Thanks -- very helpful. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] embedding expression into title in R plot
David -- On 1/11/2016 1:01 PM, David Winsemius wrote: On Jan 11, 2016, at 7:59 AM, Evan Cooch wrote: Suppose I've specified that the xlab for a plot is expression(bold(species~(italic(N1 In other words, I want the axis label to be bold, italic 'species (N1)' Now, I want the title for the plot to be have this label embedded in the title. Say, 'This is the plot for Species (N1)'. For a variety of reasons, I've set this up so that the xlab is a global parameter (basically, because the labels are set in a function which when called, generates various plots): x_label <<- expression(bold(species~(italic(N1 So, in the title, I've tried title(main=paste("This is the plot for ",x_label,"nullcline", sep=" ")); but what this does is generate something like 'This is the plot for bold(species~(italic(N1)))' In other words, it pastes the text of the expression into the title, but not what the expression 'evaluates' to. Is there any way around this? You instead need the `bquote` function. The `paste` function will only confuse things. In this particular instance it is embedding the literal as.character result of 'x_label'-value in a character object rather than in an expression-object. Since you have not offered a full example it remains unclear whether you want the words: "species" or "N1" rather than the values of those names. Thanks. I had wondered if bquote was the solution, but wasn't sure. Have followed your suggestion, but for the moment, am having problems getting it to work. I haven't figured out how to get bquote to actually evaulate the expression. Thanks in advance... [[alternative HTML version deleted]] This is a plain text mailing list. Indeed -- forgot to flip the switch on my email client, which defaults to sending both plain text and HTML email. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] Order of factor levels
I left out the example: > set.seed(1) > df <- data.frame(x1 = rpois(1000,4), x2 = rpois(1000,8)) > helper_fun <- function(x) { + cut(x, breaks = unique(quantile(x, seq(0, 1, 1/10), na.rm = TRUE)), + include.lowest = TRUE) + } > df2 <- data.frame(lapply(df, helper_fun)) > lapply(df2, levels) $x1 [1] "[0,2]" "(2,3]" "(3,4]" "(4,5]" "(5,6]" "(6,7]" "(7,14]" $x2 [1] "[1,4]" "(4,5]" "(5,6]" "(6,7]" "(7,8]" "(8,9]" "(9,10]" [8] "(10,12]" "(12,18]" Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jan 11, 2016 at 11:34 AM, William Dunlap wrote: > Don't use vapply() here - use lapply() instead and then leave cut's output > alone. > > vapply() will combine its outputs to create a character matrix and > data.frame will pull apart the character matrix into its columns. Skipping > the matrix intermediary solves > lots of issues. > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Mon, Jan 11, 2016 at 11:24 AM, Guelman, Leo > wrote: > >> Dear list, >> >> What is a better way relative to the one below to keep the order of >> factor levels created from cut()? Notice, I'm simply pasting letters to >> levels before converting to character so to keep the desired order of >> levels. This is not very elegant... I'm converting to character so I can >> call the helper fun with vapply() from the main fun. >> >> Removing this line of code " levels(xc) <- paste(letters[1:nlevels(xc)], >> levels(xc), sep=":")" would result in factor levels that are not ordered >> according to x1. >> >> set.seed(1) >> df <- data.frame(x1 = rnorm(1000), x2 = rnorm(1000)) >> >> main_fun <- function(data) { >> data.frame(vapply(data, helper_fun, character(nrow(df >> } >> >> helper_fun <- function(x) { >> xc <- cut(x, breaks = unique(quantile(x, seq(0, 1, 1/10), na.rm = >> TRUE)), >> include.lowest = TRUE) >> levels(xc) <- paste(letters[1:nlevels(xc)], levels(xc), sep=":") >> as.character(xc) >> >> } >> >> >> res <- main_fun(df) >> levels(res$x1) >> levels(res$x1) >> [1] "a:[-3.01,-1.34]""b:(-1.34,-0.882]" "c:(-0.882,-0.511]" >> "d:(-0.511,-0.296]" "e:(-0.296,-0.0353]" >> [6] "f:(-0.0353,0.245]" "g:(0.245,0.536]""h:(0.536,0.854]" >> "i:(0.854,1.32]" "j:(1.32,3.81]" >> > >> >> Thanks >> Leo. >> >> ___ >> If you received this email in error, please advise the sender (by return >> email or otherwise) immediately. You have consented to receive the attached >> electronically at the above-noted email address; please retain a copy of >> this confirmation for future reference. >> >> Si vous recevez ce courriel par erreur, veuillez en aviser l'expéditeur >> immédiatement, par retour de courriel ou par un autre moyen. Vous avez >> accepté de recevoir le(s) document(s) ci-joint(s) par voie électronique à >> l'adresse courriel indiquée ci-dessus; veuillez conserver une copie de >> cette confirmation pour les fins de reference future. >> >> [[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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, self-contained, reproducible code. > > > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] multiple model selection for vglm models
Hi list, I'm working with vglm (family tobit) models and I need to perform multiple model selection. Something similar to step or stepAIC, is there anything alike? I found that neither step nor stepAIC work for objects of class vglm. Has anybody worked with them and can give a hint on how to select among vglm models? Thanks a lot in advance, Vero [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7
On 11/01/2016 5:39 PM, Wittner, Ben, Ph.D. wrote: The problem discussed below was fixed on my computer with much help from Tom Callaway, of RedHat. My computer has an NVIDIA graphics card and CentOS 7 comes with an open-source driver for NVIDIA graphic cards called nouveau. When I replaced the nouveau driver with a driver from NVIDIA, the problem went away. To see whether your machine has an NVIDIA graphics card, execute the command lspci -v and search in the output for VGA. The top of that block of output will tell you what graphics card you have and the last line of the block will tell you what driver is in use. In my case the top of that block of output was the following: 07:00.0 VGA compatible controller: NVIDIA Corporation G84GL [Quadro FX 370] (rev a1) So I knew I had an NVIDIA graphics card and that the model was Quadro FX 370, which was important when trying to determine which driver to download from http://www.nvidia.com/object/unix.html . After downloading the driver, I was not able to get it installed just using the instructions from the NVIDIA download page. The key for me was to follow the instructions in http://www.dedoimedo.com/computers/centos-7-nvidia.html . Thanks for following up on this. If I get any other similar reports, I'll be able to point them to your message. Duncan Murdoch Good luck! -Ben -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Wittner, Ben, Ph.D. Sent: Friday, January 08, 2016 4:13 PM To: r-help@r-project.org Subject: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7 Hello, As an example, I ran the following code: library("rgl") example(plot3d) rgl.snapshot("test.png") The full plot is visible in the window titled RGL device 1 [Focus], but only a small portion of the upper left part of the plot is visible in test.png (see attached test.png, if the list server attaches it. Otherwise, email me if you like and I'll send it directly to you.) The output of sessionInfo() is as follows: R version 3.2.3 (2015-12-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core) locale: [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C [3] LC_TIME=en_US.utf8LC_COLLATE=en_US.utf8 [5] LC_MONETARY=en_US.utf8LC_MESSAGES=en_US.utf8 [7] LC_PAPER=en_US.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rgl_0.95.1441 loaded via a namespace (and not attached): [1] tools_3.2.3 In addition to the CentOS 7 machine, I have a CentOS 5.3 machine, which has R 3.0.2 and rgl 0.93.996. I tried the code above on it and it captured the full window in the output of rgl.snapshot (i.e., it worked properly). To see whether the difference could be attributed to the CentOS version or the R/rgl version, I put R 3.0.2 with rgl 0.93.996 on the CentOS 7 machine and ran the code above. As with the earlier CentOS 7 run, only a small portion of the plot was visible in the output of rgl.snapshot. So it seems the difference is due to a difference in the CentOS versions and not the R/rgl versions. Thanks in advance for any help. -Ben The information in this e-mail is intended only for the ...{{dropped:11}} __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7
The problem discussed below was fixed on my computer with much help from Tom Callaway, of RedHat. My computer has an NVIDIA graphics card and CentOS 7 comes with an open-source driver for NVIDIA graphic cards called nouveau. When I replaced the nouveau driver with a driver from NVIDIA, the problem went away. To see whether your machine has an NVIDIA graphics card, execute the command lspci -v and search in the output for VGA. The top of that block of output will tell you what graphics card you have and the last line of the block will tell you what driver is in use. In my case the top of that block of output was the following: 07:00.0 VGA compatible controller: NVIDIA Corporation G84GL [Quadro FX 370] (rev a1) So I knew I had an NVIDIA graphics card and that the model was Quadro FX 370, which was important when trying to determine which driver to download from http://www.nvidia.com/object/unix.html . After downloading the driver, I was not able to get it installed just using the instructions from the NVIDIA download page. The key for me was to follow the instructions in http://www.dedoimedo.com/computers/centos-7-nvidia.html . Good luck! -Ben -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Wittner, Ben, Ph.D. Sent: Friday, January 08, 2016 4:13 PM To: r-help@r-project.org Subject: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7 Hello, As an example, I ran the following code: library("rgl") example(plot3d) rgl.snapshot("test.png") The full plot is visible in the window titled RGL device 1 [Focus], but only a small portion of the upper left part of the plot is visible in test.png (see attached test.png, if the list server attaches it. Otherwise, email me if you like and I'll send it directly to you.) The output of sessionInfo() is as follows: R version 3.2.3 (2015-12-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core) locale: [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C [3] LC_TIME=en_US.utf8LC_COLLATE=en_US.utf8 [5] LC_MONETARY=en_US.utf8LC_MESSAGES=en_US.utf8 [7] LC_PAPER=en_US.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rgl_0.95.1441 loaded via a namespace (and not attached): [1] tools_3.2.3 In addition to the CentOS 7 machine, I have a CentOS 5.3 machine, which has R 3.0.2 and rgl 0.93.996. I tried the code above on it and it captured the full window in the output of rgl.snapshot (i.e., it worked properly). To see whether the difference could be attributed to the CentOS version or the R/rgl version, I put R 3.0.2 with rgl 0.93.996 on the CentOS 7 machine and ran the code above. As with the earlier CentOS 7 run, only a small portion of the plot was visible in the output of rgl.snapshot. So it seems the difference is due to a difference in the CentOS versions and not the R/rgl versions. Thanks in advance for any help. -Ben The information in this e-mail is intended only for the ...{{dropped:11}} __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] Order of factor levels
Here's a solution with dplyr my_cut <- function(x){ breaks <- quantile(x, seq(0, 1, by = 0.1)) y <- cut(x, breaks = breaks, include.lowest = TRUE) levels(y) <- paste(head(letters, length(breaks) - 1), levels(y), sep = ": ") return(y) } library(dplyr) mutate_each(df, funs = funs(my_cut)) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2016-01-11 20:34 GMT+01:00 William Dunlap via R-help : > Don't use vapply() here - use lapply() instead and then leave cut's output > alone. > > vapply() will combine its outputs to create a character matrix and > data.frame will pull apart the character matrix into its columns. Skipping > the matrix intermediary solves > lots of issues. > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Mon, Jan 11, 2016 at 11:24 AM, Guelman, Leo > wrote: > > > Dear list, > > > > What is a better way relative to the one below to keep the order of > factor > > levels created from cut()? Notice, I'm simply pasting letters to levels > > before converting to character so to keep the desired order of levels. > This > > is not very elegant... I'm converting to character so I can call the > helper > > fun with vapply() from the main fun. > > > > Removing this line of code " levels(xc) <- paste(letters[1:nlevels(xc)], > > levels(xc), sep=":")" would result in factor levels that are not ordered > > according to x1. > > > > set.seed(1) > > df <- data.frame(x1 = rnorm(1000), x2 = rnorm(1000)) > > > > main_fun <- function(data) { > > data.frame(vapply(data, helper_fun, character(nrow(df > > } > > > > helper_fun <- function(x) { > > xc <- cut(x, breaks = unique(quantile(x, seq(0, 1, 1/10), na.rm = > > TRUE)), > > include.lowest = TRUE) > > levels(xc) <- paste(letters[1:nlevels(xc)], levels(xc), sep=":") > > as.character(xc) > > > > } > > > > > > res <- main_fun(df) > > levels(res$x1) > > levels(res$x1) > > [1] "a:[-3.01,-1.34]""b:(-1.34,-0.882]" "c:(-0.882,-0.511]" > > "d:(-0.511,-0.296]" "e:(-0.296,-0.0353]" > > [6] "f:(-0.0353,0.245]" "g:(0.245,0.536]""h:(0.536,0.854]" > > "i:(0.854,1.32]" "j:(1.32,3.81]" > > > > > > > Thanks > > Leo. > > > > ___ > > If you received this email in error, please advise the sender (by return > > email or otherwise) immediately. You have consented to receive the > attached > > electronically at the above-noted email address; please retain a copy of > > this confirmation for future reference. > > > > Si vous recevez ce courriel par erreur, veuillez en aviser l'expéditeur > > immédiatement, par retour de courriel ou par un autre moyen. Vous avez > > accepté de recevoir le(s) document(s) ci-joint(s) par voie électronique à > > l'adresse courriel indiquée ci-dessus; veuillez conserver une copie de > > cette confirmation pour les fins de reference future. > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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, self-contained, reproducible code. > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] Order of factor levels
Don't use vapply() here - use lapply() instead and then leave cut's output alone. vapply() will combine its outputs to create a character matrix and data.frame will pull apart the character matrix into its columns. Skipping the matrix intermediary solves lots of issues. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jan 11, 2016 at 11:24 AM, Guelman, Leo wrote: > Dear list, > > What is a better way relative to the one below to keep the order of factor > levels created from cut()? Notice, I'm simply pasting letters to levels > before converting to character so to keep the desired order of levels. This > is not very elegant... I'm converting to character so I can call the helper > fun with vapply() from the main fun. > > Removing this line of code " levels(xc) <- paste(letters[1:nlevels(xc)], > levels(xc), sep=":")" would result in factor levels that are not ordered > according to x1. > > set.seed(1) > df <- data.frame(x1 = rnorm(1000), x2 = rnorm(1000)) > > main_fun <- function(data) { > data.frame(vapply(data, helper_fun, character(nrow(df > } > > helper_fun <- function(x) { > xc <- cut(x, breaks = unique(quantile(x, seq(0, 1, 1/10), na.rm = > TRUE)), > include.lowest = TRUE) > levels(xc) <- paste(letters[1:nlevels(xc)], levels(xc), sep=":") > as.character(xc) > > } > > > res <- main_fun(df) > levels(res$x1) > levels(res$x1) > [1] "a:[-3.01,-1.34]""b:(-1.34,-0.882]" "c:(-0.882,-0.511]" > "d:(-0.511,-0.296]" "e:(-0.296,-0.0353]" > [6] "f:(-0.0353,0.245]" "g:(0.245,0.536]""h:(0.536,0.854]" > "i:(0.854,1.32]" "j:(1.32,3.81]" > > > > Thanks > Leo. > > ___ > If you received this email in error, please advise the sender (by return > email or otherwise) immediately. You have consented to receive the attached > electronically at the above-noted email address; please retain a copy of > this confirmation for future reference. > > Si vous recevez ce courriel par erreur, veuillez en aviser l'expéditeur > immédiatement, par retour de courriel ou par un autre moyen. Vous avez > accepté de recevoir le(s) document(s) ci-joint(s) par voie électronique à > l'adresse courriel indiquée ci-dessus; veuillez conserver une copie de > cette confirmation pour les fins de reference future. > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] Order of factor levels
Dear list, What is a better way relative to the one below to keep the order of factor levels created from cut()? Notice, I'm simply pasting letters to levels before converting to character so to keep the desired order of levels. This is not very elegant... I'm converting to character so I can call the helper fun with vapply() from the main fun. Removing this line of code " levels(xc) <- paste(letters[1:nlevels(xc)], levels(xc), sep=":")" would result in factor levels that are not ordered according to x1. set.seed(1) df <- data.frame(x1 = rnorm(1000), x2 = rnorm(1000)) main_fun <- function(data) { data.frame(vapply(data, helper_fun, character(nrow(df } helper_fun <- function(x) { xc <- cut(x, breaks = unique(quantile(x, seq(0, 1, 1/10), na.rm = TRUE)), include.lowest = TRUE) levels(xc) <- paste(letters[1:nlevels(xc)], levels(xc), sep=":") as.character(xc) } res <- main_fun(df) levels(res$x1) levels(res$x1) [1] "a:[-3.01,-1.34]""b:(-1.34,-0.882]" "c:(-0.882,-0.511]" "d:(-0.511,-0.296]" "e:(-0.296,-0.0353]" [6] "f:(-0.0353,0.245]" "g:(0.245,0.536]""h:(0.536,0.854]" "i:(0.854,1.32]" "j:(1.32,3.81]" > Thanks Leo. ___ If you received this email in error, please advise the sender (by return email or otherwise) immediately. You have consented to receive the attached electronically at the above-noted email address; please retain a copy of this confirmation for future reference. Si vous recevez ce courriel par erreur, veuillez en aviser l'expéditeur immédiatement, par retour de courriel ou par un autre moyen. Vous avez accepté de recevoir le(s) document(s) ci-joint(s) par voie électronique à l'adresse courriel indiquée ci-dessus; veuillez conserver une copie de cette confirmation pour les fins de reference future. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] embedding expression into title in R plot
I tend to use bquote, as in x_label <- bquote(bold(species) ~ (italic(N1))) plot(1:10,main=bquote("This is the expression for" ~ .(x_label) * "!")) Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jan 11, 2016 at 7:59 AM, Evan Cooch wrote: > Suppose I've specified that the xlab for a plot is > > expression(bold(species~(italic(N1 > > In other words, I want the axis label to be bold, italic 'species (N1)' > > Now, I want the title for the plot to be have this label embedded in the > title. > > Say, 'This is the plot for Species (N1)'. > > For a variety of reasons, I've set this up so that the xlab is a global > parameter (basically, because the labels are set in a function which > when called, generates various plots): > > x_label <<- expression(bold(species~(italic(N1 > > So, in the title, I've tried > > title(main=paste("This is the plot for ",x_label,"nullcline", sep=" ")); > > but what this does is generate something like > > 'This is the plot for bold(species~(italic(N1)))' > > In other words, it pastes the text of the expression into the title, but > not what the expression 'evaluates' to. > > Is there any way around this? > > Thanks in advance... > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] different coloured axis title labels for different axes
The following shows how to get different colors for most features of a scatterplot: plot(1:11,log(1:11),ann=FALSE,axes=FALSE,col="pink",pch=16) box(col="gray") title(xlab="X Axis Label", col.lab="light blue") title(ylab="Y Axis Label", col.lab="light green") axis(side=1, at=c(2,3,5,7,11), lab=as.expression(lapply(1:5, function(i)bquote(pi[.(i)]))), col.axis="red", col="orange") axis(side=2, at=log(c(2,3,5,7,11)), lab=as.expression(lapply(1:5, function(i)bquote(lambda[.(i)]))), col.axis="blue", col="green") title(main="Main Title", col.main="magenta", sub="(subtitle)", col.sub="yellow") See help(par) for details. The 'cex' and 'font' parameters have same subtypes as 'col'. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Jan 11, 2016 at 7:44 AM, Evan Cooch wrote: > Consider a simple plot of X vs Y. There are elements on the plot that > represent X, or Y, that are presented in different colours (say, blue > for X, red for Y). Rather than use a legend, I would like to have the > title label for the X-axis be in blue, and the title label for the > Y-axis be in red. > > While it is trivial to change the color of the axis title labels for > *both* axes at the same time, I haven't figured out how to trick thing > into generating a blue title label for the X-axis, and a red title label > for the Y- axis (i.e., different colours on different axes). > > I'm sure this is out there on searchable pages, but, I haven't managed > to stumble across the appropriate search phrase(s). > > Pointers to the obvious solution welcomed in advance. > > > Cheers > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] different coloured axis title labels for different axes
> On Jan 11, 2016, at 7:44 AM, Evan Cooch wrote: > > Consider a simple plot of X vs Y. There are elements on the plot that > represent X, or Y, that are presented in different colours (say, blue > for X, red for Y). Rather than use a legend, I would like to have the > title label for the X-axis be in blue, and the title label for the > Y-axis be in red. > > While it is trivial to change the color of the axis title labels for > *both* axes at the same time, I haven't figured out how to trick thing > into generating a blue title label for the X-axis, and a red title label > for the Y- axis (i.e., different colours on different axes). > > I'm sure this is out there on searchable pages, but, I haven't managed > to stumble across the appropriate search phrase(s). Suppress the 'label' production for both x-axis and y-axis "titles" (by assigning them to "") and then use the `title` function (twice) to separately construct your colored labels. I had difficulty learning that the term "label" in hte plot-function documentation referred only to the single valued axis title and not to the multiple numeric or text axis annotations at the tick marks. The word "lable" is used to refer to both sets of values.. > > Pointers to the obvious solution welcomed in advance. > > > Cheers > > [[alternative HTML version deleted]] Plain text. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] embedding expression into title in R plot
> On Jan 11, 2016, at 7:59 AM, Evan Cooch wrote: > > Suppose I've specified that the xlab for a plot is > > expression(bold(species~(italic(N1 > > In other words, I want the axis label to be bold, italic 'species (N1)' > > Now, I want the title for the plot to be have this label embedded in the > title. > > Say, 'This is the plot for Species (N1)'. > > For a variety of reasons, I've set this up so that the xlab is a global > parameter (basically, because the labels are set in a function which > when called, generates various plots): > > x_label <<- expression(bold(species~(italic(N1 > > So, in the title, I've tried > > title(main=paste("This is the plot for ",x_label,"nullcline", sep=" ")); > > but what this does is generate something like > > 'This is the plot for bold(species~(italic(N1)))' > > In other words, it pastes the text of the expression into the title, but > not what the expression 'evaluates' to. > > Is there any way around this? You instead need the `bquote` function. The `paste` function will only confuse things. In this particular instance it is embedding the literal as.character result of 'x_label'-value in a character object rather than in an expression-object. Since you have not offered a full example it remains unclear whether you want the words: "species" or "N1" rather than the values of those names. > > Thanks in advance... > > > [[alternative HTML version deleted]] This is a plain text mailing list. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] different coloured axis title labels for different axes
How about this: plot(0,0,xlab='',ylab='') mtext(side=1,line=3,text='x axis',col=4) mtext(side=2,line=3,text='y axis',col=2) -Dan On Mon, Jan 11, 2016 at 7:44 AM, Evan Cooch wrote: > Consider a simple plot of X vs Y. There are elements on the plot that > represent X, or Y, that are presented in different colours (say, blue > for X, red for Y). Rather than use a legend, I would like to have the > title label for the X-axis be in blue, and the title label for the > Y-axis be in red. > > While it is trivial to change the color of the axis title labels for > *both* axes at the same time, I haven't figured out how to trick thing > into generating a blue title label for the X-axis, and a red title label > for the Y- axis (i.e., different colours on different axes). > > I'm sure this is out there on searchable pages, but, I haven't managed > to stumble across the appropriate search phrase(s). > > Pointers to the obvious solution welcomed in advance. > > > Cheers > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. > -- Dan Dalthorp, PhD USGS Forest and Rangeland Ecosystem Science Center Forest Sciences Lab, Rm 189 3200 SW Jefferson Way Corvallis, OR 97331 ph: 541-750-0953 ddalth...@usgs.gov [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] embedding expression into title in R plot
Suppose I've specified that the xlab for a plot is expression(bold(species~(italic(N1 In other words, I want the axis label to be bold, italic 'species (N1)' Now, I want the title for the plot to be have this label embedded in the title. Say, 'This is the plot for Species (N1)'. For a variety of reasons, I've set this up so that the xlab is a global parameter (basically, because the labels are set in a function which when called, generates various plots): x_label <<- expression(bold(species~(italic(N1 So, in the title, I've tried title(main=paste("This is the plot for ",x_label,"nullcline", sep=" ")); but what this does is generate something like 'This is the plot for bold(species~(italic(N1)))' In other words, it pastes the text of the expression into the title, but not what the expression 'evaluates' to. Is there any way around this? Thanks in advance... [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] different coloured axis title labels for different axes
Consider a simple plot of X vs Y. There are elements on the plot that represent X, or Y, that are presented in different colours (say, blue for X, red for Y). Rather than use a legend, I would like to have the title label for the X-axis be in blue, and the title label for the Y-axis be in red. While it is trivial to change the color of the axis title labels for *both* axes at the same time, I haven't figured out how to trick thing into generating a blue title label for the X-axis, and a red title label for the Y- axis (i.e., different colours on different axes). I'm sure this is out there on searchable pages, but, I haven't managed to stumble across the appropriate search phrase(s). Pointers to the obvious solution welcomed in advance. Cheers [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] OpenAir package help!!
Dear all, I just wondered if anyone could help me on how to change the color of labels of a polar coordinate in a polar plot using the openair package of R. Kindest regards, Diana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7
Dear Duncan, Thanks very much for your reply. I guess I'll start with R-SIG-Fedora. I'll keep you cc'd unless you tell me you would rather I not. -Ben -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Friday, January 08, 2016 8:13 PM To: Wittner, Ben, Ph.D.; r-help@r-project.org Subject: Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7 On 08/01/2016 4:13 PM, Wittner, Ben, Ph.D. wrote: > Hello, > > As an example, I ran the following code: > > library("rgl") > example(plot3d) > rgl.snapshot("test.png") > > The full plot is visible in the window titled RGL device 1 [Focus], > but only a small portion of the upper left part of the plot is visible > in test.png (see attached test.png, if the list server attaches it. > Otherwise, email me if you like and I'll send it directly to you.) > > The output of sessionInfo() is as follows: > > R version 3.2.3 (2015-12-10) > Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 > (Core) > > locale: > [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C > [3] LC_TIME=en_US.utf8LC_COLLATE=en_US.utf8 > [5] LC_MONETARY=en_US.utf8LC_MESSAGES=en_US.utf8 > [7] LC_PAPER=en_US.utf8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] rgl_0.95.1441 > > loaded via a namespace (and not attached): > [1] tools_3.2.3 > > In addition to the CentOS 7 machine, I have a CentOS 5.3 machine, which has R > 3.0.2 and rgl 0.93.996. I tried the code above on it and it captured the full > window in the output of rgl.snapshot (i.e., it worked properly). > > To see whether the difference could be attributed to the CentOS version or > the R/rgl version, I put R 3.0.2 with rgl 0.93.996 on the CentOS 7 machine > and ran the code above. As with the earlier CentOS 7 run, only a small > portion of the plot was visible in the output of rgl.snapshot. So it seems > the difference is due to a difference in the CentOS versions and not the > R/rgl versions. > > Thanks in advance for any help. > I think you'll need to contact CentOS about this. That code hasn't changed in rgl in a long time. It's possible that rgl is wrong, but I'd need more information from them to convince me. Duncan Murdoch The information in this e-mail is intended only for the ...{{dropped:11}} __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] Help request from Ph.D. Students
Try DLM package : dlm: Bayesian and Likelihood Analysis of Dynamic Linear Models M.O On Mon, 2016-01-11 at 13:07 +0100, Franklin Bretschneider wrote: > Dear NECMETTİN ALPAY KOÇAK, > > Re: > > > Dear All, > > I am Ph.D. student in Econometrics. My thesis is about "Linear Filtering on > > a Time Series" which R has already a nice package, namely "Filter". This > > package is really helpful for my study. But, I really help from you to > > create two filter using with "filter" package. > > I want to create two filter desribed in attachment (effects word file) > > using "filter" package. But, I dont know how? > > > > I really need your reply, > > Sincerely, > > > > Alpay KOCAK > > (etc...) > > > I don't know a package called "filter", but a function "filter" is in the > "stats" package > There are however more packages to filter time data. I use "signal", which > also has a "filter" function in addition to functions to design filters > yourself (from simple first-order to higher-order butterworth etc). > This package is intended to filter (electrical) signals, but might be used > for any time series. > In addition, there are several packages for the analysis of seasonal data. > You might search CRAN for the names. > Success and > Best Wishes, > > > Frank > -- > > > > Franklin Bretschneider > Dept of Biology > Utrecht University > brets...@xs4all.nl > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] How to suppress console output when using choose.dir()?
Thank you. Found uninstalling PC bloatware 'Acer Portal' rectified the problem. -Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Sunday, 10 January 2016 6:51 PM To: Rob Grant; r-help@r-project.org Subject: Re: [R] How to suppress console output when using choose.dir()? On 10.01.2016 02:38, Rob Grant wrote: > Hi, > > I am wondering how to suppress console output when using choose.dir() > on Windows 10 with RStudio. > Am getting a log output when using this function. Example: > > ... > 22:07:18.873 INFO > |9824|ccdi_client_protorpc.cpp:413:ccdi::client::CCDIGetSyncState| The > |9824|CCD > process doesn't appear to be running. > 22:07:18.873##ERR##|9824|ACloudToBeSynced.cpp:80:CACloudToBeSynced::Is > Member > Of| CCDIGetSyncState for syncbox fail rv -9055 > ... > This output does not come from R, since we do not have any ACloudToBeSynced.cpp So perhaps from a contributed package or RStudio, in each case you need to talk to the correpsonding maintainer. Best, Uwe Ligges > > Have tried sink(), invisible(), options(echo = FALSE), capture.output(). > None working for me. > > Regards, > > Rob Grant > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, self-contained, reproducible code. > __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] [FORGED] Package "boot" and Bca for %
This question is not for homework... This question is about a real question about population structure with different morphotypes... Thanks. - Mail original - De: "Rolf Turner" À: "msg contact" Envoyé: Lundi 11 Janvier 2016 07:09:21 Objet: Re: [FORGED] [R] Package "boot" and Bca for % On 11/01/16 06:56, Steeve M. via R-help wrote: > > Dear all, > > Beginner with R, I need somme help to write a correct R script using > package "boot" to calculate % and Bca confidence intervals for > percentages to describe a population structure. > > I have the following strucure data set: > > data<-c(A, A, A, A, A, A, B, B, B, B, B, C, C, C, C, C, C, C, C, C) > > where A, B and C are different species. > > I want to calculate robust % of A; % of B and % of C with Bca > confidance intervals using package "boot" and boostraps of the initial > data set. > > Thanks for your help. Homework? This list has a "no homework" policy. cheers, Rolf Turner -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] [R-pkgs] new package: venn
Dear R users, I would like to announce a new package that has just the appeared on CRAN, called "venn" version 1.0: http://cran.r-project.org/web/packages/venn/ (binaries will appear in one or two days) Although there are quite a few packages that draw Venn diagrams, there are a number of reasons for yet another one: - this package draws diagrams up to 7 sets (!) while other packages top at 5 - in addition, this package is also capable to draw any boolean union of set intersections, using different colors (transparency included), using a meta-command - efforts were employed to create these diagrams using base R, without using any dependencies to other graphics oriented packages - there are a variety of input data which are automatically recognised, making the package user friendly - the technology behind this package is completely different from the other Venn diagrams functions, similar to geographical maps where polygons can be constructed on a hierarchical order, the way administrative units belong to superior, higher units. The most impressive diagram to show off is the so-called "Adelaide" for 7 sets, which can be viewed simply with: > venn(7) Comments and suggestions are, as always, welcome. Best wishes, Adrian -- Adrian Dusa University of Bucharest Romanian Social Data Archive Soseaua Panduri nr.90 050663 Bucharest sector 5 Romania [[alternative HTML version deleted]] ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
Re: [R] Help request from Ph.D. Students
Dear NECMETTİN ALPAY KOÇAK, Re: > Dear All, > I am Ph.D. student in Econometrics. My thesis is about "Linear Filtering on a > Time Series" which R has already a nice package, namely "Filter". This > package is really helpful for my study. But, I really help from you to create > two filter using with "filter" package. > I want to create two filter desribed in attachment (effects word file) using > "filter" package. But, I dont know how? > > I really need your reply, > Sincerely, > > Alpay KOCAK > (etc...) I don't know a package called "filter", but a function "filter" is in the "stats" package There are however more packages to filter time data. I use "signal", which also has a "filter" function in addition to functions to design filters yourself (from simple first-order to higher-order butterworth etc). This package is intended to filter (electrical) signals, but might be used for any time series. In addition, there are several packages for the analysis of seasonal data. You might search CRAN for the names. Success and Best Wishes, Frank -- Franklin Bretschneider Dept of Biology Utrecht University brets...@xs4all.nl __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, self-contained, reproducible code.
[R] Propensity score matching with MatchIt
Hello R experts, I am trying to do Propensity score matching for a medical data with two types of surgery. But somehow I am getting Summary of balance for all data and the matched data exactly similar resulting the Percent Balance Improvement as zero. > surgery.data<-read.csv(file.choose(), head = TRUE) > surgery.data Sample Surgerytype Age ASAgrade BMI FIGOstage PreviousAbdoSurgery 1 2 1 411 22.3 3 0 2 4 1 492 19.5 3 0 3 5 1 582 28.8 3 0 4 8 1 341 29.1 3 0 5 9 1 491 25.1 3 0 6 13 1 302 29.0 3 0 7 14 1 311 23.6 3 0 8 15 1 291 33.7 3 2 9 20 1 251 24.6 3 0 10 28 1 281 21.0 3 0 11 29 1 292 21.4 3 0 12 30 1 611 25.2 3 3 13 32 1 481 22.7 3 0 14 33 1 241 26.1 3 3 15 34 1 391 23.7 3 0 16 36 1 392 34.6 3 1 17 37 1 682 27.0 3 0 18 49 1 712 30.8 3 3 19 50 1 732 25.8 3 0 20 54 1 302 23.1 3 0 21 65 1 452 34.6 3 0 22 77 1 411 29.8 3 3 23 82 1 412 33.8 3 0 24 86 1 341 34.7 3 0 25 87 1 282 21.4 3 0 26 88 1 351 25.5 3 2 27 89 1 461 31.9 3 1 28 91 1 482 20.7 3 0 29 92 1 282 22.4 3 2 30 96 1 451 22.7 3 1 31 97 1 392 19.7 3 1 32 98 1 341 27.6 3 2 33101 1 411 22.5 3 0 34107 1 312 31.0 3 0 35113 1 512 33.2 3 0 36114 1 432 22.5 3 2 37 6 0 501 22.9 3 0 38 7 0 432 25.6 3 0 39 11 0 431 23.8 3 2 40 12 0 311 22.0 3 0 41 16 0 311 27.2 3 2 42 17 0 341 19.6 3 0 43 18 0 563 25.2 3 0 44 21 0 391 26.6 3 0 45 25 0 642 24.5 3 0 46 45 0 611 21.9 3 0 47 47 0 641 28.5 3 0 48 53 0 542 26.8 5 0 49 55 0 401 23.1 3 0 50 57 0 461 26.2 3 3 51 59 0 341 21.5 3 0 52 62 0 252 23.8 3 0 53 63 0 562 24.6 3 0 54 64 0 451 24.2 3 0 55 66 0 421 30.4 3 0 56 67 0 492 35.8 2 0 57 69 0 631 24.7 3 0 58 70 0 291 29.7 5 0 59 71 0 391 19.9 3 3 60 73 0 621 28.0 3 0 61 74 0 241 26.7 3 0 62 75 0 702 31.2 3 4 63 76 0 422 23.0 3 0 64 79 0 561 34.9 3 0 65 81 0 401 25.0 3 0 66 83 0 392 29.6 3