Re: [R] RSTAN

2021-06-19 Thread Jeff Newmiller
Off topic. Read the Posting Guide before posting here. You may find a more suitable forum via the Url entry in the rstan description file [1]. [1] https://cran.r-project.org/web/packages/rstan/index.html On June 19, 2021 6:15:04 PM PDT, peri He wrote: >Dear Friends, > >I have started to write

Re: [R] CI job Migration

2021-06-18 Thread Jeff Newmiller
What are you talking about? A contributed package? (You should send an email to the package maintainer.) R Core? (I have never heard of R Core using Travis, but if they are then you would need to post on R-devel mailing list, but you had best read the Posting Guide and figure out how to post

Re: [R] covert categoral data into number

2021-06-13 Thread Jeff Newmiller
factor( DF$numbers , levels=1:4 , labels=c( "bottom", "middle", "high" , "top" ) ) On June 12, 2021 8:24:31 AM PDT, Jxay Ljj wrote: >Hi > >I would like to convert numbers into different categorical levels . For >example, > >In one of column of a dataframe, there are numbers:

Re: [R] most stable way to output text layout

2021-06-12 Thread Jeff Newmiller
Can't say this appeals to me, but sprintf would make a difference: apply( mat,1, function(x) { x[is.na(x)] <-"" cat(paste(sprintf("%16s",x)),"\n") }) On June 12, 2021 9:24:51 AM PDT, Jeremie Juste wrote: >Hello, > >I'm trying to print a razor thin front-end

Re: [R] Merging multiple .csv files into one dataframe

2021-06-09 Thread Jeff Newmiller
Attachments have been stripped by the mailing list. Read the Posting Guide. Also, English can help, but R code can be ever so much more clear in indicating what you have to work with and even what you want out of the broken/missing part of your code.

Re: [R] Need help to fix the max date filter problem in the date input

2021-06-09 Thread Jeff Newmiller
You seem to need to educate yourself as to what "plain text" means, and to read the Posting Guide for this mailing list. Word documents are very definitely NOT plain text. Stop attempting to communicate via formatted text on this mailing list. For security reasons this mailing list removes

Re: [R] Read fst files

2021-06-09 Thread Jeff Newmiller
... but if you are receiving multiple-file zips then you should not be using unz() the way you are in your original post. I have to agree with other responders suggesting that you handle unzipping fst zips manually rather than as part of an R one-liner. On June 9, 2021 11:26:34 AM PDT, Jeff

Re: [R] Directly copying data from RStudio to MS Excel

2021-06-06 Thread Jeff Newmiller
No idea. a) This mailing list is about the R Language, not the RStudio editor. b) I find that the power of R lies in the ability to give it a script of commands and have to loop through many tasks. Copying and pasting is a manual intervention that prevents bulk calculations in most cases. c)

Re: [R] RStudio does not do anything when issued Knit request

2021-06-05 Thread Jeff Newmiller
If you walk into the produce section of a grocery store and start asking people how to fix your car, you may find a mechanic there because mechanics need vegetables also, but that doesn't make that the right approach. Lots of people here use the R language without touching RStudio... this

Re: [R] Conversion of String to Datetime: How to Keep Timezone Offset when Printing?

2021-06-05 Thread Jeff Newmiller
No. Sorry. A POSIXct vector can have only one timezone. Kind of goes along with the whole vectorization thing. You could fake it with lists, but they are dramatically less convenient. I suppose you could also fake it by developing your own variation on the POSIXct class... but that would be

Re: [R] Beginner problem - using mod function to print odd numbers

2021-06-05 Thread Jeff Newmiller
What if you used num <- num + 1 ? On June 2, 2021 11:17:50 AM PDT, nelpar wrote: > >I don't understand. -- > >7%%2=1 >9%%2=1 >11%%2=1 > >What aren't these numbers printing ? > > >num<-0 >for (i in 1:100){ > num<-num+i >if (num%%2 != 0) > print(num) >} > > >[1] 1 >[1] 3 >[1] 15 >[1] 21

Re: [R] replace NA into - for specific column

2021-06-01 Thread Jeff Newmiller
A unary negative sign with no number is not a number, so it has to be character. If you are done with computations you can format your numbers as character data and set the NA to "-", but such a conversion will prevent you from performing computations so it is only useful for creating report

Re: [R] if statement and for loop question

2021-05-30 Thread Jeff Newmiller
Can you make R code that creates an actual sample data frame that looks like you want the answer to look? say, just using the data.frame function and literal strings. Oh, and read the Posting Guide... you need to send your email using plain text format or it may get garbled when the list strips

Re: [R] Error: C stack usage 15924320 is too close to the limit

2021-05-29 Thread Jeff Newmiller
You may need to use smaller data. Anyway, read the Posting Guide, which says for contributed packages to contact the package maintainer ?maintainer On May 28, 2021 11:55:04 AM PDT, Gossaye Hailu wrote: >I am doing phylogenetic analysis of ecological community data set using >Picante package to

Re: [R] R grep question

2021-05-27 Thread Jeff Newmiller
Post in plain text Use grepl On May 26, 2021 9:29:10 PM PDT, Kai Yang via R-help wrote: >Hi List, >I wrote the code to create a new variable: >CRC$MMR.gene<-ifelse(grep("MLH1"|"MSH2",CRC$gene.all,value=T),"Yes","No") >  > >I need to create MMR.gene column in CRC data frame, ifgene.all column

Re: [R] Student request for help in Self Organizing Map (SOM)

2021-05-25 Thread Jeff Newmiller
Well, this mailing list is about the R language itself, not specific packages or background theory. You may get an answer anyway, but you are likely to have better responses on the R-sig-geo mailing list or contacting the author of the contributed package you are using. Also, do figure out how

Re: [R] Pipe precedence

2021-05-22 Thread Jeff Newmiller
Gibbons wrote: >I didn’t know R had a new pipe operator, but I have seen “|>” (without >quotes) used in the Elixir language though. Are there now two? “%>%” >from the magrittr package and “|>” which is built-in? > >> On May 22, 2021, at 5:26 PM, Jeff Newmiller > wrote:

[R] Pipe precedence

2021-05-22 Thread Jeff Newmiller
What is the precedence of the new |> pipe operator? I don't see it mentioned in ?Syntax, nor does it come up when I search the R Language Definition document. -- Sent from my phone. Please excuse my brevity. __ R-help@r-project.org mailing list -- To

Re: [R] Finding strings in a dataset

2021-05-15 Thread Jeff Newmiller
Do look at the mess below that we received, and make an effort not to send HTML email to this list. What you saw when you sent it is not what we see when it gets to us. On May 15, 2021 10:31:22 PM PDT, Tuhin Chakraborty wrote: >Thank you everyone, for the very helpful suggestions. I

Re: [R] calculating area of ellipse

2021-05-11 Thread Jeff Newmiller
The area is a product, not a ratio. There are certainly examples out there of meaningful products of different units, such as distance * force (work) or power " time (work). If you choose to form a ratio with the area as numerator, you could conceivably obtain the numerator with force snd

Re: [R] factor analysis of dynamic structure (FADS) for a huge time-series data

2021-05-08 Thread Jeff Newmiller
This not being a question about R, but rather about statistics, or possibly about a contributed package, means (per the Posting Guide) that you should be asking in a statistics forum like stats.stackexchange.com or corresponding with the author of the package in question. If you are lucky

Re: [R] grep

2021-05-08 Thread Jeff Newmiller
Regular expression patterns are not vectorized... only the data to be searched are. Use one of the many websites dedicated to tutoring regular expressions to learn how they work. (Using function names like "names" as data names is bad practice.) nms <- c( "x1.one", "x1.black", "x1.othrrace",

Re: [R] Transforming data

2021-05-06 Thread Jeff Newmiller
Posting HTML email is a good way to reduce your chances of getting a response. On May 6, 2021 1:13:16 PM PDT, Jeff Reichman wrote: >R-help > >Never mind I figured out a working solution > >- remove duplicate >- mutate a new column == 1 >- spread the data from long to wide >- replace NA with

Re: [R] Question about using R sample datasets

2021-05-02 Thread Jeff Newmiller
You have already been reminded that none of us are lawyers. There is license text associated with every package and base R, and it is not necessarily the same for all parts of R, so there is no way for us to answer your question in its vague form and no way for you to rely our opinions even if

Re: [R] Date Time, as.POSIXct used locale, strange plot behavior

2021-04-29 Thread Jeff Newmiller
What is your TZ environment variable set to? That's what time conversion defaults to ?DateTimeClasses Also, I am not sure CEST is a valid timezone designation... it can be system dependent, but using one of the elements listed in ?OlsonNames. On April 29, 2021 12:22:44 PM PDT, Tilmann Faul

Re: [R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Jeff Newmiller
These are all contributed packages... don't file a bug report on R. Also, tidyverse is a rediculously sprawling meta-package that seems prone to faulty dependency data. If you have a oroblem getting the right version of broom then focus on solving that. One possibility is that your CRAN mirror

Re: [R] ggplot2::geom_path() in a loop problems.

2021-04-24 Thread Jeff Newmiller
Sigh. Don't do this. Setup your data frame with all the data you want to plot and give it to one geom. Use group columns such as factors (e.g. color, size, linetype, etc) to distinguish them. Using multiple geoms with different mappings is usually a recipe for disappointment. It also fails to

Re: [R] R versions > 4.0.2 fail to start in Windows 64-bit

2021-04-20 Thread Jeff Newmiller
Not a problem here. Generally this kind of thing happens when anti-virus software gets aggressive. On April 20, 2021 9:32:52 AM PDT, "N. Jordan Jameson" wrote: >I have a 64-bit Windows machine and I've installed R versions 4.0.0 >through >4.0.5 and only versions 4.0.2 and below will

Re: [R] problems in knitting to html

2021-04-20 Thread Jeff Newmiller
I would encourage you to make _any_ kind of example that _ever_ has had this problem when asking for help on an intermittent error. Also, are you running this in a cloud-backed directory such as OneDrive or Dropbox? These kinds of software can acquire exclusive access to intermediate files in

Re: [R] Installed Packages not working

2021-04-17 Thread Jeff Newmiller
Either upgrade rlang or remove farff and install an older version. On April 17, 2021 12:02:15 PM PDT, Neha gupta wrote: >Hi, suddenly the packages I installed not working. It gives me the >error: > >Error: package or namespace load failed for ‘farff’ in loadNamespace(i, >c(lib.loc, .libPaths()),

Re: [R] Weighted violin chart

2021-04-15 Thread Jeff Newmiller
Not strictly on topic on this list (ggplot2 is a contributed package) but... ggplot(mydata, aes(x=V3, y=V1, weight=V2 )) + geom_violin(trim=FALSE) If you want to refer to variables in the data, they have to be listed in the mapping. On April 15, 2021 7:01:45 AM PDT, Mahmood Naderan-Tahan

Re: [R] Add a new row based on test set predicted values and time stamps

2021-04-13 Thread Jeff Newmiller
The date you get using as.Date on a POSIXct value depends on the timezone. That is, as.Date only pays attention to the underlying UTC seconds-since-epoch value, so it ignores the timezone which can be unexpected for most people. TL;DR as.Date is not the same as as.POSIXct( trunc( dtm,

Re: [R] Identifying column type

2021-04-09 Thread Jeff Newmiller
Does sapply( mydata, inherits, what = "POSIXt" ) give you any ideas? On April 9, 2021 8:25:36 PM PDT, Steven Yen wrote: >I have data of mixed types in a data frame - date and numeric, as shown > >in summary below. How do I identify the column(s) that is/are not >numeric, in this case, the

Re: [R] R Language on Windows 2019

2021-04-07 Thread Jeff Newmiller
There is one volunteer-supported installer for all Windows versions, and it is not built as a Windows Service. I highly doubt that any of those volunteer developers have access to Windows Server 2019... if it doesn't work there interactively then you may need to enable some level of

Re: [R] /usr/local/lib/R/site-library is not writable

2021-04-07 Thread Jeff Newmiller
1. Use a personal library. Mucking with the default library puts you at risk of changing file permissions on your personal files inadvertently and making them unusable by your normal user. Even if you did alter your user permissions so you could mess with it without elevating privileges, POSIX

Re: [R] using MAP and PURR to compute characteristic roots

2021-03-31 Thread Jeff Newmiller
Since purrr:map() is functionally identical to lapply, it is not at all clear to me what you are having trouble with. What output did you want? On March 31, 2021 5:10:29 PM PDT, Veerappa Chetty wrote: >I have to compute characteristic roots for 100s of U.S.counties. I got >help using "

Re: [R] seed problem?

2021-03-29 Thread Jeff Newmiller
Check if you have a .RData file in your R startup directory. It may contain the seed. .RData files (without anything in front of the period) are dangerous... many R users avoid them because they can easily drag in mistakes from previous sessions to plague you. On March 28, 2021 9:02:17 AM

Re: [R] How to average minutes per hour per month in the form of '# hours #minutes'

2021-03-26 Thread Jeff Newmiller
week = format(datum, '%V')) %>% > summarise_if(is.numeric, sum) %>% > mutate(hm=sprintf("%d Hour%s %d Minutes", dauer %/% 60, > ifelse((dauer %/% 60) == 1, " ", "s"), dauer %% 60)) %>% > select(-dauer) > > >

Re: [R] How to average minutes per hour per month in the form of '# hours #minutes'

2021-03-25 Thread Jeff Newmiller
This is a very unclear question. Weeks don't line up with months.. so you need to clarify how you would do this or at least give an explicit example of input data and result data. On March 25, 2021 11:34:15 AM PDT, Dr Eberhard W Lisse wrote: >Thanks, that is helpful. > >But, how do I group it

Re: [R] Converting POSIXct format date to Character format

2021-03-24 Thread Jeff Newmiller
Please don't reply to a thread to start a new question... create a new email to avoid linking your question with the one you replied to. On March 24, 2021 12:11:07 PM PDT, e-mail ma015k3113 via R-help wrote: >I have a data frame "PLC" which has two variables Year_END_Date EPS >

Re: [R] Weird (wrong?) result for fft

2021-03-22 Thread Jeff Newmiller
Neither. The discrete Fourier transform is a complex number operation. R-help is per the Posting Guide not an appropriate place to discuss theory in depth, and there is plenty of theory in this question and practically no R, but you can examine your result more closely with the functions

Re: [R] How to plot dates

2021-03-16 Thread Jeff Newmiller
So what do you want quantity on the y-axis to be? On March 16, 2021 11:45:32 AM PDT, Gregory Coats wrote: >I want to plot the date and time of the event, as reflected in data. >2021-03-11 10:00:00 >Greg Coats > >> On Mar 16, 2021, at 2:23 PM, Jeff Newmiller > wrote: >>

Re: [R] How to plot dates

2021-03-16 Thread Jeff Newmiller
You don't seem to have a Y_Var in your data. What is it that you want to plot? On March 16, 2021 9:21:05 AM PDT, Gregory Coats via R-help wrote: >Sarah, Thank you. Yes, now as.POSIXct works. >But the ggplot command I was told to use yields an Error message, and >there is no output plot. >Please

Re: [R] Very slow optim(): solved

2021-03-12 Thread Jeff Newmiller
Calculate fewer of them? If you don't setup your code to save intermediate results, then you cannot see intermediate results. On March 11, 2021 8:32:17 PM PST, "毕芳妮 via R-help" wrote: >Dear list, >I am using optim() to estimate over 60 thousans of parameters, and use >the server to run the

Re: [R] Gradient plots in ggplot2

2021-03-08 Thread Jeff Newmiller
Perhaps scale_fill_gradientn() would be useful. On March 8, 2021 8:05:52 PM PST, p...@philipsmith.ca wrote: >I am having trouble with a gradient fill application in ggplot2, caused > >by outlier values. In my reprex, most of the values are between 2 and >-2, but there are two outliers, 10 and

Re: [R] quantile from quantile table calculation without original data

2021-03-08 Thread Jeff Newmiller
fBasics myself. On March 8, 2021 12:41:40 AM PST, Martin Maechler wrote: >>>>>> Jeff Newmiller >>>>>> on Fri, 05 Mar 2021 10:09:41 -0800 writes: > >> Your example could probably be resolved with approx. If >> you want a more robust

Re: [R] Package to generate moon phase - SR-SS

2021-03-07 Thread Jeff Newmiller
Odd.. came right up for me. Perhaps you might find rseek.org easier to use? On March 7, 2021 5:03:20 AM PST, Neotropical bat risk assessments and acoustic tools wrote: >Hi all > >I have not found a package by Googling, but assume there must be at >least one out there. >I need to generate/write

Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread Jeff Newmiller
Your example could probably be resolved with approx. If you want a more robust solution, it looks like the fBasics package can do spline interpolation. You may want to spline on the log of your size variable and use exp on the output if you want to avoid negative results. On March 5, 2021

Re: [R] problem downloading R

2021-03-04 Thread Jeff Newmiller
Not much. Try a different mirror site. Try disabling anti-virus download filters. If you are using a cloud-backed directory like OneDrive, try downloading and installing on a standard local disk. On March 4, 2021 8:02:43 AM PST, Dick Mathews wrote: >I am trying to download the Windows version

Re: [R] Help Required for R Markdown function.

2021-03-01 Thread Jeff Newmiller
It is standard for install.packages to download packages into a temporary directory before actually installing them. That message has been there for many many years every time you install a contributed package. You have not provided a complete copy of the errors that were generated... I am

Re: [R] how to manage objects on the working environment

2021-02-27 Thread Jeff Newmiller
R typically asks you if you want to save your workspace when you quit. If you say yes, your global environment is saved to a file called ".RData" in your current working directory. When you start R it looks for a file of this name in the current working directory and silently loads it. If you

Re: [R] print and coef Methods for survreg Differ

2021-02-23 Thread Jeff Newmiller
o data such as treatment="C" in my >example? > >-Original Message----- >From: Jeff Newmiller >Sent: Tuesday, February 23, 2021 11:10 AM >To: r-help@r-project.org; b...@denney.ws >Subject: Re: [R] print and coef Methods for survreg Differ > >Model equations do no

Re: [R] print and coef Methods for survreg Differ

2021-02-23 Thread Jeff Newmiller
Model equations do not normally have conditional forms dependent on whether specific coefficients are NA or not. If you assign NA to a coefficient then you will not be able to predict outputs for input cases that you should be able to. Zero allows these expected cases to work... NA would

Re: [R] Read

2021-02-22 Thread Jeff Newmiller
This gets it into a data frame. If you know which columns should be numeric you can convert them. s <- "x1 x2 x3 x4 1 B22 2 C33 322 B22 D34 4 D44 51 D53 60 D62 " tc <- textConnection( s ) lns <- readLines(tc) close(tc) if ( "" == lns[ length(

Re: [R] Difficulty using the tryCatch() function

2021-02-07 Thread Jeff Newmiller
Too many curly braces. warning and error need to be arguments to tryCatch. On February 7, 2021 11:30:59 AM PST, p...@philipsmith.ca wrote: >I need help using the tryCatch function. I have a function and I want >to >surround it with tryCatch to catch errors and thereby avoid stopping >execution

Re: [R] md5sum issues

2021-02-03 Thread Jeff Newmiller
alternatives. > >Thanks for the input! >Ivan > >-- >Dr. Ivan Calandra >TraCEr, laboratory for Traceology and Controlled Experiments >MONREPOS Archaeological Research Centre and >Museum for Human Behavioural Evolution >Schloss Monrepos >56567 Neuwied, Germany &

Re: [R] md5sum issues

2021-02-03 Thread Jeff Newmiller
This CR vs LF vs CRLF newline discrepancy has been around since the 70s and the CP/M operating system. And it remains an issue in over-the-wire internet text protocols today, which actually use the CRLF version like Windows. Sorry, UNIX... world domination of LF encoding failed. The problem

Re: [R] md5sum issues

2021-02-02 Thread Jeff Newmiller
Sounds like a newline discrepancy issue. Highly unlikely to be an R issue. On February 2, 2021 8:01:05 AM PST, Ivan Calandra wrote: >Dear useRs, > >I have some kind of a weird issue with md5sum() and I'm not sure where >I >should start. > >I have a repository on GitHub, with a local Git

Re: [R] problem when loading tidyverse

2021-01-27 Thread Jeff Newmiller
These are not errors, they are informational, and the Posting Guide points out that details of how to use contributed packages such as tidyverse are off topic (too many of them for one list). If you want to use the versions of the functions that tidyverse is overriding, specify the desired

Re: [R] How to predict/interpolate new Y given knwon Xs and Ys?

2021-01-27 Thread Jeff Newmiller
<- 1:45 >> > plot(Y~X) >> > raw_value <- predict(lm(X[1:39]~Y[1:39]), newdata = >data.frame(Y=6)) >> > x <- unname(raw_value[!is.na(raw_value)]) # x= 16.62995 >> > points(x, 6, pch = 16) >> > ``` >> > Here I used the points 1:39 because af

Re: [R] How to predict/interpolate new Y given knwon Xs and Ys?

2021-01-26 Thread Jeff Newmiller
model2 <- lm( x~y ) predict(model2, data.frame(y=26)) model2 is however not the inverse of model... if you need that then you need to handle that some other way than using predict, such as an invertible monotonic spline (or in this case a little algebra). On January 26, 2021 1:11:39 AM PST,

Re: [R] problem installing R and RStudio

2021-01-25 Thread Jeff Newmiller
Your installation of R seems broken. Since RStudio sometimes tries to simplify things and sometimes misses and we aren't typically up to speed with their latest procedures, please describe what you did to install R in terms related to the instructions on CRAN [1] and its install program. When

Re: [R] rmarkdown and source call to R file.

2021-01-21 Thread Jeff Newmiller
This is off topic here... please read the Posting Guide about getting help on contributed packages. Check out the RStudio forums. FWIW you should also look carefully at ?knitr::knit_global ... I don't think it does what you seem to think it does. On January 21, 2021 10:49:17 PM PST, Georgios

Re: [R] Col names in a data frame

2021-01-21 Thread Jeff Newmiller
rm(list=ls()) is a bad practice... especially when posting examples. It doesn't clean out everything and it removes objects created by the user. Read ?data.frame, particularly regarding the check.names parameter. The intent is to make it easier to use DF$A notation, though DF$`(A)` is usable if

Re: [R] help post

2021-01-20 Thread Jeff Newmiller
I think Parrot is a distribution of Linux, which would likely use the bash command shell. The saved workspace would be in a file named ".RData" in whatever the current directory was when you quit R. Many experienced users of R avoid creating such files as mistakes from old sessions can come

Re: [R] Help with changing date format in R

2021-01-20 Thread Jeff Newmiller
Perhaps d$date <- as.Date(d$date, format = ifelse("K"==d$observer, "%d%m%Y", "%m%d%Y" )) On January 20, 2021 8:08:33 AM PST, krissievdh wrote: >Hi, > >I have a big database where one-third of the data is in a different >date >format than the rest. I'll add an example table to show you. > >|

Re: [R] rbind common header to file list

2021-01-19 Thread Jeff Newmiller
a) I recommend _not_ overwriting the input files. Very difficult to debug/recover if anything goes wrong. b) I recommend making a function that takes the file name, source directory, and destination directory, and reads the file, makes the change, and writes it to the output directory. c)

Re: [R] writing a function to work with dplyr::mutate()

2021-01-19 Thread Jeff Newmiller
s >way and case_when has to be hard-coded. > >On Tue, Jan 19, 2021 at 3:48 PM Jeff Newmiller > >wrote: > >> Second this. There is also the findInterval function, which omits the >> factor attributes and just returns integers that can be used in >lookup >> tabl

Re: [R] writing a function to work with dplyr::mutate()

2021-01-19 Thread Jeff Newmiller
Second this. There is also the findInterval function, which omits the factor attributes and just returns integers that can be used in lookup tables. On January 19, 2021 10:33:59 AM PST, Bert Gunter wrote: >If you are willing to entertain another approach, have a look at ?cut. >By >defining the

Re: [R] Errors and OS Differences with as.POSIXct and as.POSIXlt

2021-01-19 Thread Jeff Newmiller
This is as described in the documentation, due to OS differences, e.g [1]. [1] https://stat.ethz.ch/R-manual/R-devel/library/base/html/strptime.html On January 18, 2021 5:56:11 PM PST, Bill Denney wrote: >Hello, > > > >Dates created with as.POSIXct differ between Windows/Mac and Linux.

Re: [R] Converting "day of year" to "year", "month" and "day"

2021-01-17 Thread Jeff Newmiller
This is an opportunity for you to think for yourself (r-help) instead of expecting solutions neatly wrapped and delivered (r-do-my-work-for-me). Remove the no-longer-needed columns once the desired columns are available. On January 17, 2021 7:12:28 AM PST, Jibrin Alhassan wrote: >Hi Barradas,

Re: [R] roxygen2 & markdown & math

2021-01-12 Thread Jeff Newmiller
a) This discussion is on the wrong mailing list. Please go to R-package-devel if you want to continue this discussion. b) You can do whatever you want in your vignettes, but R doc files are designed to work with multiple output devices, including text-only terminals, so syntax specific to

Re: [R] log of small values in R

2021-01-10 Thread Jeff Newmiller
?log1p On January 10, 2021 12:53:14 AM PST, Shaami wrote: >Dear FriendsI am facing the problem of log values in R. The >log(1-0.9) is giving -Inf while log(1e-18) gives finite >answer. Any suggestion to deal with this problem? Thank you > > [[alternative HTML

Re: [R] Search list of igraph objects to return some with certain values

2021-01-05 Thread Jeff Newmiller
Standard logical indexing. Write a function that returns TRUE or FALSE given an igraph object. Use sapply or Vectorize to make a logical vector as long as your list. Then use that vector to index the list with single bracket indexing. On January 4, 2021 6:08:43 PM PST, Chris Buddenhagen

Re: [R] Defining partial list of variables

2021-01-05 Thread Jeff Newmiller
IMO if you want to hardcode a formula then simply hardcode a formula. If you want 20 formulas, write 20 formulas. Is that really so bad? If you want to have an abbreviated way to specify sets of variables without conforming to R syntax then put them into data files and read them in using a

Re: [R] false.nearest on tseriesChaos

2021-01-04 Thread Jeff Newmiller
This theory question doesn't seem on-topic here. Read the Posting Guide mentioned below... contact the package maintainer if the package description doesn't inform you where to go for support. On January 3, 2021 11:07:48 PM PST, "Norma Elizabeth Quiroz Pérez" wrote: >Dear all: > >I am new in

Re: [R] [External] Re: [External] Adding a superscript 6 to a number

2020-12-29 Thread Jeff Newmiller
>> expression(12^6) >> > paste(expression(12^6)) >> [1] "12^6" >> >> >> expression(12^6) >> paste(expression(12^6)) >> >> plot(0:1, 0:1) >> text(.1, .4, labels=paste(expression(12^6))) >> text(.1, .3, labels=e

Re: [R] [External] Adding a superscript 6 to a number

2020-12-29 Thread Jeff Newmiller
Why not? Is that a generalization, or specific to this case? On December 29, 2020 7:54:22 AM PST, "Richard M. Heiberger" wrote: >paste() is the problem. don’t use paste with expression() > >On Tue, Dec 29, 2020 at 10:50 Sorkin, John >wrote: > >> Colleagues, >> >> I would like to create a

Re: [R] Windows path backward slash

2020-12-24 Thread Jeff Newmiller
Simplest suggestion is to forget turning this into a function. Alternatively, remove the "allmetrx=" from the last line of your function, as the assignment suppresses automatic printing of the result. However, it may already be working... you could assign the result of the function call outside

Re: [R] FInd packages in need of Update (like RStudio)

2020-12-23 Thread Jeff Newmiller
This is not normally something one would apply automatically, as it can break existing code. But wouldn't?update.packages be the obvious choice interactively? On December 23, 2020 6:38:41 AM PST, Dr Eberhard W Lisse wrote: >Hi, > >does anyone know how one would look which packages require an

Re: [R] ggplot2::coord_fixed() margin problem

2020-12-20 Thread Jeff Newmiller
Perhaps ?expansion can help? On December 20, 2020 9:00:09 AM PST, "Martin Møller Skarbiniks Pedersen" wrote: >On Sun, 20 Dec 2020 at 17:43, Rui Barradas >wrote: > >Thank you for trying to answer my question. > >> I am not sure I understand the problem. >> With coord_fixed() both axis have the

Re: [R] Problem in cluster sampling: 'mixed with negative subscripts'

2020-12-20 Thread Jeff Newmiller
I've never mastered using negative indexes with my fingers, though... On December 19, 2020 11:32:46 PM PST, Jim Lemon wrote: >It does remind me of counting on one's fingers, though. > >Jim > >On Sun, Dec 20, 2020 at 4:38 PM Bert Gunter >wrote: >> >But c(x[-1], x[1]) is, which is not so

Re: [R] How to specify year-month-day for a plot

2020-12-16 Thread Jeff Newmiller
Don't set the header argument to TRUE if your data does not have a header? On December 16, 2020 11:09:18 AM PST, Gregory Coats via R-help wrote: >I would like to be able to draw and label a vertical line, representing >the date of some arbitrary event. The date of the first non-zero entry >is

Re: [R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Jeff Newmiller
;round(0.5*length(which(dd$cluster==sample(unique(dd$cluster),round(0.2*length(unique(dd$cluster,]. >I know it is very inefficient. Also it just randomly deleted rows and >had no effects in adding rows to match the total number of >observations. Thank you for your help! > > &

Re: [R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Jeff Newmiller
This is R-help, not R-do-my-work-for-me. It is also not a homework help line. The Posting Guide is required reading. Assuming this is not homework, since each step in your problem definition can be mapped to a fairly basic operation in R (the sample function and indexing being key tools), you

Re: [R] ggplot complicated ylab

2020-12-16 Thread Jeff Newmiller
Perhaps [1] has some useful ideas? [1] https://stackoverflow.com/questions/13223846/ggplot2-two-line-label-with-expression On December 16, 2020 5:02:59 AM PST, tr...@gvdnet.dk wrote: >Dear friends - I need an ylab on 2 lines - > >Here is what I want: > >exp <- expression(paste("Cumulative Na-Cl

Re: [R] Meta: R-Help reply-to

2020-12-15 Thread Jeff Newmiller
For the record: this is not nearly as cut-and-dried as you imply. The current settings actually make replying off-list rather tricky for some mail clients... I have tried and failed a few times to reply off-list due to this. The next level of invasiveness is to make it appear that the original

Re: [R] multiple t-test with different species and treatments

2020-12-15 Thread Jeff Newmiller
Dear Lingling Wen: Bert has forwarded your message to the list because one person cannot usually answer every question... so many heads are better than one. However, you seem to have neglected his other advice about providing a complete example including data. Further, you are using several

Re: [R] Hello! Problem - function ''matord'' in R

2020-12-14 Thread Jeff Newmiller
... and if so, then you are on the wrong mailing list... On December 14, 2020 1:43:49 PM PST, "T. A. Milne via R-help" wrote: >Might the desired function "matord" be part of a Bioconductor package? >This link >https://rdrr.io/bioc/clusterSeq/src/R/associatePosteriors.R > >suggests that could be

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Jeff Newmiller
Bill pointed out some errors in your code but you keep making the claim that -MM-DD is not recognized and I just want to make it completely clear that that is the default format for dates in R as it is an ISO standard. So focus on other issues until you get it working... this format is

Re: [R] How to specify year-month-day for a plot

2020-12-13 Thread Jeff Newmiller
By converting the character date data into a time-like type... e.g. ?as.Date and plotting y-vs-x. On December 12, 2020 11:18:46 AM PST, Gregory Coats via R-help wrote: >Starting with year-month-day, for the variable gallons, I can easily >plot the variable gallons, while disregarding the date.

Re: [R] change frequency of wind data correctly

2020-12-06 Thread Jeff Newmiller
Beware of missing or extra records with these approaches. Also may be tricky to get the time aligned to the hour properly. On December 6, 2020 9:12:01 PM PST, Richard O'Keefe wrote: >To be honest, I would do this one of two ways. > >(1) Use ?decimate from library(signal), >decimating by a

Re: [R] change frequency of wind data correctly

2020-12-06 Thread Jeff Newmiller
ceil, units = "mins" ) } On Sun, 6 Dec 2020, Jeff Newmiller wrote: I usually roll my own: --- Sys.setenv( TZ = "GMT" ) ssdf$Dtm <- with( ssdf , as.POSIXct( paste( date_POSIX, time_POSIX ) ) ) ceiling_dtmN <- function( dtm, mins )

Re: [R] change frequency of wind data correctly

2020-12-06 Thread Jeff Newmiller
nned by Libra ESVA and is believed to be clean. __ 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] A general question about targeted sequencing data analysis

2020-12-03 Thread Jeff Newmiller
My suggestion would be to ask this question in a forum devoted to that topic, such as the Bioconductor forum [1]. [1] https://www.bioconductor.org/help/support/ On December 3, 2020 11:25:24 AM PST, "Li, Aiguo (NIH/NCI) [E] via R-help" wrote: >Dear all, > >One of our PIs has a targeted

Re: [R] Add a third .libPath

2020-12-02 Thread Jeff Newmiller
Current versions of Windows support user environment variables also, so having Administrator change the PATH should not be necessary. On December 2, 2020 7:20:16 AM PST, Duncan Murdoch wrote: >You are mixing up two different things. > >The .libPaths() function returns paths where R searches

Re: [R] Need guidance on summarizing time data

2020-11-30 Thread Jeff Newmiller
Does table(DF$Time) do what you want? Seems kinda odd to me that you want to distinguish between 18:31 and 18:32 but you don't care which days those occur on. If your phenomenon is related to local time-of-day then perhaps you might want to correlate with sun elevation relative to the

Re: [R] Printing upon calling a function

2020-11-30 Thread Jeff Newmiller
Answering you is also a burden without the reprodicible code. I'll pass on that. But I will say that mixing analysis with output in the same function is a terrible habit. Come to the functional side of coding... it is much more re-usable here. On November 30, 2020 12:14:35 AM PST, Steven Yen

Re: [R] calling r from java

2020-11-27 Thread Jeff Newmiller
Not being a Java programmer I was going to sit this one out, but when Bert points at an 8-year old blog that OP was already saying was too old I figure even I can Google better than that. https://github.com/oracle/fastr which has activity within the last 3 days, though I really don't know

Re: [R] - Trying to replicate VLOOKUP in R - help needed

2020-11-18 Thread Jeff Newmiller
Instead, learn how to use the merge function, or perhaps the dplyr::left_join function. VLOOKUP is really not necessary. On November 18, 2020 7:11:49 AM PST, Gregg via R-help wrote: >Thanks Andrew and Mitch for your help. > >With your assistance, I was able to sort this out. > >Since I have to

<    1   2   3   4   5   6   7   8   9   10   >