Re: [R] Save printed/plotted output to different directory

2018-09-12 Thread Rich Shepard
On Thu, 13 Sep 2018, Jim Lemon wrote: Sometimes an empty image is due to not closing the image file. If you forgot to put: dev.off() after the plotting commands, or there was an error in the plotting commands, the file may be left open. Try manually entering "dev.off()" after you have run the

Re: [R] Save printed/plotted output to different directory

2018-09-12 Thread Jim Lemon
Hi Rich, Sometimes an empty image is due to not closing the image file. If you forgot to put: dev.off() after the plotting commands, or there was an error in the plotting commands, the file may be left open. Try manually entering "dev.off()" after you have run the code. If you don't get an error:

Re: [R] Install R into mac

2018-09-12 Thread Jeffrey Hunter
Hi, What type of issues is your student running into? Please review the following video install. https://medium.com/@GalarnykMichael/install-r-and-rstudio-on-mac-e911606ce4f4 Thanks, Jeff Jeffrey M. Hunter Senior

Re: [R] YAML for bookdown

2018-09-12 Thread Duncan Murdoch
On 12/09/2018 5:14 PM, Charles Geyer wrote: Does anyone know where I can look up all the possible things that can be set in the YAML for bookdown? Is this documented anywhere? The bookdown book (https://bookdown.org/yihui/bookdown/) just provides a few example things. Is the only thing to do R

[R] YAML for bookdown

2018-09-12 Thread Charles Geyer
Does anyone know where I can look up all the possible things that can be set in the YAML for bookdown? Is this documented anywhere? The bookdown book (https://bookdown.org/yihui/bookdown/) just provides a few example things. Is the only thing to do RTFS? Really customizing this seems hard. --

[R] How to insert a name from a list into a double loop

2018-09-12 Thread Giuseppa Cefalu
Hello, The script below works well when I define the elementname <- list("name1", "name2", "name3") . Please see program below. SCRIPT ``` glyCount1 <- function(answer = NULL, fileChoice = NULL, combination = NULL, enteredValue = NULL, nameList) { lc <- enteredValue choseDataFiles = TRUE first_

Re: [R] select and hold missing

2018-09-12 Thread Bert Gunter
"Why it is setting all row values NA?" Because the row index is NA. e.g. > z <- data.frame(a=letters[1:3],b = 1:3); x <- c(TRUE,NA,FALSE) > z[x,] a b 1 a 1 NA NA Change your logical comparison to (using with() to simplify entry): > dfc[with(dfc, diff > 0 & diff < 100 | is.na(diff)

[R] select and hold missing

2018-09-12 Thread Val
I have a data dfc <- read.table( text= 'week v1 v2 w1 11 11 w1 .42 w1 31 32 w2 31 52 w2 41 . w3 51 82 w2 11 22 w3 11 12 w4 21 202 w1 31 72 w2 71 52', header = TRUE, as.is = TRUE, na.strings=c("",".","NA") ) I want to create this new variable diff = v2

[R] Correcting dates in research records using R - 2 attempt

2018-09-12 Thread Nicola Cecchino
Hi, I apologize - sent the first time around accidentally as HTML and not text. Thanks to the responder for pointing this out and providing some feed back too. I'm not that well versed with R - I'm trying to correct the dates of service in a de-identified research medical record of several subje

Re: [R] Save printed/plotted output to different directory

2018-09-12 Thread Jeff Newmiller
Yes. I do it all the time. On September 12, 2018 9:26:41 AM PDT, Bert Gunter wrote: >Don't post. Try it and see. > >-- Bert > > >On Wed, Sep 12, 2018 at 9:21 AM Rich Shepard >wrote: >> >>I run analyses in one directory and keep images and textual output >in >> other directories. My test inv

Re: [R] Install R into mac

2018-09-12 Thread Jeff Newmiller
Also read the CRAN download web page which says 10.10.5 is too old for current supported versions of R. Could try an archived version or, better yet, upgrade the OS. On September 12, 2018 9:25:11 AM PDT, Bert Gunter wrote: >You have given insufficient information for useful help. R installs >(

Re: [R] Save printed/plotted output to different directory

2018-09-12 Thread Bert Gunter
Insufficient info to diagnose. No code for what you did. -- Bert On Wed, Sep 12, 2018 at 9:43 AM Rich Shepard wrote: > > On Wed, 12 Sep 2018, Bert Gunter wrote: > > > Don't post. Try it and see. > > Bert, > >Tried using both $HOME and the full path without success and wondered if > there wa

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

2018-09-12 Thread Bill Poling
Hi I have this df with three columns ProviderState, ProviderStateCode, ProviderRegion I have reviewed fiftystater pkg and map pkg but not sure how to simply take these three columns and plot a simple 5 color map based on the Region the state is in? Do I need all the longitude and latitude data

Re: [R] Save printed/plotted output to different directory [ANSWERED]

2018-09-12 Thread Rich Shepard
On Wed, 12 Sep 2018, Rich Shepard wrote: Tried using both $HOME and the full path without success and wondered if there was a way to direct output to a different directory that hadn't occurred to me. Found the glitch. Now it works using relative paths. Rich

Re: [R] Save printed/plotted output to different directory

2018-09-12 Thread Bert Gunter
Don't post. Try it and see. -- Bert On Wed, Sep 12, 2018 at 9:21 AM Rich Shepard wrote: > >I run analyses in one directory and keep images and textual output in > other directories. My test involving a pdf output specifying an output > directory relative to the cwd produced a blank image. T

Re: [R] Save printed/plotted output to different directory

2018-09-12 Thread Rich Shepard
On Wed, 12 Sep 2018, Bert Gunter wrote: Don't post. Try it and see. Bert, Tried using both $HOME and the full path without success and wondered if there was a way to direct output to a different directory that hadn't occurred to me. Rich __ R-he

Re: [R] Install R into mac

2018-09-12 Thread Bert Gunter
You have given insufficient information for useful help. R installs (from the Mac binary) without difficulty on my Mac. Have your student post with sufficient details to the r-sig-mac list. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking t

[R] Save printed/plotted output to different directory

2018-09-12 Thread Rich Shepard
I run analyses in one directory and keep images and textual output in other directories. My test involving a pdf output specifying an output directory relative to the cwd produced a blank image. The command was like this: pdf('../images/filename.pdf') Will R accept an absolute path to an outp

[R] Install R into mac

2018-09-12 Thread AbouEl-Makarim Aboueissa
Dear All: One of my students has mac software OS X Yosemite, Version 10.10.5. He could not install R into his mac laptop. I am not familiar with mac at all. Any help will be appreciated. with thanks abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor of Statistics* *Gradua

Re: [R] Obtaining exact pattern in list.files()

2018-09-12 Thread Jeff Newmiller
Study regular expressions via ?regex or any of the many websites you can find with a search engine. With no special characters, your search pattern matches anywhere in the string. Start your study by learning about the ^ and $ characters. On September 12, 2018 4:53:09 AM PDT, Christofer Bogaso

Re: [R] Obtaining exact pattern in list.files()

2018-09-12 Thread Ista Zahn
pattern = "^File$" Best, Ista On Wed, Sep 12, 2018 at 7:53 AM Christofer Bogaso wrote: > > Hi, > > In the list.files() function, there is an argument 'pattern' to locate the > desired files. However I failed to see if I can manage to fetch those files > that having an exact match. > > For example

[R] Obtaining exact pattern in list.files()

2018-09-12 Thread Christofer Bogaso
Hi, In the list.files() function, there is an argument 'pattern' to locate the desired files. However I failed to see if I can manage to fetch those files that having an exact match. For example, if there are 2 files that contain the expression 'File' and 'Second_File', then I should get the 1st

Re: [R] customise tick marks

2018-09-12 Thread Jim Lemon
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, scales=list(y=list(labels=sort(unique(mtcars$cyl, main="Gas Milage for Car Models", xlab="Miles Per Gallon") Jim On Wed, Sep 12, 2018 at 4

Re: [R] how to plot gridded data

2018-09-12 Thread PIKAL Petr
Hi 1. Read files/lines into R ?read.table, ?read.lines 2. Merge files according to your specification ?merge, ?rbind 3. Plot values by suitable command(s) ?plot, ?ggplot 4. If you want more specific answer, please post more specific question, preferably with concise and clear example. 5. Avoid po