Re: [R] Grouping by 3 variable and renaming groups

2018-05-26 Thread Jeff Reichman
Rui Your first code worked just fine. Jeff -Original Message- From: Rui Barradas Sent: Saturday, May 26, 2018 8:30 AM To: reichm...@sbcglobal.net; 'R-help' Subject: Re: [R] Grouping by 3 variable and renaming groups Hello, Sorry, but I think my first answer is wrong. Yo

Re: [R] Excel Add-Ins Not Loaded When Using excel.link & RDCOM

2018-05-29 Thread Jeff Newmiller
RDCOM supports calling R from Excel. AFAIK you need to use the non-free Statconn software [1] to get much done going the other way. FWIW I have found my life to be much simpler only using packages that access the data in Excel rather than trying to control the software remotely. More OS-portab

Re: [R] Filtering using multiple rows in dplyr

2018-05-31 Thread Jeff Newmiller
11.0 3 HALAF032 8 -23.46.51 4 HALAF033 2 -14.29.64 5 HALAF033 4 -12.38.92 6 HALAF033 8 -6.55 12.3 7 HALAF036 2 -14.9 12.6 8 HALAF036 4 -16.7 11.2 9 HALAF036 8 -21.76.56 10 HALAF039 2 0.242 12.4 # ... with 1,165 more rows What I would like to do is filter some groups out

Re: [R] Help About R-Package Portability

2018-05-31 Thread Jeff Newmiller
Your lack of permissions is highly operating-system-specific and local-policy-specific and therefore outside the scope of this mailing list... I suggest you have a conversation with your system administrator(s). Insuring the ability to run R code when the admin is not cooperating is not really s

Re: [R] read .asc from web into R

2018-06-03 Thread Jeff Newmiller
Have you tried that url in a web browser? I encountered an access permission error. If you also encountered an error, then so would R. You need to download the file using appropriate access credentials (typ. through a web browser) and read it from disk. FWIW the ".asc" extension is very nearly

Re: [R] using myfunction in stat_function

2018-06-07 Thread Jeff Newmiller
Your example is not reproducible. Perhaps read [1] [1] http://rstudio-pubs-static.s3.amazonaws.com/3365_9573f6d661b99365fe1841ee65d3.html On June 6, 2018 8:04:44 PM PDT, Veerappa Chetty wrote: >HI, > >I use solve(A,b) inside my function, myfun2; it works fine when I >return >one value or a

Re: [R] problems in converting numeric to character

2018-06-07 Thread Jeff Newmiller
?formatC (digits, drop0trailing) ?sprintf (format %f) ?cat ?options (digits) You appear to be confusing source code formatting with output formatting. The internal representation of a numeric value has no notion of the number of decimals that were used to enter it into memory from source code.

Re: [R] Efficient manipulation with list object

2018-06-10 Thread Jeff Newmiller
The question was about matrices, not data frames or data tables. While faster than Reduce, the conversions still make it over twice as slow as Rui's answer. On June 10, 2018 12:18:39 PM HST, Benjamin Christoffersen wrote: >You may be able to speed it up further by using `data.table`'s >`rbindli

[R] Changing selected columns to factor

2018-06-11 Thread Jeff Reichman
R-Help Forum If I have a data frame consisting of say ten (10) variables (A,B,C,D,E,F,G,H,I,J) and I want to change Variables 2,7,8,and 9 to factors is there a command such that I can do it in one line or do I simply have to convert each separately? Jeff [[alternative HTML

Re: [R] Changing selected columns to factor

2018-06-12 Thread Jeff Reichman
Well that’s easy enough - thank you -Original Message- From: Jim Lemon Sent: Monday, June 11, 2018 11:50 PM To: Jeff Reichman Cc: r-help mailing list Subject: Re: [R] Changing selected columns to factor Hi Jeff, jrdf<-data.frame(A=rnorm(10),B=rnorm(10),C=rnorm(10), D=rnorm(10

Re: [R] on execution time of a function...

2018-06-13 Thread Jeff Newmiller
Wow, you can find almost any explanation on the Internets. That doesn't mean you should believe all of them. R does not do anything likely to tweak interrupts... if that is your problem then you need to be on an operating-system/computer-model-specific forum rather than this OS-agnostic mailing

Re: [R] on execution time of a function...

2018-06-13 Thread Jeff Newmiller
your concerns tolerating my query on an >OS-agnostic mailing list! > >AKSHAY M KULKARNI > >From: Loris Bennett >Sent: Wednesday, June 13, 2018 1:37 PM >To: Jeff Newmiller >Cc: r-help@r-project.org; akshay kulkarni >Subject: Re: [R] on executi

Re: [R] Tables in Rmarkdown Word

2018-06-13 Thread Jeff Newmiller
I have heard of people using CSS formatting with Rmarkdown output and copy-pasting into Word/LibreOffice, but LaTeX is so much nicer if you don't require Word that I suppose there haven't been many with that itch. To some extent you can use a manually-styled Word starting document (referred to a

Re: [R] Calling r-scripts with arguments from other scripts, or possibly R programming conventions/style guide

2018-06-13 Thread Jeff Newmiller
I echo Bill's sentiments regarding use of functions, but think that you can afford to delay building packages while you are in the exploratory phase. You can start out by building your sequence of statements using explicitly defined variables at the beginning like fname <- "test.csv" #your code

Re: [R] Storing tableGrobs in a list

2018-06-13 Thread Jeff Newmiller
?`[[` and read the discussions of indexing in the Introduction to R document that comes with R. Also, find a way to predict the number of elements you will need as making this a habit will pay off big time when you work with large amounts of data: L1<-vector( "list", N ) for (i in seq.int( N )

Re: [R] Kendall tau a, b, or c

2018-06-14 Thread Jeff Reichman
Marc Thank you - that will save me some time. Jeff -Original Message- From: Marc Schwartz Sent: Thursday, June 14, 2018 4:07 PM To: JEFFERY REICHMAN Cc: R-help Subject: Re: [R] Kendall tau a, b, or c > On Jun 14, 2018, at 4:04 PM, JEFFERY REICHMAN wrote: > > r-help Foru

Re: [R] Storing tableGrobs in a list

2018-06-14 Thread Jeff Newmiller
t(grobs = list(list(label = "status", x = 0.5,  >: >  only 'grobs' allowed in "gList" > >Also tried, still no go > >p1<-do.call(gtable_combine, list(L1,along=2)) >p2<-do.call(gtable_combine, list(L2,along=2)) > > > > >On Jun 13,

Re: [R] Help, zero-truncated Binomial distribution

2018-06-18 Thread Jeff Newmiller
Mailing list etiquette requires that you don't start a new thread by replying to an existing thread. Start a new thread with a fresh email. Also, this is a plain text mailing list... HTML formatting gets removed and what is left often does not look to the list readers like what you sent. Read t

Re: [R] How to modify data frame stored in a list

2018-06-18 Thread Jeff Newmiller
Do you want it to run quickly or be quick to write? Why have you specified that you want a solution that uses lapply? (Such constraints often arise in the context of homework, whereas someone interested in getting the job done does not usually care about which function is used.) On June 18, 201

Re: [R] numeric comparison error

2018-06-18 Thread Jeff Newmiller
FAQ 7.31, or take a university course in numerical analysis. https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f On June 18, 2018 2:45:29 PM PDT, Brian Smith wrote: >Hi, > >I am a little bit perplexed at why I am getting some values as FALSE: > >> c

Re: [R] Optimisation with Normalisation Constraint

2018-06-20 Thread Jeff Newmiller
I recommend posting this on a mathematics discussion forum like Stack Exchange and (re-)reading the Posting Guide for this mailing list. I think you are going to need to re-write your model function to algebraically combine your original model along with the constraint, and then use the origina

[R] KNN

2018-06-21 Thread Jeff Reichman
R-Help Does one need to normalize ones data is using the knn function within the caret Library. Jeff [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] KNN

2018-06-21 Thread Jeff Reichman
David I figured out where I went wrong. But thank you for the response Jeff -Original Message- From: David L Carlson Sent: Thursday, June 21, 2018 11:43 AM To: reichm...@sbcglobal.net; R-help@r-project.org Subject: RE: [R] KNN It depends on what you are trying to do and what kind of

Re: [R] Issue with R write() function

2018-06-23 Thread Jeff Newmiller
1. This behavior is dictated by the file system (an operating system feature) that is in use. Chances of it changing in R are extremely small. 2. While not clearly documented, this behavior is consistent with the definition of what a "csv" file is. Headers located at other than line 1 are not v

Re: [R] parallel computing in r....

2018-06-24 Thread Jeff Newmiller
You cannot send one task to 12 processors... the price of parallelism is that you must break down your task into smaller tasks. Once you have number of tasks equal to our more than the number of available cores then the higher level functions such as parLapply or mclapply can shuffle tasks onto

Re: [R] Outputting variable names and their value bindings

2018-06-24 Thread Jeff Newmiller
Yes and no. R does not have a "Matlab-output-compatibility" mode, but you can write your script to output anything you want it to using the "cat" function with various functions like "sprintf" and "as.character". You may want to write some functions that format some common objects that you typic

Re: [R] Outputting variable names and their value bindings

2018-06-24 Thread Jeff Newmiller
; >I am sure this is a dumb question, but is there a reference manual for >R >available online? > >On 24 June 2018 at 16:14, Jeff Newmiller >wrote: > >> Yes and no. R does not have a "Matlab-output-compatibility" mode, but >you >> can write your script

Re: [R] Fwd: Quadratic programming, for loop

2018-06-26 Thread Jeff Newmiller
The recommended (see the Posting Guide) way to resolve questions like this is to post a reproducible example so we can see the problem occur in our R session. There are a number of Internet resources that can help you get this right such as [1][2][3]. Note that one key to success is to learn ho

[R] Convert Hijri to Gregorian

2018-06-26 Thread Jeff Reichman
R-help Does R have a package or function that will convert Gregorian to Hijri (Islamic) dates (time series)? Jeff [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

Re: [R] Adding lines to the page

2018-06-27 Thread Jeff Newmiller
That would depend how you are generating the page... plots alone don't really have such options. If you don't know what this means then I suggest you read the Reproducible Research Task View [1]. knitr in conjunction with LaTeX (Rnw files) is very powerful, but there are many other tools as well

Re: [R] How long can a csv file label be?

2018-06-27 Thread Jeff Newmiller
This is operating-system-dependent. Check the documentation for your operating system (or the file subsystem you are using, since some OSes support multiple filesystems). Knowing this fact can make Googling more effective as well. On June 27, 2018 3:33:39 PM PDT, Nick Wray via R-help wrote: >H

[R] Plot Rect Transparency

2018-06-28 Thread Jeff Reichman
function results and plot in ggplot2 so I can just simply add rectangles to the plot function, but I need to make transparent and there doesn't seem to be an alpha option. Jeff [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Unable to return gmtoff from as.POSIXlt without converting date string to as.POSIXct first

2018-06-28 Thread Jeff Newmiller
Read ?DateTimeClasses regarding gmtoff. In short, it is implementation-dependent. On June 28, 2018 10:58:13 AM PDT, Sam Albers wrote: >Is it possible for someone to explain what is going on here? I would >expect >that `as.POSIXlt` would be able to accept `datestring` and return all >the >elemen

Re: [R] Plot Rect Transparency

2018-06-28 Thread Jeff Reichman
28, 2018 7:57 PM To: reichm...@sbcglobal.net; R-help@r-project.org Subject: Re: [R] Plot Rect Transparency On 28/06/2018 5:29 PM, Jeff Reichman wrote: > R-Help > > > > Is there a way to make a rectangle transparent (alpha=0.1??) > > > >plot(c(100, 200), c(3

Re: [R] inconsistency in list subsetting in R in linux

2018-06-29 Thread Jeff Newmiller
Read the Value section of ?mclapply. That error is an encapsulated error from the forecast function. I suggest not debugging your code running in parallel... temporarily replace mclapply with lapply to debug so you can step into your worker fictions. You may also want to temporarily reduce the

Re: [R] Convert list of data frames to one data frame

2018-06-29 Thread Jeff Newmiller
t;), second4 = "Jones2"))   bind_rows(lapply(employees4List, function(x) rbind.data.frame(c(t(x) Thanks. Ira -- Sarah Goslee http://www.functionaldiversity.org __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.

Re: [R] Question

2018-06-30 Thread Jeff Newmiller
Your question is notable for what it is missing... any trace of R code. [1][2][3] Do read the Posting Guide. I don't see "Sargan" in base R, so your analysis likely used a contributed package... there seem to be a couple, so your example code would clarify. I don't see the number of IVs listed

Re: [R] parallel processing in r...

2018-06-30 Thread Jeff Newmiller
Use "top" at the bash prompt. Read about the "mc.cores" parameter to mclapply. Make a simplified example version of your analysis and post your question in the context of that example [1][2][3]. You will learn about the issues you are dealing with in the process of trimming your problem, and wi

Re: [R] A question on Statistics

2018-06-30 Thread Jeff Newmiller
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. --- Jeff

Re: [R] Convert list of data frames to one data frame

2018-06-30 Thread Jeff Newmiller
h", First3 = NA, Second3 = NA, First4 = NA, Second4 = NA) df3 = data.frame(First1 = "Al3", Second1 = "Jones", First2 = "Barbara", Second2 = "Smith", First3 = "Carol", Second3 = "Adams", First4 = NA, Sec

Re: [R] Extracting the MAPE value from a fitted Time Series Model

2018-07-02 Thread Jeff Newmiller
Google offers [1], which probably seems like a vague response but your question omitted a reproducible example and is contaminated by posting in HTML (read the Posting Guide). [1] https://www.rdocumentation.org/packages/MLmetrics/versions/1.1.1/topics/MAPE On July 2, 2018 1:22:39 PM PDT, Paul B

Re: [R] Combine by columns a vector with another vector that is constant across rows

2018-07-03 Thread Jeff Newmiller
Gabor's solution seems to optimize 'simpler'. More efficient is to learn that in R a vector is not a matrix, but a matrix is just an ornamented vector. fastWolfgang <- function( v, vec ) { matrix( c( v, rep( vec, length( v ) ) ) , now = length( v ) ) } On July 3, 2018 6:28:45 AM PDT,

Re: [R] Combine by columns a vector with another vector that is constant across rows

2018-07-03 Thread Jeff Newmiller
Sorry trying again... fastWolfgang <- function( v, vec ) { matrix( c( v, rep( vec, each = length( v ) ) ) , nrow = length( v ) ) } On July 3, 2018 8:21:47 AM PDT, Jeff Newmiller wrote: >Gabor's solution seems to optimize 'simpler'. > >More efficient is to

Re: [R] Generate N random numbers with a given probability and condition

2018-07-04 Thread Jeff Newmiller
This looks like homework (which is off topic here per the Posting Guide). Also, please send your emails in plain text format to avoid us seeing your message differently than you do. On July 4, 2018 3:21:34 PM PDT, Nelly Reduan wrote: >Dear all, > >I would like to generate N random numbers with

Re: [R] about ECDF display in ggplot2

2018-07-07 Thread Jeff Newmiller
It is a feature of ggplot that points excluded by limits raise warnings, while base graphics do not. You may find that using coord_cartesian with the xlim=c(0,500) argument works better with ggplot by showing the consequences of points out of the limits on lines within the viewport. There are

Re: [R] Fw: inconsistency in display of character vector....

2018-07-08 Thread Jeff Newmiller
Using dput and sending your questions with the plain text option as described in [1] will allow you to share your data with less ambiguity. To be sure you have supplied all the code needed for us to reproduce your problem, use [3]. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-gr

Re: [R] Fwd: Question

2018-07-08 Thread Jeff Newmiller
Read the vignette at [1], which mentions the Read me.txt file [2]. I found both links using Google... you could too. [1] https://cran.r-project.org/web/packages/RWinEdt/index.html. [2] https://github.com/cran/RWinEdt/blob/master/inst/ReadMe.txt On July 8, 2018 7:08:53 AM PDT, Farshad Fathian w

Re: [R] Fwd: Question

2018-07-08 Thread Jeff Newmiller
=signature&utm_campaign=signaturevirality5&;> >Sender >notified by >Mailtrack ><https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&;> >07/08/18, >8:54:06 PM > >On Sun, Jul 8, 2018 at 7:34 PM, Jeff Newmiller > &

Re: [R] about ECDF display in ggplot2

2018-07-09 Thread Jeff Newmiller
barlines, fill = barfill) + scale_x_log10( name = "LENGTH of DEL") + scale_y_continuous(name = "FRACTION") + ggtitle("ECDF of LENGTH") + theme_bw() + theme(legend.position = "bottom", legend.direction = "horizontal", legend.box =

Re: [R] R couldnt recognize US Pasific timezome

2018-07-09 Thread Jeff Newmiller
_ 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] Using write.csv as a connection for read.csv

2018-07-09 Thread Jeff Newmiller
TL;DR: If you want to do this, go ahead and use a temporary file or text connection. Others have pointed out that write.csv returns NULL rather than a file connection, but I haven't seen comments on your impulse to avoid the use of files. *nix operating systems are admirably efficient with mul

Re: [R] (no subject)

2018-07-09 Thread Jeff Newmiller
perhaps geom_path rather than geom_line? On July 9, 2018 12:40:15 PM PDT, Hasan Diwan wrote: >https://imgur.com/a/0f72Fsz results from the following code: > >ggplot()+borders("world", colour="gray50", >fill="gray50")+geom_line(aes(x=Longitude, y=Latitude), birds) > >It's ugly, but it will give yo

Re: [R] Making objects global in a package

2018-07-13 Thread Jeff Newmiller
a) There is a mailing list for package development questions: R-package-devel. b) This seems like a job for the sysdata.rda file... no explicit environments needed. See the Writing R Extensions manual. On July 13, 2018 5:51:06 PM PDT, Michael Hannon wrote: >Greetings. I'm putting together a s

Re: [R] Making objects global in a package

2018-07-13 Thread Jeff Newmiller
t;TIBCO Software >wdunlap tibco.com > >On Fri, Jul 13, 2018 at 6:17 PM, Jeff Newmiller > >wrote: > >> a) There is a mailing list for package development questions: >> R-package-devel. >> >> b) This seems like a job for the sysdata.rda file... no explicit &g

Re: [R] Custom Indicator Quantstrat Problem

2018-07-14 Thread Jeff Newmiller
This mailing list is plain text only (read the Posting Guide). When you send HTML-formatted email, what we see is often not what you saw. The solution is for you to figure out how to send your email in plain text format to begin with. Since the syntax in your code below is not valid, I am guessi

Re: [R] Quantstrat custom indicator colnames error

2018-07-14 Thread Jeff Newmiller
Thank you for for reposting a readable question, though the origin of quantstrat and IKTrading on github still took some study, and I cannot see where mktdata was supposed to come from. If you get no expert response here, you might get a more appropriate set of users if you ask this question on

Re: [R] get "massdist" in R

2018-07-14 Thread Jeff Newmiller
Roll back your version of R, or find another way to accomplish that calculation. This "abuse" of undocumented functions inside base R has been warned against for a long time [1], so the real puzzle is how you managed to get this far. [1] http://lists.r-forge.r-project.org/pipermail/vegan-devel

Re: [R] even display of unevenly spaced numbers on x/y coordinates

2018-07-14 Thread Jeff Newmiller
Isn't this what I showed you how to do in [1]? [1] https://stat.ethz.ch/pipermail/r-help/2018-July/455215.html On July 14, 2018 10:16:36 PM PDT, Bogdan Tanasa wrote: >Dear all, > >please would you advise on how I could make an even display of unevenly >spaced number on a graph in R. For example,

Re: [R] even display of unevenly spaced numbers on x/y coordinates

2018-07-14 Thread Jeff Newmiller
But did you run the code? Apparently not. On July 14, 2018 10:34:32 PM PDT, Bogdan Tanasa wrote: >Dear Jeff, > >thank you for your prompt reply and kind help. > >During our previous conversation, we worked on a different topic, >namely >subsetting the dataframe before usi

Re: [R] (no subject)

2018-07-15 Thread Jeff Newmiller
I think you are missing a parenthesis around your condition [1][2]. For future reference: a) You should post the code you ran as well as the error message... it is unusual for the error message alone to be enough to figure out the problem. In fact, try to make a "reproducible example" [3][4][5].

Re: [R] Where does ' Setting LC_CTYPE failed, using "C" ' come from? 2

2018-07-17 Thread Jeff Newmiller
I an sorry that I cannot answer your question, but you don't seem to be very effective in your use of this resource. While sometimes you might get responses to this kind of question here, you really ought to read the Posting Guide: "Questions likely to prompt discussion unintelligible to non-p

Re: [R] Scaling - does it get any better results than not scaling?

2018-07-17 Thread Jeff Newmiller
This question is interesting, but sadly off-topic here as there is nothing specific to R in it. Fortunately there are many resources for getting an answer... e.g. a quick search with Google finds [1] which addresses both centering and scaling. [1] https://stats.stackexchange.com/questions/2978

Re: [R] help erroer solnp

2018-07-17 Thread Jeff Newmiller
It is hard to help you do the right thing when you don't tell us what you did or what you wanted to do or what data you had to work with. See [1][2] as [3] for help on how to ask a question regarding R. Also, "solnp" is not part of R... such a function exists in the Rsoln contributed package, b

Re: [R] GGPlot plot

2018-07-18 Thread Jeff Newmiller
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. --- Jeff Newmiller

Re: [R] xtable does not print out units of a variable

2018-07-18 Thread Jeff Newmiller
man/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. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] help with merging two dataframes function of "egrep"-like formulas

2018-07-18 Thread Jeff Newmiller
EASE 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

Re: [R] Install BMR package - Mac

2018-07-21 Thread Jeff Newmiller
Agree with Bert, but Google sez [1] might also be helpful. [1] https://github.com/Microsoft/LightGBM/issues/3 On July 21, 2018 7:28:55 AM PDT, Bert Gunter wrote: >As this appears to be a Mac specific issue, if you don't get help here, >you >should try posting on the r-sig-mac list. Maybe even be

Re: [R] Problem with mean()

2018-07-21 Thread Jeff Newmiller
Read ?mean. Look at the argument list. The mean function only applies to the first argument. On July 21, 2018 9:39:42 AM PDT, John Kane via R-help wrote: >Either I am doing something very stupid or my R installation has a >glitch. What am I missing? >dd1  <- 50 >dd2  <- 54 > >mean(dd1, dd2) >[

Re: [R] Possible solution to R installation problemst for Linux Mint 19 users

2018-07-21 Thread Jeff Newmiller
Each Mint version builds from an Ubuntu version. I don't use Mint. but this [1] web page tells me you should be pulling from a Bionic repo. Artful may work for you now, but in general it is risky to mix distribution revisions. Note that this informative discussion should have occurred on the R-s

Re: [R] Stop a loop if it takes long time

2018-07-24 Thread Jeff Newmiller
Depends somewhat on what you are doing in the loop and how much of a performance hit you are willing to accept. [1] [1] https://stackoverflow.com/questions/7891073/time-out-an-r-command-via-something-like-try On July 24, 2018 3:17:41 AM PDT, Christofer Bogaso wrote: >Hi, > >Let say I am imple

Re: [R] DiagrammeR and grViz

2018-07-25 Thread Jeff Newmiller
The Export option from the interactive Plots view is a terrible option for any publication-quality graphics. There are many [1] ways to make publication-quality graphics in R, and there can be some operating-system-specific downstream tools considerations that affect what works best for you. I

Re: [R] initiate elements in a dataframe with lists

2018-07-25 Thread Jeff Newmiller
:dim(x)[1]) { x$intersectB[i] <- list()} nothing is happening. Thank you very much ! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] Formatting multi-way ANOVA output for spectra analysis

2018-07-25 Thread Jeff Newmiller
In general, analysis functions in R return objects. When returned alone on an interactive console the default print method for that object gets printed. However, you can put it into a variable with the <- assignment operator, and use the str function to see what values are inside the object, and

Re: [R] Using apply function to merge list of data frames

2018-07-27 Thread Jeff Newmiller
Er, rbind is not merge... do.call expects the function you specify to handle all the elements of the list in a single invocation... Reduce will work with a two-argument function. Reduce(merge, df.list, accumulate=TRUE, by='date') For clarity: apply and the like have for loops inside them, so th

Re: [R] Taking the sum of only some columns of a data frame

2017-03-31 Thread Jeff Newmiller
You can also look at the knitr-RMarkdown work flow, or the knitr-latex work flow. In both of these it is reasonable to convert your data frame to a temporary character-only form purely for output purposes. However, one can usually use an existing function to push your results out without damagin

Re: [R] How can I delete column yhat AND STILL retain the order of Response?

2017-04-01 Thread Jeff Newmiller
Eventually you will think to read the Posting Guide, which discusses which attachments are likely to be allowed on the mailing list. Most users find that pasting a minimal amount of data into the main body of the email is the simplest way to be sure the info will get through to someone who can h

Re: [R] system call removes special characters from text output

2017-04-03 Thread Jeff Newmiller
Sorry, RPsychic package not found. Please install package reprex, apply it to your problem and try again. Note that if this problem can only be produced from within a package then there is an R-package-devel mailing list that would be a more appropriate place to ask. Also, if the problem is actu

Re: [R] Converting date vector into a serial date number

2017-04-04 Thread Jeff Newmiller
I think it is important to point out that treating dates or times as serial numbers should only be done for importing or exporting data. Rather, once the conversion to one of the ?DateTimeClasses has occurred you are better off leaving it as such to reduce the brittleness of your code. For one t

Re: [R] R function stopped working

2017-04-04 Thread Jeff Newmiller
Daniel, if you wish to learn from your mistakes them you must listen. Peter is not someone whose input you should dismiss. The function you have showed us never worked as you have described it. However, if you give .GlobalEnv as the first argument in the call to ls() then it should work. You wi

Re: [R] R hangs on startup

2017-04-04 Thread Jeff Newmiller
> Windows can occasionally be flaky > about multiple instances of a single > program. John... I run multiple instances of R and RStudio on Win7 regularly. About the only poor behaviour I encounter has to do with updating packages used by those other instances. However, I would never run R as A

Re: [R] Package Query

2017-04-05 Thread Jeff Newmiller
There is a package called sos that helps you answer such questions yourself. There are also Task View pages on CRAN that help you identify useful packages. -- Sent from my phone. Please excuse my brevity. On April 4, 2017 9:28:32 PM PDT, Ruchika Salwan wrote: >Hey, > >Is there any package in

Re: [R] Replying to replies in the forum

2017-04-05 Thread Jeff Newmiller
There is no conclusively client-free solution, which is why it is not in the Posting Guide. However, as a general rule, start with a fresh email to start a thread, and reply-to-all to the message you want to reply to. The threading is managed by hidden message ids, not subjects. -- Sent fro

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Jeff Newmiller
You always need to set your timezone somehow when converting to POSIXt. Technically the method for doing this varies by OS, but on all environments I have worked with you can set the default timezone with something like Sys.setenv( TZ="Etc/GMT+5" ) In your example, some timezones supporting da

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Jeff Newmiller
I cannot imagine a less desirable solution. This is the opposite of portable programming. -- Sent from my phone. Please excuse my brevity. On April 6, 2017 5:29:08 AM PDT, Sebastien Moretti wrote: >I have just found the solution. > >We have a custom Linux distribution that allows us to have

Re: [R] average at specific hour "endpoints" of the day

2017-04-06 Thread Jeff Newmiller
, nrec = n() ) %>% filter( nrec == ifelse( "Day"==timeslot, 16, 8 ) ) ) thanks for the help [[alternative HTML version deleted]] This is a plain-text mailing list. Your chances of communicating successfully when

Re: [R] problems in vectors of dates_times

2017-04-07 Thread Jeff Newmiller
R does a poor job of supporting timezone-specific objects... you have to transfer the necessary attributes explicitly for many operations. (It does no job of supporting element-specific timezones so don't go there.) The good news is that R is pretty good at working with points in time, since t

Re: [R] difference metric info of same font on different device

2017-04-07 Thread Jeff Newmiller
I think it is a fundamental characteristic of graphics drivers that output will look different in the details... you are on a wild goose chase. Postscript in particular has a huge advantage in font presentation over other graphics output mechanisms. -- Sent from my phone. Please excuse my brev

Re: [R] list with element "Class 'Date' num"

2017-04-07 Thread Jeff Newmiller
LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] termstrc_1.3.7 loaded via a namespace (and not attached): [1] zoo_1.7-14 sandwich_2.3-4 tools_3.3.3 Rcpp_0.12.10 nlme_3.1-131urca_1.3-0 [7] grid_3

Re: [R] Add local image as inline embedded Image

2017-04-07 Thread Jeff Newmiller
thz.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. --- Jeff NewmillerThe .

Re: [R] change the R home directory

2017-04-08 Thread Jeff Newmiller
Change to the desired directory before starting R. -- Sent from my phone. Please excuse my brevity. On April 8, 2017 10:40:13 AM PDT, Da Zheng wrote: >Hello, > >By default, the home directory of R is "/usr/lib/R" in Ubuntu. >Everything works fine. > >However, when I installed Jupyter notebook an

Re: [R] how to plot three dimension data to filled contour plot or surface plot in R Ask Question

2017-04-11 Thread Jeff Newmiller
Ggplot does not do xyz. Look at package lattice or package rgl instead. -- Sent from my phone. Please excuse my brevity. On April 10, 2017 11:16:54 PM PDT, dncdd via R-help wrote: >ENV  > >R 3.3.2 > >When I have data like: > >rdn<-c(0.8,1.8,2.8) >tdn<-c(1,2,3,4,5,6,7,8,9) > >idn

Re: [R] rdb and rds files include abolute file paths / help understanding how lazy-load dbs are created

2017-04-11 Thread Jeff Newmiller
Someone might respond here anyway, but I think this is more of an R-devel question. Anyway, as long as the package file after installation has appropriate file names for where it is installed, what does it matter what is in the files before installation? -- Sent from my phone. Please excuse m

Re: [R] combination

2017-04-12 Thread Jeff Newmiller
?expand.grid -- Sent from my phone. Please excuse my brevity. On April 12, 2017 6:28:24 PM PDT, Val wrote: >Hi all, >I have two variables x and y. X has five observation and y has three. >I want combine each element of x to each element of y values to >produce 15 observation. Below is my sampl

Re: [R] Wait for batch file to execute

2017-04-13 Thread Jeff Newmiller
For future reference, this kind of question should usually be accompanied by information about your OS such as the sessionInfo function returns... but in this case just read about the wait argument to ?system2. -- Sent from my phone. Please excuse my brevity. On April 13, 2017 8:06:04 AM PDT, A

Re: [R] seq argument along.with

2017-04-14 Thread Jeff Newmiller
Have you ever used the seq_along() function? If you want to delegate the decision of how many elements you want to process to some earlier point in your (or someone else's) code, then the most logical way to create a result vector that is the same size as some input vector, even if that vector

Re: [R] Non date value

2017-04-14 Thread Jeff Newmiller
You don't follow instructions very well. Read the Posting Guide more carefully. -- Sent from my phone. Please excuse my brevity. On April 14, 2017 9:39:30 PM PDT, Ashta wrote: >DF1 is a data frame. I am suspecting there might be non date value >in that column. My question is how to remove a

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-15 Thread Jeff Newmiller
You type each expression interactively at the R console and look at the path it prints. Then you know where to look, or if no file exists there then you know where to put the file you want to be there. -- Sent from my phone. Please excuse my brevity. On April 15, 2017 12:14:32 PM PDT, BR_email

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-15 Thread Jeff Newmiller
Well, to be fair, .Rprofile is an R configuration file, so it was merely the subject line that was off-topic. -- Sent from my phone. Please excuse my brevity. On April 15, 2017 4:24:06 PM PDT, Rolf Turner wrote: >On 16/04/17 07:57, BR_email wrote: >> Boris: >> As before, you assume that I, Bruc

Re: [R] the difference between "-" and "!" between base and data.table package

2017-04-16 Thread Jeff Newmiller
! is a logical operator... it means "not". When you write lidx <- seq_along( mtcars[[ 1 ]] ) %in% train_indices you end up with a vector of logical values for which ! makes sense. Since R supports logical indexing this can be a very convenient way to select one group or the other. If you give

Re: [R] help on readBin in R

2017-04-16 Thread Jeff Newmiller
The mailing list has tight restrictions on attachments, so your attachment was not let through. Read the Posting Guide, and note that sometimes success requires some extended understanding of how your mail software works, and we probably don't know the details either. You might have success chan

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