[R] Change the position of label when using R package eulerr

2018-09-13 Thread Aimin Yan
I am using eulerr to get venn. My code is like: fit1 <- euler(c("ciLAD" = 785, "LAD" = 565, "nonXL_MEF" = 167, "ciLAD" = 3, "ciLAD_MEF" = 101, "LAD_MEF" = 541, "ciLAD_MEF" = 2),shape = "ellipse") plot(fit1,quantities = TRUE,fill = rainbow(7),lty =

Re: [R] sink() output to another directory

2018-09-13 Thread Peter Langfelder
Apologies if my advice wasn't clear: the file you want to write to goes in the sink() function/command. You can put the file anywhere on your file system, no need to write into current directory and then move the file. The print command is completely unaware of the file you point to in sink().

Re: [R] sink() output to another directory

2018-09-13 Thread Henrik Bengtsson
On Thu, Sep 13, 2018 at 7:12 PM Rich Shepard wrote: > > On Thu, 13 Sep 2018, Henrik Bengtsson wrote: > > >> sink('stat-summaries/estacada-se-precip.txt') > >> print(summary(estacada_se_wx)) > >> sink() > >> > >> while accepting: > >> > >> pdf('../images/rainfall-estacada-se.pdf') > >> > >>

Re: [R] sink() output to another directory

2018-09-13 Thread Jeff Newmiller
It is not possible for the current working directory to begin with "../". That is like saying n=n-1, because once follow the two dots up to the next directory the two dots refer to the next directory up. I don't think anyone in this list understands what is going on for you, so I recommend

Re: [R] Question on Binom.Confint

2018-09-13 Thread Jim Lemon
Hi Fang, Let's assume that you are using the "binom.confint" function in the "binom" package and you have made a spelling mistake or two. This function employs nine methods for estimating the binomial confidence interval. Sadly, none of these is "lrt". The zero condition is discussed in the help

Re: [R] how to plot gridded data

2018-09-13 Thread Bert Gunter
You may wish to consider posting on r-sig-geo, where you may be more likely to find expertise for this sort of thing. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County"

Re: [R] sink() output to another directory

2018-09-13 Thread Rolf Turner
On 09/14/2018 02:12 PM, Rich Shepard wrote: On Thu, 13 Sep 2018, Henrik Bengtsson wrote: sink('stat-summaries/estacada-se-precip.txt') print(summary(estacada_se_wx)) sink() while accepting: pdf('../images/rainfall-estacada-se.pdf')   plot(rain_est_se) dev.off()    Changing the sink() file

Re: [R] sink() output to another directory

2018-09-13 Thread Bert Gunter
I find your "explanation" confusing. You appear to be misusing print(). Please read ?print carefully. You print objects in R, not files. Objects in R do not have "/" in their names (without some trickery). See ?make.names . -- Bert Bert Gunter "The trouble with having an open mind is that

Re: [R] sink() output to another directory

2018-09-13 Thread Peter Langfelder
There is no path in print. The path (file) is set in sink(). Peter On Thu, Sep 13, 2018 at 4:35 PM Rich Shepard wrote: > On Thu, 13 Sep 2018, Peter Langfelder wrote: > > > Remove the / from the print command, it does not belong there. > > Peter, > >So the print() function cannot accept a

Re: [R] how to plot gridded data

2018-09-13 Thread lily li
I think it may be feasible to transform the dataset DF, so that the column names lat_lon can be a surface, where the values locate at each surface. But I don't know how to transform DF. On Fri, Sep 14, 2018 at 10:02 AM, lily li wrote: > Hi Petr, > > I have merged the data using cbind. The

Re: [R] Question on Binom.Confint

2018-09-13 Thread Spencer Graves
On 2018-09-13 20:58, David Winsemius wrote: On Sep 13, 2018, at 1:15 PM, Guo, Fang (Associate) wrote: Hi, I have a question with the function Binom.Confint(x,n,"method"=lrt). For likelihood ratio test, I'd like to ask how you define the upper limit when the frequency of successes is

Re: [R] sink() output to another directory

2018-09-13 Thread Peter Langfelder
For the second time: Rich, there should be no slash in the print() command. Use the form sink("../directory/file") print(summary(foo)) ### no slashes here sink(NULL) Peter On Thu, Sep 13, 2018 at 7:12 PM Rich Shepard wrote: > On Thu, 13 Sep 2018, Henrik Bengtsson wrote: > > >>

Re: [R] how to plot gridded data

2018-09-13 Thread Roy Mendelssohn - NOAA Federal via R-help
Hi Lily: I haven't used it to any extent to give you specifics, but I strongly suggest you look at the package sf, it is designed to do these sorts of things. sf can read in the shapefile, and it has features to covert the dataframe you describe to one of its objects, and to combine

Re: [R] sink() output to another directory

2018-09-13 Thread Rich Shepard
On Thu, 13 Sep 2018, Henrik Bengtsson wrote: sink('stat-summaries/estacada-se-precip.txt') print(summary(estacada_se_wx)) sink() while accepting: pdf('../images/rainfall-estacada-se.pdf') plot(rain_est_se) dev.off() Changing the sink() file to './stat-summaries/estacada-se-precip.txt'

Re: [R] how to plot gridded data

2018-09-13 Thread lily li
Hi Petr, I have merged the data using cbind. The dataset is like this: DF lat1_lon1 lat1_lon2 lat1_lon3 ... lat2_lon1 1.20 1.30 2.11 ... 1.28 1.50 1.81 3.12 ... 2.34 2.41 2.22 1.56 ... 2.50 3.11

Re: [R] Question on Binom.Confint

2018-09-13 Thread Bert Gunter
In what package? Binomial confidence interval functions are in several. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Sep 13, 2018 at 6:38 PM Guo, Fang

Re: [R] [FORGED] Question on Binom.Confint

2018-09-13 Thread Rolf Turner
On 09/14/2018 08:15 AM, Guo, Fang (Associate) wrote: Hi, I have a question with the function Binom.Confint(x,n,"method"=lrt). For likelihood ratio test, I'd like to ask how you define the upper limit when the frequency of successes is zero. Thanks! Point 1: This question is inappropriate

Re: [R] Question on Binom.Confint

2018-09-13 Thread David Winsemius
> On Sep 13, 2018, at 1:15 PM, Guo, Fang (Associate) > wrote: > > Hi, > > I have a question with the function Binom.Confint(x,n,"method"=lrt). For > likelihood ratio test, I'd like to ask how you define the upper limit when > the frequency of successes is zero. Thanks! First you need to

Re: [R] Change the position of label when using R package eulerr

2018-09-13 Thread David Winsemius
> On Sep 13, 2018, at 2:31 PM, Aimin Yan wrote: > > I am using eulerr to get venn. > My code is like: > > fit1 <- euler(c("ciLAD" = 785, "LAD" = 565, "nonXL_MEF" = 167, >"ciLAD" = 3, "ciLAD_MEF" = 101, > "LAD_MEF" = 541, >"ciLAD_MEF" = 2),shape =

[R] Change the position of label when using R package eulerr

2018-09-13 Thread Aimin Yan
I am using eulerr to get venn. My code is like: fit1 <- euler(c("ciLAD" = 785, "LAD" = 565, "nonXL_MEF" = 167, "ciLAD" = 3, "ciLAD_MEF" = 101, "LAD_MEF" = 541, "ciLAD_MEF" = 2),shape = "ellipse") plot(fit1,quantities = TRUE,fill = rainbow(7),lty =

[R] Question on Binom.Confint

2018-09-13 Thread Guo, Fang (Associate)
Hi, I have a question with the function Binom.Confint(x,n,"method"=lrt). For likelihood ratio test, I'd like to ask how you define the upper limit when the frequency of successes is zero. Thanks! Fang Guo Associate CORNERSTONE RESEARCH 699 Boylston Street, 5th Floor Boston, MA 02116-2836

Re: [R] sink() output to another directory

2018-09-13 Thread Henrik Bengtsson
On Thu, Sep 13, 2018 at 6:05 PM Rich Shepard wrote: > > On Thu, 13 Sep 2018, MacQueen, Don wrote: > > > In my experience, any path that can be used at the shell prompt in a > > unix-alike can be used anywhere that R wants a file name. > > Don, > >That's been my experiences, too. > > >

Re: [R] sink() output to another directory

2018-09-13 Thread Rich Shepard
On Thu, 13 Sep 2018, MacQueen, Don wrote: In my experience, any path that can be used at the shell prompt in a unix-alike can be used anywhere that R wants a file name. Don, That's been my experiences, too. Hopefully, that helps... That's why I don't understand why the plot()

Re: [R] ddply (or other suitable solution) question

2018-09-13 Thread Jeff Newmiller
The input example seems explicit enough, but I get confused understanding your desired output. Can you create an example data structure in your global environment "by hand" and use dput to give it to us? On September 13, 2018 12:11:21 PM PDT, Andras Farkas via R-help wrote: >Dear All, > >I

Re: [R] sink() output to another directory

2018-09-13 Thread MacQueen, Don via R-help
In my experience, any path that can be used at the shell prompt in a unix-alike can be used anywhere that R wants a file name. [that is, when running R on a unix-alike system, and when pwd at the shell prompt returns the same value as getwd() in R] Hopefully, that helps... -Don -- Don

Re: [R] sink() output to another directory

2018-09-13 Thread Rich Shepard
On Fri, 14 Sep 2018, Rolf Turner wrote: This is simply incorrect; "./" refers to the current directory but "/" refers to the root directory. Rolf, I was not sufficientl clear. Note that sink("./mung.txt") gives the same result as sink("mung.txt"). I.e. the "./" is redundant. If you

Re: [R] sink() output to another directory

2018-09-13 Thread Rich Shepard
On Thu, 13 Sep 2018, Peter Langfelder wrote: Remove the / from the print command, it does not belong there. Peter, So the print() function cannot accept a relative path to a different directory for its output? This does seem to be the case: source('rainfall-dubois-crk-all.r') Error in

Re: [R] sink() output to another directory

2018-09-13 Thread Rolf Turner
On 09/14/2018 10:49 AM, Rich Shepard wrote: On Thu, 13 Sep 2018, Duncan Murdoch wrote: What did you try?  Prefixing with either ./ or / doesn't make any sense. Duncan,   Using linux (and perhaps other unices) ./ and / refer to the current directory. This is simply incorrect; "./"

Re: [R] sink() output to another directory

2018-09-13 Thread Peter Langfelder
Remove the / from the print command, it does not belong there. sink("../directory/file.txt"); print(summary(foo)) sink(NULL) On Thu, Sep 13, 2018 at 4:03 PM Rich Shepard wrote: > On Thu, 13 Sep 2018, Rich Shepard wrote: > > > sink('example-output.txt') > > print(summary(df)) > > sink() > >

Re: [R] sink() output to another directory

2018-09-13 Thread Rich Shepard
On Thu, 13 Sep 2018, Rich Shepard wrote: sink('example-output.txt') print(summary(df)) sink() Let me expand on this. When the script contains # Open PDF device to save plot pdf('../images/rainfall-estacada-se.pdf') ... plot(rain_est_se) dev.off() the file, rainfall-estacada-se.pdf is

Re: [R] sink() output to another directory

2018-09-13 Thread Rich Shepard
On Thu, 13 Sep 2018, Duncan Murdoch wrote: What did you try? Prefixing with either ./ or / doesn't make any sense. Duncan, Using linux (and perhaps other unices) ./ and / refer to the current directory. My code, to print to the sub-directory (../analyses/stat-summaries/) when the script

Re: [R] sink() output to another directory

2018-09-13 Thread Henrik Bengtsson
On Thu, Sep 13, 2018 at 3:33 PM Rich Shepard wrote: > >Neither ?sink nor ?capture.output indicates how the output file can be > specified to be in a directory other than the cwd. > >When the cwd is ../analyses/ and I want the output to be in > ../analyses/stat-summaries/ how do I write

[R] sink() output to another directory

2018-09-13 Thread Rich Shepard
Neither ?sink nor ?capture.output indicates how the output file can be specified to be in a directory other than the cwd. When the cwd is ../analyses/ and I want the output to be in ../analyses/stat-summaries/ how do I write this? sink('example-output.txt') print(summary(df)) sink()

Re: [R] ddply (or other suitable solution) question

2018-09-13 Thread Bert Gunter
Mod my earlier question, it seems that you just want to replicate all rows within an id if there more than 2 rows. If this is incorrect, ignore the rest of this post. Otherwise... (I assume the data frame is listed in ID order, whatever that is) set.seed(123.456) df

Re: [R] ddply (or other suitable solution) question

2018-09-13 Thread Bert Gunter
What if there is only one read in the id? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Sep 13, 2018 at 12:11 PM Andras Farkas via R-help wrote: > >

Re: [R] ddply (or other suitable solution) question

2018-09-13 Thread Jeremie Juste
Andras Farkas via R-help writes: Hello, set.seed(123.456) df <-data.frame(ID=c(1,1,2,2,2,3,3,3,3,4,4,5,5), read=c(1,1,0,1,1,1,0,0,0,1,0,0,0), int=c(1,1,0,0,0,1,1,0,0,1,1,1,1), z=rnorm(13,1,5), y=rnorm(13,1,5)) May this will suffice? lapply(unique(df$ID),function(x) df[df$ID==x,])

[R] ddply (or other suitable solution) question

2018-09-13 Thread Andras Farkas via R-help
Dear All, I have data frame: set.seed(123.456) df <-data.frame(ID=c(1,1,2,2,2,3,3,3,3,4,4,5,5),                 read=c(1,1,0,1,1,1,0,0,0,1,0,0,0),                 int=c(1,1,0,0,0,1,1,0,0,1,1,1,1),                 z=rnorm(13,1,5),                 y=rnorm(13,1,5)) what I would like to achieve (as

Re: [R] Help with simple Map of US states with predefined regions Version 2

2018-09-13 Thread Bill Poling
Thank you Jeff. Cannot seem to get this to work in the fashion I want it to appear no matter how many websites and packages I investigate. Letting it go for the moment. Always appreciate your advice Sir! WHP From: Jeff Newmiller Sent: Thursday, September 13, 2018 10:29 AM To:

Re: [R] Help with simple Map of US states with predefined regions Version 2

2018-09-13 Thread Jeff Newmiller
Your data appear to be in fixed format, not space-delimited (or delimited by any other special character), so you should use read.fwf to read it in rather that read.table. ?read.fwf In the future you should try to identify where your errors are or your data don't look right and ask focused

[R] Help with simple Map of US states with predefined regions Version 2

2018-09-13 Thread Bill Poling
Hi, I hope someone can help me finalize this please. I am coming close to what I need using variations from two ggplot2 tutorials. This first gives me the map of the US with AK & HI but I cannot figure out how to get my 5 regions colored

Re: [R] Correcting dates in research / medical record using R

2018-09-13 Thread PIKAL Petr
Hi You should send your responses to R helplist, others could offer better/different solutions. I myself am not an expert for regex so if all your files are formated in the same way I would use strsplit. # I read header to test object test<-readLines("clipboard") str(test) chr [1:4] "PATIENT

Re: [R] customise tick marks

2018-09-13 Thread roslinazairimah zakaria
Hi Jim, It works beautifully. Thank you very much for your help. On Wed, Sep 12, 2018 at 5:58 PM Jim Lemon wrote: > Hi Roslinazairimah, > You seem to be using the dotplot function from the lattice package. If so: > > dotplot(cyl ~ mpg, data = mtcars, groups = cyl, cex=1.2, >