Re: [R] Help with non standard evaluation and require function

2016-08-14 Thread Luca Cerone
Winsemius" wrote: > > > On Aug 12, 2016, at 8:57 AM, Luca Cerone wrote: > > > > Hi everybody, > > I am having a hard time in understanding how to deal with non standard > > evaluation and the require function. > > > > I asked about it on Sta

[R] Help with non standard evaluation and require function

2016-08-12 Thread Luca Cerone
Hi everybody, I am having a hard time in understanding how to deal with non standard evaluation and the require function. I asked about it on Stackoverflow at http://stackoverflow.com/questions/38922012/r-function-to-install-missing-packages, below you can find my question. Thanks a lot for the h

Re: [R] Concatenate two lists replacing elements with the same name.

2016-07-20 Thread Luca Cerone
thanks a lot for the help! On Tue, Jul 19, 2016 at 7:20 PM, Gabor Grothendieck wrote: > Try this: > > Reduce(modifyList, list(x, y, z)) > > On Tue, Jul 19, 2016 at 12:34 PM, Luca Cerone wrote: >> Dear all, >> I would like to know if there is a function to con

[R] Concatenate two lists replacing elements with the same name.

2016-07-19 Thread Luca Cerone
Dear all, I would like to know if there is a function to concatenate two lists while replacing elements with the same name. For example: x <- list(a=1,b=2,c=3) y <- list( b=4, d=5) z <- list(a = 6, b = 8, e= 7) I am looking for a function "concatfun" so that u <- concatfun(x,y,z) returns: u$a

[R] R hist density wrong?

2015-11-18 Thread Luca Cerone
Dear all, this is probably a very naive question but I can't understand what hist() means by density. A very simple example: h <- hist(c(1,1,2,3), plot=F) h$counts [1] 2 1 0 1 h$density [1] 1.0 0.5 0.0 0.5 The counts are as I expect, but density is quite puzzling for me. I would have expected

Re: [R] Installing different R versions

2015-10-08 Thread Luca Cerone
versions of R at different > platforms, of course including Linux) > > Wolfgang > > 2015-10-07 9:04 GMT+02:00 Loris Bennett : > >> Dear Luca, >> >> Luca Cerone writes: >> >> > Dear all, >> > on one shared machine we have an older R versi

[R] Installing different R versions

2015-10-06 Thread Luca Cerone
Dear all, on one shared machine we have an older R version installed. Some packages have known issues with that version that are fixed in newer R versions. Since that is a production machine with many jobs running we would like to keep things as they are. However I would also like to keep advantag

Re: [R] Using names in function with ellipsis (non standard evaluation?)

2015-05-28 Thread Luca Cerone
unction(x,y=3)x+y > >> g(fru,x=2) ## default y used > [1] 5 > >> g(fru,x=2,y=7) ## y argument given explicitly > [1] 9 > > > Please pardon the noise if this is irrelevant. > > Cheers, > Bert > > On Thu, May 28, 2015 at 12:17 PM, Duncan Murdoch > wrote:

Re: [R] Remove entry with sensitive information from history

2015-05-28 Thread Luca Cerone
t; cat("Hello world!\n") > } > > This won't work if someone does: > > foo <- update_password > > and calls foo(). Then you need to use a more clever filter function, > e.g. one that drops the last call, which may be spread out on multiple > lines so not

[R] Using names in function with ellipsis (non standard evaluation?)

2015-05-28 Thread Luca Cerone
Hi everybody, this is probably a silly question, but I can't find a way to recognize the names that are passed to variables in ellipsis. For example, say I have a "core" function that receives some extra parameters through ... e.g. f <- function(...) { params <- c(...) #dothehardworkhere u

[R] best way to handle database connections from within a package

2015-05-28 Thread Luca Cerone
Dear all, I am writing a package that is a collection of queries to be run against a postgresql database, so that the users do not have to worry about the structure of the database. In my package I import dbDriver, dbUnloadDriver, dbConnect, dbDisconnect from the package DBI and dbGetQuery from th

Re: [R] Remove entry with sensitive information from history

2015-05-27 Thread Luca Cerone
Hi David, thanks, but the function has to work from an R shell, I have no graphical server in my remote machines. On Wed, May 27, 2015 at 9:45 AM, David Winsemius wrote: > > On May 27, 2015, at 12:29 AM, Luca Cerone wrote: > >> Hi everybody, >> >> in one of my packages

[R] Remove entry with sensitive information from history

2015-05-27 Thread Luca Cerone
Hi everybody, in one of my packages I store encrypted password. If the user has to change the password in use she can run: update_password(old_password, new_password) The problem is that the commands ends up in the .Rhistory file. Is there any way I can avoid this? Any suggestion about it? Ch

Re: [R] Template Engine for R

2015-05-18 Thread Luca Cerone
n CRAN called infuser that may meet your needs > > > -- > One who is in a dying condition is regarded as a living person in all > respects. > -- Maimonides > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Luca Cerone >

Re: [R] Template Engine for R

2015-05-16 Thread Luca Cerone
On Sat, May 16, 2015 at 5:17 PM, Henrik Bengtsson wrote: > _any text-based formats_, That's exactly what I am looking for then :) I have to create a set of .txt templates. 90% of the time I just will have to do simple "tags" substitutions, but there are some times where I'll need some control fl

Re: [R] Template Engine for R

2015-05-16 Thread Luca Cerone
son wrote: > See http://cran.r-project.org/package=R.rsp > > Henrik > (author) > > On Fri, May 15, 2015 at 11:34 PM, Luca Cerone wrote: >> Dear all, >> I am looking for a template engine for R. >> >> I have already come across {{mustache}} and its R implement

Re: [R] Template Engine for R

2015-05-16 Thread Luca Cerone
rch Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > On May

[R] Template Engine for R

2015-05-15 Thread Luca Cerone
Dear all, I am looking for a template engine for R. I have already come across {{mustache}} and its R implementation whisker, however I am looking for something with a few more features like "if blocks", "for loop", "block inheritance" and so on (for those of you who are familiar with Python I am

Re: [R] Obfuscate AES password

2015-04-16 Thread Luca Cerone
some use to you. > > Rob > > > On 4/13/2015 1:26 AM, Luca Cerone wrote: >> >> Thanks Jeff, >> and OK I'll move next questions on the topic to the devel list :) >> >> I was hoping there were packages that already dealt with this sort of >> things,

Re: [R] Obfuscate AES password

2015-04-13 Thread Luca Cerone
Thanks Jeff, and OK I'll move next questions on the topic to the devel list :) I was hoping there were packages that already dealt with this sort of things, that's why I posted my question here in the first place.. Thanks a lot for helping me with this, Cheers, Luca [[alternative HTML v

Re: [R] Obfuscate AES password

2015-04-12 Thread Luca Cerone
trollers) .OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > On April 12, 2015 8:11:46 AM PDT, Luca Cerone wrote: >>Hi, I need some help with obfuscating AES key on Windows, Linux and >>Mac. >>I have asked the same question on stackoverflow, b

[R] Obfuscate AES password

2015-04-12 Thread Luca Cerone
Hi, I need some help with obfuscating AES key on Windows, Linux and Mac. I have asked the same question on stackoverflow, but since I didn't receive any input I have decided to post it here too. You can find my question at: http://stackoverflow.com/questions/29580742/protect-aes-key-used-in-r-code

[R] devtools: install_git hangs on Windows

2015-03-03 Thread Luca Cerone
Hi, I am trying to setup R on a Windows 7 64b machine, but despite I have followed the instructions for Windows (installing Rtools, building the package etc), whenever I try to use install_git and install_url, RStudio (and R) hangs. I have identified the issues being with: system("git clone ..

Re: [R] Folder size

2015-03-01 Thread Luca Cerone
of course you can substitute "." with a path to your folder.. and you might want to set fullnames = TRUE and maybe include.dirs = TRUE in list.files On Sun, Mar 1, 2015 at 12:59 PM, Luca Cerone wrote: > Hi Christopher, > > sum(file.info(list.files(".", all.files =

Re: [R] Folder size

2015-03-01 Thread Luca Cerone
Hi Christopher, sum(file.info(list.files(".", all.files = TRUE, recursive = TRUE))$size) should do the trick. Cheers, Luca On Sun, Mar 1, 2015 at 12:33 PM, Christofer Bogaso wrote: > Hi again, > > I am wondering if there is any way to extract the Folder size. For > example, I want to get infor

Re: [R] Rstudio: is it possible to create a document out of a working script?

2014-06-22 Thread Luca Cerone
.OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > On June 21, 2014 2:05:08 AM PDT, Luca Cerone wrote: >>Dear all thank you very much for all the advices and help :) >>I think that Rstudio formats do

Re: [R] Rstudio: is it possible to create a document out of a working script?

2014-06-21 Thread Luca Cerone
Dear all thank you very much for all the advices and help :) I think that Rstudio formats do what I need! 2014-06-21 3:31 GMT+02:00 David Winsemius : > > On Jun 20, 2014, at 2:40 AM, Luca Cerone wrote: > >> Hi Berend, sorry if it OT (though I think that the process is pretty

Re: [R] Rstudio: is it possible to create a document out of a working script?

2014-06-20 Thread Luca Cerone
ith lots of functions, and > then call the ones you need, as you need them. > > Bob > > On 20 June 2014 11:20, Luca Cerone wrote: >> >> Dear all, >> I am very happy with the new features introduced by Rstudio about how >> to create documents embedding R code. >

[R] Rstudio: is it possible to create a document out of a working script?

2014-06-20 Thread Luca Cerone
Dear all, I am very happy with the new features introduced by Rstudio about how to create documents embedding R code. I would like to know though if there is some way to embed code from a working script into an Rmd document. I have several working scripts for which I would like to report the resul

Re: [R] Add points to subplots

2014-06-18 Thread Luca Cerone
e saved into 'mypars'. I > chose to save all the parameters from every old plot in case more than > what is shown is needed, this could be used to go back 3 or 4 plots if > more than just 2 are plotted. > > Try this with pamr.plotcv to see if it works (you may need to set some

Re: [R] Defining default method for S3, S4 and R5 classes

2014-06-16 Thread Luca Cerone
thanks Suzen 2014-06-15 2:34 GMT+02:00 Suzen, Mehmet : > There is a nice tutorial on this: > http://adv-r.had.co.nz/OO-essentials.html > > For an in depth guide, have a look at the book from John Chambers, > Software for data analysis programming with R. > > On 13 June 20

[R] Defining default method for S3, S4 and R5 classes

2014-06-13 Thread Luca Cerone
Dear all, I am writing a script implementing a pipeline to analyze some of the data we receive. One of the steps in this pipeline involves clustering the data, and I am interested in studying the effects of different clustering algorithms on the final results. I am having issues making my code g

Re: [R] Add points to subplots

2014-06-13 Thread Luca Cerone
On Jun 12, 2014, at 8:06 AM, Luca Cerone wrote: > >> Dear all, >> I am running some analysis using the pamr package (available on CRAN). >> >> One of the plots I produce is made using the function "pamr.plotcv". >> This displays two plots in the same figure (

[R] Add points to subplots

2014-06-12 Thread Luca Cerone
Dear all, I am running some analysis using the pamr package (available on CRAN). One of the plots I produce is made using the function "pamr.plotcv". This displays two plots in the same figure (using par(mfrow=c(2,1)). When the figure is created, I would like to be able to add some points and lin

[R] Redefine `[` for S3 class

2014-05-29 Thread Luca Cerone
Dear all, I have defined my own class "myclass" using S3 class styles. A myclass objects is just a matrix with some attribute attached. When I subset my myclass the resulting matrix (or vector) doesn't have the attributes attached. I would like to redefine the `[` function for myclass objects (it

Re: [R] Splitting vector elements

2014-05-21 Thread Luca Cerone
> #4 DEF 10 > #5 DEF 20 > A.K. > > > On Wednesday, May 21, 2014 5:38 AM, Luca Cerone wrote: > Hi Katherin, > the following code does the trick: > > x <- strsplit(dat," ") > df <- data.frame(p1=sapply(x, function(x) x[1]), p2 = sapply(x, > function(x)

Re: [R] Splitting vector elements

2014-05-21 Thread Luca Cerone
p1 p2 > ABC1 > ABC2 > ABC3 > DEF 10 > DEF 20 > > Kindly guide > > Katherine > > [[alternative HTML version deleted]] > > > __ > R-help@r-project.org mailing list > https://st

Re: [R] How to make a Latex table using R

2014-05-15 Thread Luca Cerone
Hi Liao, I think that the purpose of the package is actually to create the latex code to insert into Latex documents. If you want to see it displayed you have to compile it with latex; the document you have sent says that that is a gallery to show the different kind of tables you can create. 2014

Re: [R] S3 - how to implement "colnames<-"

2014-05-14 Thread Luca Cerone
hz.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. -- Luca Cerone Tel: +34 692 06 71 28 Skype: luca.cerone __ R-help@r-proj

[R] foreach (package) .combine option

2014-04-29 Thread Luca Cerone
Dear all, I am having some difficulties understanding how the .combine option in the foreach function of the "foreach" package works. I think I understand the examples in the manual using rbind, cbind and c. However if I write my own function (no particular purpose in mind, just to figure out how

[R] delay evaluation of expression

2014-04-28 Thread Luca Cerone
Dear all, in one of my packages I need to load some data from .Rdata files that are to be used from some functions (but not all off them). I would like to delay the loading of this datasets only when needed. In other cases I successfully used lazyLoad and delayedAssign(), but when I try to load a .

Re: [R] Lazy loading of CSV file

2014-04-16 Thread Luca Cerone
I just found out that the function "delayedAssign" is what I was looking for. 2014-04-16 16:51 GMT+02:00 Luca Cerone : > Hi Jeff, > thanks for your reply. > > I read about it in the documentation and I plan to build the functions to > download the csv and convert to rd

Re: [R] Lazy loading of CSV file

2014-04-16 Thread Luca Cerone
esO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > ------- > Sent from my phone. Please excuse my brevity. > > On April 16, 2014 5:10:03 AM PDT, Luca C

[R] Lazy loading of CSV file

2014-04-16 Thread Luca Cerone
Hi, in a package I am developing some functions need to use some external data. I have these data as a set of .csv files that I have placed in the inst/extdata folder. At the moment I have a file "db-internal.r" where I load all the internal databases that could be used by the functions in my pac

[R] R regular expression and locales

2014-04-16 Thread Luca Cerone
Hi everybody, I am developing some functions that use regular expressions and grepl, to check whether certain strings match a given pattern or not. In the regular expression I use some shortcuts such as [:alnum:]. Reading the documentation for regular expression there is one sentence that is not

Re: [R] Environment variable defined in .bashrc is not recognized by R

2014-04-01 Thread Luca Cerone
:25 AM, Rainer M Krug wrote: > Luca Cerone writes: > >> Dear all, >> in my .bashrc file I have set the environment variable R_HISTFILE like this: >> >> export R_HISTFILE="$HOME/.Rhistory" >> >> I then use it in my .Rprofile to have R writing all t

[R] Environment variable defined in .bashrc is not recognized by R

2014-04-01 Thread Luca Cerone
HISTFILE is not recognized by R. If I type: Sys.getenv("R_HISTFILE") the output is: "" How can I get R recognizing environment variables? Best, Luca -- Luca Cerone Skype: luca.cerone __ R-help@r-project.org mailing list https://s

Re: [R] Moving Average Non Uniform Vectors

2014-03-28 Thread Luca Cerone
points, that is not what I would expect from a smoothing procedure that removes some noise from the data... Do you have any other suggestion? Again thanks for your help; Luca Luca Cerone Tel: +34 692 06 71 28 Skype: luca.cerone On Thu, Mar 27, 2014 at 8:17 PM, jim holtman wrote: > Here is one

[R] Moving Average Non Uniform Vectors

2014-03-27 Thread Luca Cerone
?? Thanks in advance for the help! Luca Cerone Tel: +34 692 06 71 28 Skype: luca.cerone __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Luca Cerone
Thanks Duncan, I knew that, I wanted to know if there was some way not involving having to recreate the df. It is not a big issue in this case (they are not very big), but it might be problematic for big data frames. Thanks for advice on using col.names=NA. Cheers, Luca Luca Cerone Tel: +34 692

Re: [R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Luca Cerone
Thanks Ista, sorry it was a typo in my email, but in the code I have the right option. On Wed, Mar 19, 2014 at 11:58 AM, Ista Zahn wrote: > The argument is "col.names", not "colnames". > > Best, > Ista > > On Mar 19, 2014 6:14 AM, "Luca Cerone"

[R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Luca Cerone
Hi everybody, I am sorry if this is a silly question (I have tried to search it at http://tolstoy.newcastle.edu.au/R/ but I get a 404 page). I have a script writing some data.frames to csv files. I write the csv files using the write.csv function and the option row.names=TRUE. Everything works fin

[R] Updating R and Bioconductor packages in a different folder.

2014-03-06 Thread Luca Cerone
Dear all, I use R on a server on which I don't have administrative access. I would like to update some of the R and Bioconductor packages I use for my daily analysis, however some of those packages are installed system-wide. I would like to know how I can update those packages installing them in my

Re: [R] Solving Classification problems in R

2014-02-28 Thread Luca Cerone
Now I feel quite stupid :) I was assuming that since there is a "Clustering" one there would have been a "Classification" one as well :) Thanks for pointing it out to me! Luca Cerone Tel: +34 692 06 71 28 Skype: luca.cerone On Fri, Feb 28, 2014 at 6:38 PM, Prof Brian R

Re: [R] Solving Classification problems in R

2014-02-28 Thread Luca Cerone
Thanks for the advices Sergio and Jean-Olivier. Of course I forgot, but I am interested in supervised classification! I'll go through the packages you suggested to me! Any ideas for Neural Networks and Random Forests instead? Luca Cerone Tel: +34 692 06 71 28 Skype: luca.cerone On Fri, F

[R] Solving Classification problems in R

2014-02-28 Thread Luca Cerone
Dear all, I would like some advices on R packages to solve classification problems. I have tried to search among the Task views, but couldn't find anything. Can somebody recommend me some packages? Some of the features I am looking for: - deal with multiple classes - use customized cost functions

[R] enet and lars alternatives to estimate linear models with lasso regularization.

2014-02-20 Thread Luca Cerone
Dear all, I would like to fit some data (few samples and a much larger number of features), using linear regression with lasso regularization. So far I have used the packages enet and lars, that perform very well and of which I really appreciated the easy interface. Unfortunately, while on the maj