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

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] 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

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 |

[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 =

[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

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

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

[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

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.

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 __

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

[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

[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*

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

Re: [R-es] Crear columna en data frame agregando otra y fusionando

2018-09-12 Thread Carlos Ortega
Hola Miriam, df <- data.table(df) df[,.(Nueva=mean(Word.count, na.rm = TRUE)) , by=c("Product.id")] df_out <- as.data.frame(df) Cuando creas "Nueva" en la sentencia anterior, aparece en el dataframe agregada y diferente cada grupo "Product.id". Es una de las ventajas de "data.table". En tu

Re: [R-es] Crear columna en data frame agregando otra y fusionando

2018-09-12 Thread Miriam Alzate
No es lo que busco..La idea es crear una variable nueva, por ejemplo "Nueva", que sea la media de "Wordcount" agregada por "Product.Id". Pero quiero que esta variable se a�ada a mi base de datos fusionandose directamente por "Product.Id". Al hacerlo me da este error:

[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

[R-es] Crear columna en data frame agregando otra y fusionando

2018-09-12 Thread Miriam Alzate
Buenas, Necesito crear una variable que viene de agregar otra por la media. El dataframe tiene 65000 obsrvaciones.Tengo estas variables Product.Id (145 diferentes) Word.Count Review.number Necesito agregar la variable Word.Count por Product.Id. Al agregarlo, tengo un data.frame de 2

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

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

[R] how to plot gridded data

2018-09-12 Thread lily li
Hi R users, I have a question about plotting gridded data. I have the files separately, but do not know how to combine them. For example, each txt file has daily precipitation data at a specific grid cell, named pr_lat_lon.txt. How to plot all txt files for one surface (which is rectangular in

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

2018-09-12 Thread PIKAL Petr
Hi First of all you should not use HTML formated posts, it is big chance that it gets scrambled. You should compare your ld2 after for cycle and result of clinicVdate[Id2, 'VisitDate'], sep=':') Most probably ld2 after for cycle does not conform to row names of clinicVdate. Cheers Petr >

[R] customise tick marks

2018-09-12 Thread roslinazairimah zakaria
Dear r-users, I want to draw dotplot for mtcars data according to cyl. There are three types of cylinder 4,6,8. However when we draw it does not use 4,6,8 instead label it as 1,2,3. I have this code and would like to customise the tick mark according to cyl groups: dotplot(cyl ~ mpg, data =