Re: [R] [External] Re: Removing polygons from shapefile of Scotland and Islands

2024-05-17 Thread Barry Rowlingson
Scotland is the second feature in the UK data, so get it and split this one MULTIPOLYGON feature into individual POLYGONS scot = st_cast(the_uk$geometry[2],"POLYGON") # which is the largest polygon? which.max(st_area(scot)) [1] 1 # the first one. ok... plot(scot[[1]]) # mainland # add the rest

Re: [R] [External] Amazing AI

2022-12-21 Thread Barry Rowlingson
Next year one of my R programming assigments will read like this: "Here is some R code written by a multi-million dollar AI system to compute [something]. It doesn't work. Fix the bugs, then ask the AI to write a letter to its creators apologising for how rubbish it is at coding. Collect one milli

Re: [R] [External] Re: Is there a canonical way to pronounce CRAN?

2022-05-05 Thread Barry Rowlingson
If the founders had called it the Big R Archive Network we wouldn't be having this discussion but we'd all be getting our packages from BRAN. Or how about "Big R Internet Archive Network" Or would that be confusing... Barry On Wed, May 4, 2022 at 3:51 PM Kevin Thorpe wrote: > This email or

Re: [R] Greek characters in R studio

2019-04-10 Thread Barry Rowlingson
What have you tried? read.table works perfectly for me with no language or encoding arguments. Here's a text file at the Linux command line: $ cat greek.csv α, β 1,2 3,4 I just have to tell it to use comma separators and there is a header line. Here's R: > read.table("./greek.csv",sep=",",head=T

Re: [R] getting 21 very different colours

2018-09-11 Thread Barry Rowlingson
On Tue, Sep 11, 2018 at 11:43 AM, Duncan Murdoch wrote: > On 11/09/2018 3:34 AM, Federico Calboli wrote: > > Hi All, > > > > I am plotting a scatterplot of 21 populations, and I am using > rainbow(21)[pops.col] to generate 21 colours for the plot (which works). > Maybe it is because I can really

Re: [R] security using R at work

2018-08-09 Thread Barry Rowlingson
On Thu, Aug 9, 2018 at 9:14 AM, Jan van der Laan wrote: > You can also inadvertently transmit data to the internet using a package > without being obviously 'stupid', e.g. by using a package that uses an > external service for data processing. For example, some javascript > visualisation libs can

Re: [R] security using R at work

2018-08-08 Thread Barry Rowlingson
On Wed, Aug 8, 2018 at 4:09 PM, Laurence Clark wrote: > Hello all, > > I want to download R and use it for work purposes. I hope to use it to > analyse very sensitive data from our clients. > > My question is: > > If I install R on my work network computer, will the data ever leave our > network

Re: [R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-04 Thread Barry Rowlingson
I'm having deja-vu of a similar discussion on R-devel: https://stat.ethz.ch/pipermail/r-devel/2018-July/076377.html This was the funniest inconsistency I could find: > sum(c(NaN,NA)) [1] NaN > sum(NaN,NA) [1] NA THEY'RE IN THE SAME ORDER!!! The doc in ?NaN has this clause: In R, basi

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 yo

Re: [R] reading lisp file in R

2018-01-18 Thread Barry Rowlingson
The file also has a bunch of email headers stuck in the middle of it: . (QUALITY-OF-LIFE SCALE:1-5 4) (ACADEMIC-EMPHASIS HEALTH-SCIENCE) ) --- --- >From lebow...@cs.columbia.edu Mon Feb 22 20:53:02 1988 Received: from zodiac by meridian (5.52/4.7) Received: from Jessica.Stanford.

Re: [R] Vibration signal prediction in R

2017-08-24 Thread Barry Rowlingson
On Thu, Aug 24, 2017 at 7:07 AM, David Winsemius wrote: > > > On Aug 23, 2017, at 10:06 PM, Dhivya Narayanasamy > wrote: > > > > I have a vibration signal coming accelerometer. I converted this signal > from* > > m/s^2* to *mm/s*. Now I am supposed to predict this vibration signal in R > > using

Re: [R] Beginner’s Question

2017-06-12 Thread Barry Rowlingson
On Mon, Jun 12, 2017 at 2:39 AM, Neil Salkind wrote: > Please excuse the naive question but my first hour with RStudio, resulted in > this… > >> data() >> data(“women”) > Error: unexpected input in "data(�” > > So,that did not work but > >>data(women) > > without the quotes did. > > Would someone

Re: [R] Whitespace

2017-05-01 Thread Barry Rowlingson
That looks like an error from Stan parsing your stan file, but the code you put in the message doesn't look like Stan code, it looks like R code, so maybe you've tried to parse your R code with Stan There's no mention of stan in the code either, like the rstan package, so somehow you've got a

Re: [R] help on readBin in R

2017-04-17 Thread Barry Rowlingson
There's very little justification for attaching binary files to a mailing list these days - share it on Dropbox, or Box, or Hubic, or whatever MS or Google's cloud storage is, or simply tell us where it was obtained from originally. And to the original poster - some more context is very useful - w

Re: [R] Deploying R on the cloud - Help Please

2017-04-01 Thread Barry Rowlingson
On Fri, Mar 31, 2017 at 10:43 PM, Axel Urbiz wrote: > Hello, > > I work for a large organization who is looking to productionize (deploy) > models built in R on the cloud. Currently, we were looking into IBM > Bluemix, but I’ve been told only Python is supported for model deployment. > > I’d appre

Re: [R] commercial license

2016-09-12 Thread Barry Rowlingson
Why do you want a commercial license? The software is free of charge and free to use anywhere. If you want support of some kind, then you need to spell this out - there are companies and consultants who will support your R work for a price. On Mon, Sep 12, 2016 at 8:39 AM, benjamin.stoc...@daiml

Re: [R] How to reach the column names in a huge .RData file without loading it

2016-03-18 Thread Barry Rowlingson
You *might* be able to get them from the raw file... First, I don't quite know what "colnames" of an .RData file means. "colnames" are the column names of a matrix (or data frame), so I'll assume your .RData file contains exactly one data frame and you want to column names of it. So let's create

Re: [R] divide polygon shapefile into 3 equal areas

2016-02-29 Thread Barry Rowlingson
vertically and have 3 distinct areas of equal >> area. So I need to chop it up into 3 areas of equal size essentially. >> >> There is no tool to do it in QGIS!! >> >> Thanks >> >> On Mon, Feb 29, 2016 at 5:51 PM, Barry Rowlingson < >> b.rowling

Re: [R] divide polygon shapefile into 3 equal areas

2016-02-29 Thread Barry Rowlingson
On Mon, Feb 29, 2016 at 5:37 PM, Shane Carey wrote: > Hi, > > Is it possible to divide a polygon into 3 equal areas using R? Yes, in an infinite number of ways. Want to narrow it down? Specifically, you could slice it vertically, horizontally, or at any angle between. You could chop it into sq

Re: [R] Error opening SHP file

2016-01-22 Thread Barry Rowlingson
We can duplicate the error by giving a path to a non-existent shapefile, which is probably the original problem: > require(maptools) Loading required package: maptools Loading required package: sp Checking rgeos availability: TRUE > foo=readShapeSpatial("fnord.shp") Error in getinfo.shape(fn) :

Re: [R] (no subject)

2015-10-04 Thread Barry Rowlingson
lists in R can have multiple elements with the same name but if you try and access elements by name you only get the first. For example: > a = list(x=99, x=23, x=456) > a$x [1] 99 Its just the way it is. Note you might find the `str` function useful to see the structure of R objects: > str

Re: [R] names in R list's

2015-09-07 Thread Barry Rowlingson
On Mon, Sep 7, 2015 at 11:34 AM, Witold E Wolski wrote: > What is the access time for R lists given a name of list element, is it > linear, log, or constant? Try it and see? > Than what are to rules for names in R-lists > > That reusing names is possible makes me wonder. > > tmp <- as.list(c(1,

Re: [R] R command to open a file "browser" on Windows and Mac?

2015-08-03 Thread Barry Rowlingson
And for completeness, on linux: system(paste0("xdg-open ",getwd())) there's a function in a package somewhere that hides the system dependencies of opening things with the appropriate application, and if you pass a folder/directory to it I reckon it will open it in the Explorer/Finder/Nautilus//x

Re: [R] API request from R

2015-02-19 Thread Barry Rowlingson
On 19 Feb 2015 20:11, "Robert Baer" wrote: > > > On 2/19/2015 8:06 AM, Barry Rowlingson wrote: >> >> On Wed, Feb 18, 2015 at 11:44 AM, Mittal Ashra via R-help >> wrote: >>> >>> Dear All, >>> Apologies for mailing it to the whole cro

Re: [R] API request from R

2015-02-19 Thread Barry Rowlingson
On Wed, Feb 18, 2015 at 11:44 AM, Mittal Ashra via R-help wrote: > Dear All, > Apologies for mailing it to the whole crowd. This is Mittal, presently > working in a Project where we have build a platform for displaying > recommendations and the results are based on the statistical models. > I ha

Re: [R] Interview questions?

2015-01-11 Thread Barry Rowlingson
Ask if they have a favourite R programmer. This will tell you how much into the R culture they are, and perhaps also tell you if their opinions of a good programmer concur with yours... On 11 Jan 2015 16:49, "Keith S Weintraub" wrote: > Folks, > > I was wondering if anyone has put together a list

Re: [R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-23 Thread Barry Rowlingson
obligatory dplyr solution: library(dplyr) zeroes = Test %>% group_by(ID) %>% summarise(Zs=all(X==0)) - that gives you a data frame of unique ID and Zs==TRUE if that ID has all zeroes. With that you just sum(zeroes$Zs) to get the total number with all zeroes. Or add "%>% filter(Zs) %>% nrow()" t

Re: [R] Count number of Fridays in a month

2014-10-10 Thread Barry Rowlingson
Or try this: fridays <- function(the_day){ require(lubridate) day(the_day) = 1 the_month = seq(the_day, the_day+months(1)-days(1),1) sum(wday(the_month) == 6) } That returns the number of Fridays in the month of a Date object given as arg: > fridays(as.Date("2012-01-01")) [1] 4 >

Re: [R] Parliament Seats Graph

2014-09-12 Thread Barry Rowlingson
= election(layout, c(200,200,49)) # no overall majority!!! >> plot(result$x, result$y, col=result$party,pch=19, asp=1) > > Looks like a start... > > > On Fri, Sep 12, 2014 at 12:41 PM, Duncan Murdoch > wrote: >> On 12/09/2014, 7:18 AM, Barry Rowlingson wrote:> On F

Re: [R] Parliament Seats Graph

2014-09-12 Thread Barry Rowlingson
PM, Duncan Murdoch wrote: > On 12/09/2014, 7:18 AM, Barry Rowlingson wrote:> On Fri, Sep 12, 2014 at > 11:25 AM, Jim Lemon wrote: >> >>> I can see how you would plot the points going from right to left (the > easy >>> way), by plotting the next point on the ar

Re: [R] Parliament Seats Graph

2014-09-12 Thread Barry Rowlingson
On Fri, Sep 12, 2014 at 11:25 AM, Jim Lemon wrote: > I can see how you would plot the points going from right to left (the easy > way), by plotting the next point on the arc with the least increase in > angle from the last point plotted. If this is the way you have worked out, I > think all that

Re: [R] How to get source code of a package

2014-09-05 Thread Barry Rowlingson
On Fri, Sep 5, 2014 at 8:01 AM, madhvi.gupta wrote: > Hi, > Can anyone tell me how to get source code of a package of R? > I want to integrate elastic search with R if there is any way please let > me know or give me a direction to do that. Which R packages do you want source code for? I should

Re: [R] Operator proposal: %between%

2014-09-05 Thread Barry Rowlingson
On Fri, Sep 5, 2014 at 12:28 AM, David Winsemius wrote: > If you are accepting feature requests The R issue tracker has a "wishlist" section: https://bugs.r-project.org/bugzilla3/buglist.cgi?component=Wishlist&order=changeddate%20DESC%2Cbug_status%2Cpriority%2Cassigned_to%2Cbug_id&product=R&que

Re: [R] loading saved files with objects in same names

2014-08-20 Thread Barry Rowlingson
On Tue, Aug 19, 2014 at 1:30 AM, Jinsong Zhao wrote: > Hi there, > > I have several saved data files (e.g., A.RData, B.RData and C.RData). In > each file, there are some objects with same names but different > contents. Now, I need to compare those objects through plotting. > However, I can't find

Re: [R] R License

2014-05-26 Thread Barry Rowlingson
On Sat, May 24, 2014 at 4:11 PM, Juan Ulises Bohorquez Carvajal wrote: > Thanks, could you send to me an official certificate in pdf with this > information? Or a certified email to support the information license? And what would be the authority that supplies such a certificate? R is not the pr

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Barry Rowlingson
On Fri, May 16, 2014 at 4:46 PM, Witold E Wolski wrote: > Dear Jari, > > Thanks for your reply... > > The overhead would be > 2 for loops > for(i in 1:dim(x)[2]) > for(j in i:dim(x)[2]) > > isn't it? Or are you seeing a different way to implement it? > > A for loop is pretty expensive in R. Theref

Re: [R] Making a trial based Package for 30-days.

2014-05-12 Thread Barry Rowlingson
On Mon, May 12, 2014 at 3:45 PM, Spencer Graves wrote: >One company I know installed an S-Plus or R package only on > servers, so their customers had to use it on a server. (In this case, > the customers had a GUI and may not have known that it was S-Plus or R > behind it.) This company

Re: [R] Making a trial based Package for 30-days.

2014-05-12 Thread Barry Rowlingson
On Mon, May 12, 2014 at 1:11 PM, Ashis Deb wrote: > Well it's the company requirement to do so , and give it on a trial > basis to client to check , if they like they will BUY or it will self > destruct itself , No, if they like it they will BUY or they will CIRCUMVENT your self-de

Re: [R] Making a trial based Package for 30-days.

2014-05-12 Thread Barry Rowlingson
On Mon, May 12, 2014 at 10:31 AM, Ashis Deb wrote: > Hi all , > > >I have a GUI package , which I want to make it > work for a certain period,say-30days ,after which it should be self > destructive . > > Could it be possible ?? > Yes. But why bother? Can y

Re: [R] as.character(quote(x$y) ) = "$" "x" "y" not "x$y"?

2014-05-10 Thread Barry Rowlingson
On Fri, May 9, 2014 at 10:42 PM, Hadley Wickham wrote: > Beware of the is.* functions: > > * is.object() does not test the usual definition of objects > * is.vector() does not test the usual definition of vectors > * is.numeric() does not work the same way as is.character() or is.integer() > * is.

Re: [R] R and GML data from the Canadian Goverment

2014-05-02 Thread Barry Rowlingson
You want to have a look at the R Spatial Task View for starters... GML files can be read by the rgdal package's readOGR function. But be warned GML is a complex beast. For example, I downloaded canvec_gml_AB_EN.zip from that site, it unzips to a GML (and an xsd) with a lot of layers, some of

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Barry Rowlingson
On Tue, Apr 8, 2014 at 4:30 PM, Frede Aakmann Tøgersen wrote: > > I'm a bit surprised about the \\ on a linux OS. I'm also surprised that in > a file manager on Windows you can paste e.g. C:/users/frtog/Desktop and it > can find its way to the folder. Weird. > > Well, the clipboard contained a pa

Re: [R] Ignore escape characters in a string...

2014-04-08 Thread Barry Rowlingson
On Tue, Apr 8, 2014 at 4:00 PM, Jonathan Greenberg wrote: > C:\Program Files\R\R-3.0.3 Does R on windows have clipboard support? I can do this on Linux: > readLines(file("clipboard")) [1] "C:\\Program Files\\R\\R-3.0.3" - that's from a copy of a path with only single slashes in. But help(conn

Re: [R] Data file verification protocol

2014-03-19 Thread Barry Rowlingson
On Wed, Mar 19, 2014 at 4:03 AM, Wolf, Steven wrote: > Hi R users, > > This isn't a R-specific issue, per-se, but I thought that this list would > have some helpful input on this topic. First, a bit of background. I am > working on a project which is interested in following approx 1000 students

Re: [R] regular pentagon

2014-03-09 Thread Barry Rowlingson
On Sun, Mar 9, 2014 at 5:11 AM, Rolf Turner wrote: > On 08/03/14 10:22, Yuanzhi Li wrote: > > Hello, everyone, > > > > Do you have any idea to get a set of random points within a regular > > pentagon? Thanks in advance! > > You can easily do this using the spatstat package. > Or with sines, cos

Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an R-beginners list?)

2014-02-05 Thread Barry Rowlingson
On Wed, Feb 5, 2014 at 6:32 AM, Liviu Andronic wrote: > So in the end my proposal is not necessarily for r-help to go to SE, > but more for R to have its own Q&A forum/wiki for helping R users. > This could perfectly take the form of setting up its own open-source > https://github.com/ialbert/bio

Re: [R] creating an equivalent of r-help on r.stackexchange.com ?

2014-02-03 Thread Barry Rowlingson
As one of the original ranters of "hey lets move to StackOverflow" a few years back (see my UseR! lightning talk from Warwick) I should probably stick my oar in. I don't think the SO model is a good model for all the discussions that go on on R-help. I think SO is a good model for questions that

Re: [R] (no subject)

2014-02-02 Thread Barry Rowlingson
On Sun, Feb 2, 2014 at 6:46 AM, Rolf Turner wrote: > On 02/02/14 15:37, mohammad javad Azadchehr wrote: >> Hi >> I want R code for bayesian CIF competing risks. >> best regards > > I want wealth, wisdom, good looks, and to play full forward for the > Sydney Swans. One out of four isn't bad. To

Re: [R] plotting points over a map using R

2014-01-31 Thread Barry Rowlingson
Try reading the R Spatial Task View: http://cran.r-project.org/web/views/Spatial.html or this brilliant intro, and other files in that github repository: https://github.com/Robinlovelace/Creating-maps-in-R/blob/master/intro-spatial.md or any of the tutorials I've written on the subject! Barry

Re: [R] sourcing scripts

2014-01-29 Thread Barry Rowlingson
On Wed, Jan 29, 2014 at 9:26 AM, Ahmed M. El-Kenawy wrote: > Error in memory.size(min = TRUE) : unused argument (min = TRUE) It looks like you've simply typed 'min=TRUE' instead of 'max=TRUE' somewhere! Somewhere other than the code you sent in the message, which had max=TRUE. Must be in one of

Re: [R] Basic misunderstanding, or problem with my installation?

2014-01-01 Thread Barry Rowlingson
On Wed, Jan 1, 2014 at 4:36 AM, David Parkhurst wrote: > Thanks to the three people who saw what I missed. I typed my > code in Libre Office as "<" followed by "-", and that program > converted those two characters into a single left arrow symbol. > I copied the commands from Libre into R without

Re: [R] unique mismatch in R and Excel

2013-12-25 Thread Barry Rowlingson
We answered this on StackOverflow already. Excel was doing case-insensitive duplicate matching. http://stackoverflow.com/questions/20759346/counting-unique-values-in-r-and-excel/20759523#20759523 Barry On Tue, Dec 24, 2013 at 5:43 PM, David Winsemius wrote: > > On Dec 24, 2013, at 1:08 AM, Kous

Re: [R] 3D Surface plot

2013-12-18 Thread Barry Rowlingson
On Wed, Dec 18, 2013 at 2:52 PM, Simon Delay-Fortier wrote: > Hi everyone, > > I am a very new user of r (doing most of my previous stuff in vba). I am now > mandated to draw a 3-d surface of a mine pit hole. I have all the location > points (around 5000 points) of the pit in a CSV file under 3

Re: [R] read.csv interpreting numbers as factors

2013-12-10 Thread Barry Rowlingson
On Tue, Dec 10, 2013 at 10:06 AM, Jeff Newmiller wrote: > It is bad netiquette to hijack an existing thread for a new topic. Please > start a new email thread when changing topics. > > If your data really consists of what you show, then read.csv won't behave > that way. I suggest that you open t

Re: [R] specify breaks in divergent palette in RColorBrewer: was divergent colors around zero in levelplot()

2013-11-26 Thread Barry Rowlingson
On Tue, Nov 26, 2013 at 9:58 AM, Prof Brian Ripley wrote: >> But the image function (and probably levelplot) doesn't allow that so > > Mis-information alert! The help says > > col: a list of colors such as that generated by ‘rainbow’, >‘heat.colors’, ‘topo.colors’, ‘terrain.

Re: [R] specify breaks in divergent palette in RColorBrewer: was divergent colors around zero in levelplot()

2013-11-26 Thread Barry Rowlingson
On Tue, Nov 26, 2013 at 1:02 AM, C. Alina Cansler wrote: > Don, > > This looks helpful: > https://stat.ethz.ch/pipermail/r-help/2011-March/272361.html Yes, he's a helpful chap. The fundamental problem here is the colour palette. When I was a boy all we had was a pen plotter with four coloured p

Re: [R] Should there be an R-beginners list?

2013-11-25 Thread Barry Rowlingson
Joran (on StackOverflow chat, funnily enough) has just pointed us to this: http://www.win.tue.nl/~bvasiles/papers/cscw14.pdf "How Social Q&A Sites are Changing Knowledge Sharing in Open Source Software Communities" which includes a graph of postings to R-help and questions tagged '[r]' on StackO

Re: [R] Should there be an R-beginners list?

2013-11-25 Thread Barry Rowlingson
If you want a vision of an R-beginners list, it is a boot stamping "ITS IN THE DOCUMENTATION" into a newbies face - forever. http://www.brainyquote.com/quotes/quotes/g/georgeorwe159438.html slight exaggeration perhaps, but most R-beginners would benefit from reading a bit more documentation and "

Re: [R] quotation marks and scan

2013-11-17 Thread Barry Rowlingson
On Sun, Nov 17, 2013 at 10:42 PM, R. Michael Weylandt wrote: > They're not actually there so don't try too hard to rid yourself of them: > > x <- "\'" > > length(x) > print(x) > cat(x, "\n") Did you mean to do 'nchar(x)' to show that \" was one character? 'length' gives the number of elements i

Re: [R] how to derive true surface area from `computeContour3d' (misc3d package) -- follow up

2013-11-08 Thread Barry Rowlingson
On Fri, Nov 8, 2013 at 1:01 PM, j. van den hoff wrote: > ps: it of course would still be nice, if the surface area (or a vector > containing the individual triangle areas) > were returned to the caller as well ... Does the 'surfaceArea' function in the sp package do what you want? It's Edzer's

Re: [R] Questions about R

2013-11-06 Thread Barry Rowlingson
On Wed, Nov 6, 2013 at 5:44 PM, Ye Lin wrote: > You can get details at http://www.r-project.org/ > > But to answer your question: Yes it is free But there is also a paid version. Send me $1000 and I will send you R on a USB stick, complete with all the source code. Seriously, other companies d

Re: [R] Basic question: why does a scatter plot of a variable against itself works like this?

2013-11-06 Thread Barry Rowlingson
Interestingly, fitting an LM with x on both sides gives a warning, and then drops it from the RHS, leaving you with just an intercept: > lm(x~x,data=d) Call: lm(formula = x ~ x, data = d) Coefficients: (Intercept) 4 Warning messages: 1: In model.matrix.default(mt, mf, contrasts) : t

Re: [R] convert one digit numbers to two digits one

2013-11-06 Thread Barry Rowlingson
All these suggestions of using 'sprintf' might be right but you might be doing it wrong... If you are working with times, then use the date/time classes and the handy functions for working on them. Which means the lubridate package, most likely. Are these times part of a calendar time, or are the

Re: [R] ascii-grid export

2013-11-06 Thread Barry Rowlingson
On Mon, Nov 4, 2013 at 7:27 AM, Enzo Cocca wrote: > yes barry I really need this. > > I tried to use raster or rgdal but with poor results. > > I have this function: > > VGM_PARAM_A3 <- gstat(id="bos_bison", > formula=combusto~1,locations=~coord_x+coord_y, data=archezoology_table, > nmax = 10) > >

Re: [R] Download CSV Files from EUROSTAT Website

2013-11-05 Thread Barry Rowlingson
On 4 Nov 2013 19:30, "David Winsemius" wrote: > Maybe you should use their "download" facility rather than trying to deparse a complex webpage with lots of special user interaction "features": > > http://appsso.eurostat.ec.europa.eu/nui/setupDownloads.do > That web page depends on the user alrea

Re: [R] ascii-grid export

2013-11-02 Thread Barry Rowlingson
Or do you mean you want to write the gridded output of an interpolation you did (perhaps using kriging) in gstat as an ESRI ASCII Grid file for reading into a GIS? If so, you can probably do it with writeGDAL from the rgdal package, or writeRaster from the raster package. I don't really know what

Re: [R] Code Book from SPSS Data

2013-10-27 Thread Barry Rowlingson
On Sat, Oct 26, 2013 at 9:37 PM, Peter Maclean wrote: > I do not have SPSS and I would like to create a code book in a data frame > format using R. > #How could I extract a codebook (without Summary statistics for printing)? This isn't that clear because I don't think 'codebook' is something w

Re: [R] May I send a zip attachment to a post?

2013-10-22 Thread Barry Rowlingson
On Mon, Oct 21, 2013 at 10:51 PM, David Winsemius wrote: > > On Oct 21, 2013, at 2:15 PM, Hurr wrote: > >> May I send a .zip file attached to a post? > > No. That's not explicit from the posting guide: "No binary attachments except for PS, PDF, and some image and archive formats " you have to

Re: [R] What is the difference between Reduce(…) and do.call(…) ?

2013-10-08 Thread Barry Rowlingson
On Tue, Oct 8, 2013 at 10:22 AM, Asis Hallab wrote: > Dear R-Experts, > So, what is the difference between Reduce and do.call and when best to > use which? >From the help: ‘Reduce’ uses a binary function to successively combine the elements of a given vector and a possibly given initial va

Re: [R] Importing odf file into R

2013-10-04 Thread Barry Rowlingson
On Fri, Oct 4, 2013 at 5:57 AM, Peter Maclean wrote: > Anyone aware of a package or technique to import odf data file into R, I will > appreciate his/her help. A quick scan of R-help points me here: http://www.omegahat.org/ROpenOffice/ Reports of that working (or not) would be appreciated - I'

Re: [R] Understanding classes in R

2013-09-29 Thread Barry Rowlingson
On Sun, Sep 29, 2013 at 10:48 PM, john doe wrote: > I am having trouble understanding how classes in R work. Here is a small > reproducable example: > >> x=1 >> class(x) > [1] "numeric" > > OK. When a variable is a number, its class is "numeric". Does R have > multiple types for numbers, like C

Re: [R] Combining rasters

2013-09-06 Thread Barry Rowlingson
[Probably an R-Sig-geo question...] On Fri, Sep 6, 2013 at 3:57 PM, philippe massicotte wrote: > Hi everyone. > > I would like to know if it is possible to combine rasters in R to form a > "collage". > > For example, I would like to place 2 copies of the R logo side by side. > > > r = raster(s

Re: [R] GO TO function in R

2013-08-02 Thread Barry Rowlingson
No. We figured this out in 1968. http://dl.acm.org/citation.cfm?doid=362929.362947 On Fri, Aug 2, 2013 at 3:20 AM, David Winsemius wrote: > > On Aug 1, 2013, at 6:58 PM, Peter Maclean wrote: > >> Does R has a GO TO function? For example, I want to run this script at a >> given interval and save

Re: [R] Plotting gps coordinates on Shapefile

2013-06-13 Thread Barry Rowlingson
On Thu, Jun 13, 2013 at 6:26 AM, L S wrote: > I realized that the coordinates are completely different. The coordinates > in my data file (i.e. my csv file) are traditional GPS coordinates (e.g. 39.17 > or 76.37). The shapefile however has x,y values such as 1416813.54262877 > or 561125.5466027

Re: [R] Loading an .RData file and assigning the loaded objects within a loop

2013-06-01 Thread Barry Rowlingson
Within lapply load the file and return the value of the thing or things in the file you want. Something like this: > files [1] "x1.RData" "x2.RData" "x3.RData" "x4.RData" > lapply(files,function(z){load(z);x}) [[1]] [1] 1 [[2]] [1] 22 [[3]] [1] 333 [[4]] [1] Each of my files contains a

Re: [R] Help retrieving only Portuguese words from a file

2013-05-28 Thread Barry Rowlingson
On Tue, May 28, 2013 at 5:02 PM, Rui Barradas wrote: > Hello, > > And some words exist in Portuguese, Spanish and English, the three > languages of the problem. For instance, "animal". I don't think this > problem can be solved, but a dictionary search would tell if it is a > Portuguese word, whic

Re: [R] Execution of larger blocks of pasted code often fails?

2013-05-28 Thread Barry Rowlingson
On Tue, May 28, 2013 at 7:54 AM, Mark Breman wrote: > Hello List, > > When i paste a large block of R code from an editor to the R command line > the execution of the code will often fail at some point because it is not > pasted as it was copied. This reminds me of the Tommy Cooper joke (I can't

Re: [R] spatially analyzing multiple data layers

2013-05-25 Thread Barry Rowlingson
On Sat, May 25, 2013 at 7:09 PM, Amy Henry wrote: > Hi, I started using R about 3 months ago so please excuse my ignorance. I > have two datasets. The first consists of 247 fixed position mosquito traps > that were serviced weekly for 23 weeks. The second is dengue incidence data > indexed to home

Re: [R] Transform Coordinate System of an ASCII-Grid

2013-05-23 Thread Barry Rowlingson
On Thu, May 23, 2013 at 8:44 AM, jas wrote: > Dear all, > > > I have an ASCII-Grid for Switzerland in the Swiss National Coordinate System > of CH1903. Now for a Webapplication of the ASCII-Grid, I need to deliver the > ASCII-Grid in the WGS84 System. > > Via coordinates(ascii) I can "export" the

Re: [R] peering inside functions in a package?

2013-05-16 Thread Barry Rowlingson
On Fri, May 17, 2013 at 2:56 AM, Seth Myers wrote: > Let's say I would like to look inside the function corBrownian in library > (ape). When I type in the function name I get the following, which is not > nearly the detail that goes into this function. I am wondering how to > begin cracking thi

Re: [R] Trouble with reading xml in R

2013-04-30 Thread Barry Rowlingson
On Tue, Apr 30, 2013 at 5:12 PM, Dorte Klerke wrote: > > Hi I have been trying for days now to read the contents of this xml file into > R. I tried the simpler solution xmlToDataFrame, which worked on another > file, but somehow it doesn't work for this file. > > How is this possible? How is t

Re: [R] 3D Histograms on a Geographical Map

2013-04-19 Thread Barry Rowlingson
On Fri, Apr 19, 2013 at 3:13 PM, Lorenzo Isella wrote: > Dear All, > I like very much figure 2.a) and 2.b) of this paper > > http://www.nature.com/srep/2013/130410/srep01640/pdf/srep01640.pdf > > > and I probably need a similar visualization. > Is anything like that doable in R? I have some experi

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Barry Rowlingson
On Tue, Apr 16, 2013 at 5:43 PM, Bert Gunter wrote: > Hadley: > > I don't think this is appropriate. Think of what it would be like if everyone > shilled their R training and consulting wares here. Everyone does, don't they? A search on Nabble shows up regular postings from XLSolutions, Mango us

Re: [R] produce a map in ARCGIS from a GAM output

2013-04-12 Thread Barry Rowlingson
On Fri, Apr 12, 2013 at 10:37 AM, Lauria, Valentina wrote: > Hi, > > I am trying to predict the habitat suitability of lobster with GAMs. I need > to produce a map in ArcGis of the predicted densities. I did some search and > the function predict.gam seems to do the job. > > Is this the right wa

Re: [R] speedometer charts in R

2013-04-03 Thread Barry Rowlingson
On Tue, Apr 2, 2013 at 4:00 PM, R. Michael Weylandt wrote: > Look at the R GoogleVis package. Or read what Hadley W had to say on a similar question first: "The question would why would you want to? You are trying to understand your data, not driving a race car or aeroplane. " - http://r.7

Re: [R] edit.data() read-only?

2013-03-26 Thread Barry Rowlingson
On Tue, Mar 26, 2013 at 10:09 AM, Ted Harding wrote: > Greetings All. > > The function edit.data() allows a convenient spreadsheet-like > view of a dataframe with too many rows/columns to fit on the > screen (especially when there are many columns). Very useful > when scanning through a dataset (r

Re: [R] Feedback – Regarding R Programming Language Version 2.15.1 (2012-06-22) Usage

2013-03-09 Thread Barry Rowlingson
On Sat, Mar 9, 2013 at 5:11 PM, R. Michael Weylandt wrote: > Please do not massively cross-post and provide a reproducible example > (search stack overflow or other sites for advice on how to do so) > > I _guarantee_ you R is not broken in this sense. I would put money on the original post being

Re: [R] Excel User interface for R

2013-03-05 Thread Barry Rowlingson
On Mon, Mar 4, 2013 at 1:39 PM, Tammy Ma wrote: > > HI, > > Assume I have the data frame generated from R as the following: > > Product Price market_share > A 10010% > B 1109% > C 12020% > D 90 61% > >

Re: [R] Commercial or not?

2013-02-21 Thread Barry Rowlingson
On Thu, Feb 21, 2013 at 9:52 AM, Pancho Mulongeni wrote: > Hi All, > Let's say someone uses an R package (prefer to not disclose which) that comes > with two different distributions,the commercial and non-commercial license. > Now the non commercial license has conditions,bit it never runs out.

Re: [R] Cramer von Mises test for a discrete distribution

2013-02-20 Thread Barry Rowlingson
On Wed, Feb 20, 2013 at 10:03 AM, Santiago Guallar wrote: > Thanks Barry, > > Following your list order > 1) It pops up a window saying R for windows GUI front-end crashed. Below > three options: look for on-line solutions; shut down the program; debug the > program (I'm translating from Spanish)

Re: [R] Cramer von Mises test for a discrete distribution

2013-02-19 Thread Barry Rowlingson
On Tue, Feb 19, 2013 at 2:49 PM, Santiago Guallar wrote: > Hi, > > I'm trying to carry out Cramer von Mises tests between pairs of vectors > belonging to a discrete distribution (concretely frequencies from 0 to 200). > However, the program crashes in the attempt. The problem seems to be that >

Re: [R] Help with functions as arguments

2013-02-12 Thread Barry Rowlingson
On Tue, Feb 12, 2013 at 7:30 AM, Ian Renner wrote: > Where I am running into trouble is when I want to call function f1 within > function f2: > > f2(x = 3, z = f1(x)) > > This returns the error: > > "Error in f1(x) : object 'x' not found" > > I'm not sure how to define environments within the fu

Re: [R] Deques in R

2013-02-11 Thread Barry Rowlingson
On Mon, Feb 11, 2013 at 9:42 PM, Barry Rowlingson wrote: > but I can't find it on CRAN now... > > http://cran.r-project.org/web/packages/Containers/ > > so you could hook the code out of the archives and find out if it still > works... I just looked at the DESCRIPTION

Re: [R] Deques in R

2013-02-11 Thread Barry Rowlingson
On Mon, Feb 11, 2013 at 5:20 PM, Michael Holt wrote: > I've been searching for information on using deques in R for the past couple > of days. What little I've found has pointed me towards either the Rcpp > package or the cpp project on R-forge > (https://r-forge.r-project.org/projects/cpp/), b

Re: [R] help with creating new variables using a loop

2013-02-07 Thread Barry Rowlingson
On Thu, Feb 7, 2013 at 4:16 PM, christel lacaze wrote: > > Hi there, > > I've got a set of 10 numeric variables called Mood1 to Mood10 in a dataset > called mood. That's where you went wrong in the first place. Don't use variable names for indexing purposes. You should have created one variab

Re: [R] developing package: dealing with namespaces

2013-02-04 Thread Barry Rowlingson
On Mon, Feb 4, 2013 at 6:23 PM, Duncan Murdoch wrote: > On 04/02/2013 12:59 PM, Ross Boylan wrote: >> I am tweaking an R package for which I have the source; the relevant code >> is in R not C. I'm making changes to the package code. >> >> What is the best workflow for doing this? I recall the

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 3:00 PM, Simon Zehnder wrote: > Hi Barry, > > this actually a good idea, to put them together! Probably even creating an > object containing both of them. Haven't thought about it before. > Hadley W asked for implementations of 'unstructuring assignments' the other day,

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
> it lets you do: > > (a~b~c) = foo() Mistook. should be: (a~b~c) %=% foo() because it defines the %=% operator. Barry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 11:52 AM, Simon Zehnder wrote: > Dear R community, > > I do know, that an R function is constructing a copy of any object passed as > argument into a function. I program on a larger S4 project for a package, and > I arrived at a point where I have to think a little harder

Re: [R] Approximating discrete distribution by continuous distribution

2013-01-22 Thread Barry Rowlingson
On Tue, Jan 22, 2013 at 11:49 AM, Michael Haenlein wrote: > I would like to find a continuous approximation of this discrete > distribution in order to estimate the probability that a person is for > example 16 years old. Given that people age continuously (and continually...), you sound like y

  1   2   3   4   5   6   7   >