Re: [R] Vary an equation using values from a sequence

2018-03-14 Thread Jake William Andrae
Thank you, I�ll give it a try. Jake Get Outlook for iOS From: Bert Gunter Sent: Thursday, March 15, 2018 3:23:18 PM To: Jake William Andrae Cc: R-help Subject: Re: [R] Vary an equation using values from a sequence I

Re: [R] Vary an equation using values from a sequence

2018-03-14 Thread Bert Gunter
I thnk what you want is ?outer. e.g.: outer(Data -min(Data),value,FUN = "+") Whether this works for your real task, however, may depend on details and complexities that you have omitted. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and

[R] Vary an equation using values from a sequence

2018-03-14 Thread Jake William Andrae
Hi All, I have a vector of data on which I am operating. The equation with which I want to operate on the vector has a value k. I want to run the equation and output a new vector, each time replacing k with each value from the sequence I defined. I have thought about using for loops and such,

Re: [R] Fwd: Learning advanced R

2018-03-14 Thread Albrecht Kauffmann
I've found the solution to compile the adv-r-book from source: After doing some settings (see: https://travis-ci.org/hadley/adv-r/jobs/353347080/config ) and installation of netlify-cli, the command-line is: Rscript -e 'bookdown::render_book("index.Rmd","bookdown::pdf_book")' This works fine.

[R] Revolutions blog: February 2018 roundup

2018-03-14 Thread David Smith (CDA) via R-help
Since 2008, Microsoft staff and guests have written about R at the Revolutions blog (http://blog.revolutionanalytics.com) and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R

Re: [R] Problem with reading data from an UTF-16 database

2018-03-14 Thread Duncan Murdoch
On 14/03/2018 7:15 AM, Thierry Onkelinx wrote: Dear all, We have a problem with reading some characters correctly from an UTF-16 encoded database. The code below givens the correct characters on Ubuntu with the_driver = {ODBC Driver 13 for SQL Server}. On Windows (with the_driver = {SQL

[R] Problem with reading data from an UTF-16 database

2018-03-14 Thread Thierry Onkelinx
Dear all, We have a problem with reading some characters correctly from an UTF-16 encoded database. The code below givens the correct characters on Ubuntu with the_driver = {ODBC Driver 13 for SQL Server}. On Windows (with the_driver = {SQL Server}), special characters like '♂' and '♀' are

Re: [R] Fwd: Learning advanced R

2018-03-14 Thread Albrecht Kauffmann
I've found two problems in interpreting adv-r-master/book/build-book.r: 1. All pathes in build-book.r refer to the starting-directory "adv-r-master". However, the script build-book.r is located in the directory "book", which is located in directory "adv-r-master". Therefore, pathes starting at

Re: [R] Fwd: Learning advanced R

2018-03-14 Thread Rich Shepard
On Wed, 14 Mar 2018, Jeff Newmiller wrote: Nothing you have said tells me you have LaTeX working (a binary install of R does not depend on it), but if you actually know it is installed and available to R then that isn't the problem. Since you have not said what you actually did or what errors

Re: [R] Learning advanced R

2018-03-14 Thread Spencer Graves
On 2018-03-14 11:52, Rich Shepard wrote: On Wed, 14 Mar 2018, Duncan Murdoch wrote: I'm all for learning more languages and using the one that's best for each job, but for people who don't know Python, it would be helpful to list the aspects in which it excels. When should an R user choose

Re: [R] Fwd: Learning advanced R

2018-03-14 Thread Jeff Newmiller
Nothing you have said tells me you have LaTeX working (a binary install of R does not depend on it), but if you actually know it is installed and available to R then that isn't the problem. Since you have not said what you actually did or what errors you encountered I can only shrug and suggest

Re: [R] Fwd: Learning advanced R

2018-03-14 Thread Albrecht Kauffmann
Dear Jeff, Latex is also required for the R-manuals in the base R installation, and for this it works fine on my PC. Best, Albrecht -- Albrecht Kauffmann alkau...@fastmail.fm Am Mi, 14. Mär 2018, um 17:50, schrieb Jeff Newmiller: > I recommend reading it directly via the website, or

Re: [R] Learning advanced R

2018-03-14 Thread Rich Shepard
On Wed, 14 Mar 2018, Duncan Murdoch wrote: I'm all for learning more languages and using the one that's best for each job, but for people who don't know Python, it would be helpful to list the aspects in which it excels. When should an R user choose to write something in Python instead?

Re: [R] Fwd: Learning advanced R

2018-03-14 Thread Jeff Newmiller
I recommend reading it directly via the website, or buying the book. If you are trying to build a PDF, then the "obvious" question is whether you have LaTeX installed, which is an operating-system-dependent procedure handled outside of R. -- Sent from my phone. Please excuse my brevity. On

[R] Fwd: Learning advanced R

2018-03-14 Thread Eric Berger
Hi Albrecht, I am forwarding your reply to the full group. It's been a while since I did this and I don't remember the details. Maybe someone else can comment. (I am a bit busy at the moment.) If no one supplies the information in a few days I will try to take a look. In the meantime you can

Re: [R] Fwd: the same function returning different values when called differently..

2018-03-14 Thread Martin Maechler
> Eric Berger > on Wed, 14 Mar 2018 18:27:38 +0200 writes: > Hi Akshay, (Please include r-help when replying) > You have learned that PFC.NS and snl[[159]] are not > identical. Now you have to figure out why they > differ. This could also point

[R] Fwd: the same function returning different values when called differently..

2018-03-14 Thread Eric Berger
Hi Akshay, (Please include r-help when replying) You have learned that PFC.NS and snl[[159]] are not identical. Now you have to figure out why they differ. This could also point to a bug or a logic error in your program. Figuring out how two objects differ can be a bit tricky, but with

Re: [R] Learning advanced R

2018-03-14 Thread Duncan Murdoch
On 14/03/2018 12:07 PM, Rich Shepard wrote: On Wed, 14 Mar 2018, Barry Rowlingson wrote: Depending on your application, I'm not sure there's much point in being an "advanced R programmer" these days. Become an adequate R programmer, and learn C++ and Rcpp. Do basic data mashing in R, then do

Re: [R] Learning advanced R

2018-03-14 Thread Rich Shepard
On Wed, 14 Mar 2018, Barry Rowlingson wrote: Depending on your application, I'm not sure there's much point in being an "advanced R programmer" these days. Become an adequate R programmer, and learn C++ and Rcpp. Do basic data mashing in R, then do all your intensive stuff in C++ with Rcpp.

Re: [R] Learning advanced R

2018-03-14 Thread Barry Rowlingson
Depending on your application, I'm not sure there's much point in being an "advanced R programmer" these days. Become an adequate R programmer, and learn C++ and Rcpp. Do basic data mashing in R, then do all your intensive stuff in C++ with Rcpp. Eventually you'll probably get to the point where

Re: [R] Warning for LC_CTYPE when R is ran through ssh

2018-03-14 Thread Jeff Newmiller
I don't think that warning is originating from R... LC_TYPE is an environment variable that the standard C library pays attention to, so could be either ssh on your local computer or ssh on the remote computer in response to something the local ssh is doing. IMO this question belongs in a

[R] R crashing with a segmentation fault: how to locate the cause

2018-03-14 Thread Eric Berger
I have a littler script which is crashing with a segmentation fault. I tried to find out why by running it through valgrind, which produced the output below. I am not sure how to proceed from here (other than binary search with print statements). Any help would be appreciated. Thanks, Eric

Re: [R] the same function returning different values when called differently..

2018-03-14 Thread Eric Berger
Hi Akshay, Presumably PFC.NS and snl[[159]] are not exactly the same. You can start by trying to determine if (and then how) they differ. e.g. > identical(PFC.NS, snl[[159]]) presumably this will result in FALSE then compare > class(PFC.NS) > class(snl[[159]]) etc HTH, Eric On Wed, Mar 14,

Re: [R] Documenting R package with Rd file

2018-03-14 Thread Duncan Murdoch
On 14/03/2018 6:10 AM, Steven Yen wrote: I have trouble documenting an R package. In my .Rd file (sixth line below), I have uhat<-m%*%y but when the package is built (successfully), the matrix multiplication part does not show up in the documentation. The line become (missing %*% y)

[R] Documenting R package with Rd file

2018-03-14 Thread Steven Yen
I have trouble documenting an R package. In my .Rd file (sixth line below), I have uhat<-m%*%y but when the package is built (successfully), the matrix multiplication part does not show up in the documentation. The line become (missing %*% y) uhat<-m === \examples{ x<-c(1,2,3,4,5)

[R] Warning for LC_CTYPE when R is ran through ssh

2018-03-14 Thread Marc Girondot via R-help
Dear member, When I run a code on a computer B from a computer A through shh using for example: system("ssh login@IPadress \"R -e 'print(1)'\"") [Note that I don't need indicate password because ~/.ssh/authorized_keys is used] I get a warning: During startup - Warning message: Setting

Re: [R] Possible Improvement to sapply

2018-03-14 Thread Doran, Harold
Well thanks, Martin, and glad to see there is some potential here. This wasn¹t reported as a bug, but as you note really as a question originally and with an invitation to critique my code. On 3/14/18, 5:11 AM, "Martin Maechler" wrote: >> Henrik Bengtsson

Re: [R] Possible Improvement to sapply

2018-03-14 Thread Martin Maechler
> Henrik Bengtsson > on Tue, 13 Mar 2018 10:12:55 -0700 writes: > FYI, in R devel (to become 3.5.0), there's isFALSE() which will cut > some corners compared to identical(): > > microbenchmark::microbenchmark(identical(FALSE, FALSE), isFALSE(FALSE)) >

Re: [R-es] Leer csvs de Carpeta

2018-03-14 Thread Pedro Herrero Petisco
Hola, por si te sirve yo hago la lectura de ficheros con este script: ruta<-"Tu_Carpeta" ficheros <- list.files(path=ruta) ficheros<-paste(ruta,"/",ficheros,sep="") datos <- do.call(rbind, lapply(ficheros, function(x) read.csv2(x))) Saludos El 14 de marzo de 2018, 6:00, Nacho García

Re: [R] Learning advanced R

2018-03-14 Thread Eric Berger
Bert's suggestion is good as a pointer to a variety of resources. Sticking to the book format there are two of Hadley Wickham's books, which have the advantage that they are freely available. You can either read them online or download the source from github and create your own copy (which you can