Re: [R] Voronoi/Thiessen polygon neighbors?

2014-10-29 Thread Rolf Turner
On 30/10/14 03:16, Michal Kvasnička wrote: Hello. I have a set of points in 2D. I can construct Voronoi polygons around them with deldir package and function from this page: http://stackoverflow.com/questions/9403660/how-to-create-thiessen-polygons-from-points-using-r-packages What I need is

Re: [R] reading data from a web

2014-10-29 Thread David L Carlson
You did not read the data with the commands you provided since c1 is not defined so read.fwf() fails immediately. Here is a solution that works for the link you provided, but would need to be modified for months that do not have 30 days: > lnk <- > "http://www.data.jma.go.jp/gmd/env/data/radia

[R] reading data from a web

2014-10-29 Thread Alemu Tadesse
Dear All, I have data of the format shown in the link http://www.data.jma.go.jp/gmd/env/data/radiation/data/geppo/201004/DR201004_sap.txt that I need to read. I have downloaded all the data from the link and I have it on my computer. I used the following script (got it from web) and was able to r

Re: [R] Ways to get all function signatures of a library?

2014-10-29 Thread Thorsten Jolitz
Gabor Grothendieck writes: > On Wed, Oct 29, 2014 at 9:09 AM, Thorsten Jolitz wrote: >> >> Hi List, >> >> are there ways to get signatures of all functions of a library in a >> format that is easy to process by a programm (list, xml or so)? >> >> The info about function name, return value and ar

Re: [R] problem in loop using windows executable

2014-10-29 Thread Jeff Newmiller
My suggestion is that you provide a reproducible example, as the Posting Guide requests. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Fwd: Combining stacked bar charts for logfile analysis

2014-10-29 Thread Richard M. Heiberger
Jan, Thank you for posting a reproducible example. This is my first pass at providing a stacked bar chart by time. I have placed schlecht on the negative side and both ok and gut on the positive side. I don't know what you mean by percent from this data snippet. I show how to produce a likert plo

Re: [R] Using readLines on a file without resetting internal file offset parameter?

2014-10-29 Thread William Dunlap
I agree that file's use of its 'mode' argument can be confusing. That is one reason I didn't use it my example and made an explicit call to open() after calling file() without the mode argument. (Having to distinguish between 'binary' and 'text' mode on Windows, 'rb' and 'rt' or 'wb' and 'wt', ca

[R] problem in loop using windows executable

2014-10-29 Thread Pedro Segurado
Dear all, I am trying to develop a R script that basically uses a loop that includes 5 main steps: (1) it runs a windows executable file outside R that requires a set of *.txt files using the shell function (Note: I have tried system and system(shhQuote()) and the problem remains), (2) it imports

Re: [R] Using readLines on a file without resetting internal file offset parameter?

2014-10-29 Thread Thomas Nyberg
Yeah of course you should close the file when done. I didn't give a complete code snippet. In any case, a quick glance at the documentation seems to imply that opening a file as file('filename') will defer the choice of mode (i.e. is it 'r', 'w', etc.?) until it is first used. In my case the f

[R] Variance of multiple non-contiguous time periods?

2014-10-29 Thread CJ Davies
I am trying to show that the red line ('yaw') in the upper of the two plots here; http://i.imgur.com/N4Xxb4f.png varies more within the pink sections ('transition 1') than in the light blue sections ('real'). I tried to use var.test() however this runs into a problem because although the re

[R] Fwd: Combining stacked bar charts for logfile analysis

2014-10-29 Thread Jan Vanvinkenroye
Anfang der weitergeleiteten Nachricht: Von: Jan Vanvinkenroye Datum: 29. Oktober 2014 17:52:06 MEZ Betreff: Combining stacked bar charts for logfile analysis An: r-help@r-project.org Hello Everyone, in order to assess webserver response time i would like to combine some information from a ap

Re: [R] Using readLines on a file without resetting internal file offset parameter?

2014-10-29 Thread Thomas Nyberg
Thanks for the response! I'd rather keep the file open than close it, since it would flush the internal buffer. The whole reason I'm doing this is to take advantage of the buffering and closing it would defeat the purpose. I actually just found a solution which is to open the files with the "r

Re: [R] Using readLines on a file without resetting internal file offset parameter?

2014-10-29 Thread William Dunlap
I meant you should close the file when you are done with it, not after every few lines. File descriptors are a limited resource. As for the rationale for the default behavior, there is a common use pattern of reading and parsing an entire file (or url, etc.), examining the results, and trying agai

Re: [R] Using readLines on a file without resetting internal file offset parameter?

2014-10-29 Thread William Dunlap
Open your file object before calling readLines and close it when you are done with a sequence of calls to readLines. > tf <- tempfile() > cat(sep="\n", letters[1:10], file=tf) > f <- file(tf) > open(f) > # or f <- file(tf, "r") instead of previous 2 lines > readLines(f, n=1) [1] "a"

Re: [R] Ways to get all function signatures of a library?

2014-10-29 Thread Gabor Grothendieck
On Wed, Oct 29, 2014 at 9:09 AM, Thorsten Jolitz wrote: > > Hi List, > > are there ways to get signatures of all functions of a library in a > format that is easy to process by a programm (list, xml or so)? > > The info about function name, return value and arguments (types) is all > there in the

Re: [R] Injecting a column of characters to a matrix of numerics

2014-10-29 Thread Ben Tupper
Hi, On Oct 29, 2014, at 11:41 AM, Steven Yen wrote: > Hello > I am designing a regression printout, which works out nicely. Then, I try to > inject a column of characters to indicate a discrete regressor with a dot > (.). Then, all numbers seem to turn into characters, in quotations. Is there

[R] Using readLines on a file without resetting internal file offset parameter?

2014-10-29 Thread Thomas Nyberg
Hi everyone, I would like to read a file line by line, but I would rather not load all lines into memory first. I've tried using readLines with n = 1, but that seems to reset the internal file descriptor's file offset after each call. I.e. this is the current behavior: --- bash $ echo 1

Re: [R] Injecting a column of characters to a matrix of numerics

2014-10-29 Thread Steven Yen
Wonderful. Works great! Steven Yen At 11:52 AM 10/29/2014, Kevin E. Thorpe wrote: On 10/29/2014 11:41 AM, Steven Yen wrote: Hello I am designing a regression printout, which works out nicely. Then, I try to inject a column of characters to indicate a discrete regressor with a dot (.). Then, all

Re: [R] Injecting a column of characters to a matrix of numerics

2014-10-29 Thread Kevin E. Thorpe
On 10/29/2014 11:41 AM, Steven Yen wrote: Hello I am designing a regression printout, which works out nicely. Then, I try to inject a column of characters to indicate a discrete regressor with a dot (.). Then, all numbers seem to turn into characters, in quotations. Is there a way to do this righ

[R] Injecting a column of characters to a matrix of numerics

2014-10-29 Thread Steven Yen
Hello I am designing a regression printout, which works out nicely. Then, I try to inject a column of characters to indicate a discrete regressor with a dot (.). Then, all numbers seem to turn into characters, in quotations. Is there a way to do this right? Below, I show the lines of codes bef

Re: [R] How to cite R-Project

2014-10-29 Thread Duncan Murdoch
On 29/10/2014 8:42 AM, ROCIO SASMAY MONTANO wrote: Dear Sirs I'm editorial assistant of Chilean Journal of Agricultural Research and I need to cite R-Project with the format: STATISTICA (StatSoft, Inc., Tulsa, Oklahoma, USA). Could you give me the right citation? Thanks Best regards Here's

Re: [R] Ways to get all function signatures of a library?

2014-10-29 Thread Thorsten Jolitz
Bert Gunter writes: > Perhaps the > ?formals > function in R is what you are looking for. Or maybe its (internal C) code. yes, thats a pretty good fit (and no, I'm not asking about internal C code), thanks. So now that I have ways to extract machine-readable info about an R function, how can I

[R] Voronoi/Thiessen polygon neighbors?

2014-10-29 Thread Michal Kvasnička
Hello. I have a set of points in 2D. I can construct Voronoi polygons around them with deldir package and function from this page: http://stackoverflow.com/questions/9403660/how-to-create-thiessen-polygons-from-points-using-r-packages What I need is to find the list of all polygon neighbors of

Re: [R] assigning a function within a loop

2014-10-29 Thread PIKAL Petr
Hi instead of this paste/assign/get stuff use list for keeping cycle result something like nam <- vector("list", degree) for (i in 1:degree) { nam[[i]] <- lm(y~poly(x,i,raw=TRUE)) } Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > proje

Re: [R] Ways to get all function signatures of a library?

2014-10-29 Thread Bert Gunter
Perhaps the ?formals function in R is what you are looking for. Or maybe its (internal C) code. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Wed, O

Re: [R] How to cite R-Project

2014-10-29 Thread Jeff Newmiller
Run the function citation() at the R prompt. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.

[R] Ways to get all function signatures of a library?

2014-10-29 Thread Thorsten Jolitz
Hi List, are there ways to get signatures of all functions of a library in a format that is easy to process by a programm (list, xml or so)? The info about function name, return value and arguments (types) is all there in the docs, but more in a human readable format embedded in much extra info

[R] SQL Requests Templating

2014-10-29 Thread Alexander Myltsev
Hi, I am new to R. What I'd like to know is how to empower sqldf with templates like https://www.playframework.com/documentation/2.3.x/ScalaAnorm does? What does seasoned R-hacker use for this purpose: dedicated R-package that I am not aware of, or kind of format string, or something else? A.

[R] assigning a function within a loop

2014-10-29 Thread Hanck, Christoph
Hi, I am trying to run several polynomial regressions on simulated data and produce fitted values with the pol1, pol2 functions (predict produces not so nice plots, see http://www.r-bloggers.com/polynomial-regression-techniques/). Below's a simplified version of what I try to achieve. It seems

[R] How to cite R-Project

2014-10-29 Thread ROCIO SASMAY MONTANO
Dear Sirs I'm editorial assistant of Chilean Journal of Agricultural Research and I need to cite R-Project with the format: STATISTICA (StatSoft, Inc., Tulsa, Oklahoma, USA). Could you give me the right citation? Thanks Best regards -- Rocío Sasmay M. Asistente de Edición ChileanJAR INIA Qu

[R] foreach/dopar's processes accumulate RAM

2014-10-29 Thread Alexander Engelhardt
Hello all, I have a triple nested loop in R like this: all <- list() for(a in A){ all[[a]] <- list() for(b in B){ all[[a]][[b]] <- foreach(c=C, .combine=rbind) %dopar% { ## I'm leaving out some preprocessing here this_GAM <- gam(formula, data=data, family=

Re: [R] weighting histograms

2014-10-29 Thread PIKAL Petr
Hi Your example is not reproducible as we do not have Biota_subset and have no idea what is its structure. You also do not mention any error. Most probably x and y are not what you think it is. This works as expected. testx<-sample(1:10,300,TRUE) testw<-seq(1,4,by=0.01) weighted.hist(testx,tes

Re: [R] Adding labels to ColSums

2014-10-29 Thread PIKAL Petr
Hi Most probably years.before.initiated.cat is a factor. You have basically two options. change it to character by ?as.character or add level named "Total" by levels(years.before.initiated.cat)<-c(levels(years.before.initiated.cat), "Total") Cheers Petr > -Original Message- > From:

Re: [R] Loop with ggplot2 not as simple as it seems...

2014-10-29 Thread PIKAL Petr
Hi Patricia You are somewhat circling around solution. Is this what you wanted? for (i in 5:7) { plotname = paste("Graph", names(scores)[i], sep="") png(paste0(plotname,".png")) p <- ggplot(scores, aes(x=scores[,i], fill=gender )) print(p+ geom_density(alpha=.3)+xlab(names(scores)[i])) d