similar to: Sourcing functions

Displaying 20 results from an estimated 10000 matches similar to: "Sourcing functions"

2009 Oct 04
1
Modify base R functions in Rprofile.site
Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: parse=function(...){ base::parse(...) } I'll get an error when I start R as follows: Error: cannot change value of locked binding for
2009 Sep 07
2
Writing R Scripts and passing command line arguments
Hi Guys I am Abhishek, primarily a bioinformatician. I have recently started using a lot of R thanks to some excellent packages available. Lately I have felt the need to batch process few of the R scripts I have been working with and strangely enough I am not able to find a good resource on how to best do this. I did find few old threads on the archives but none convinced me much. So here I am
2009 Jul 24
4
Include files?
Hi, I have 15 or 20 functions I've written to convert the sort of data I'm working with. They are currently in their own R file which I load by hand in Rgui before loading and running my main programs. Is there any way to have this file included in my R program like #include might in C? If not is there a simple newbie-type example of how to create a package so I could just say
2009 Oct 29
5
R crashes
My R crashes frequently when run with huge data. -- View this message in context: http://www.nabble.com/R-crashes-tp26110355p26110355.html Sent from the R help mailing list archive at Nabble.com.
2008 Oct 14
3
gWidgets install
Hi, I wanted to install the gWidgets package and ran the following code: ------------------------------------------ > install.packages("gWidgets") trying URL 'http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.7/gWidgets_0.0-30.zip' Content type 'application/zip' length 1354268 bytes (1.3 Mb) opened URL downloaded 1.3 Mb package 'gWidgets'
2009 Nov 16
3
Error on reading an excel file
Hello everybody, here is the code I use to read an excel file containing two rows, one of date, the other of prices: library(RODBC) z <- odbcConnectExcel("SPX_HistoricalData.xls") datas <- sqlFetch(z,"Sheet1") close(z) It works pretty well but the only thing is that the datas stop at row 7530 and I don?t know why datas is a data frame that contains 7531 rows with the
2009 Feb 06
3
Sweave and backslashes
Hello Everyone, I am an avid Sweave user and I am trying to pretty print floating point numbers for latex output. For example in my document, I would like: 4.2\cdot 10^-{8} Instead of: 4.2e-08 The Hmisc package has a nice function for doing this- but Hmisc has a ton of dependencies and has proved very unportable to the various machines I work on. So, I set out to write my own function that
2009 Jul 19
4
space in column name
I read a table from Microsoft Access using RODBC. Some of the variables had a name with a space in it. R has no problem with it but I do. I cannot find out how to specify the space names(alltime) [1] "ID" "LVL7" "Ref Pv No" "Ref Pv Name" "DOS" "Pt Last Name" "Pt First Name" "MRN"
2010 Mar 26
4
Creating a vector of categories
Hi, I have a column in a data frame looking something like: $sex $language $count male english 0 male english 0 female english 32 male spanish 154 female english 11 female norweigan 7 and so on. What I want to do is to order these in to categories, for instance one category where count>=0 & count<10 and so on.. I want my data to turn out looking something like: male
2010 Oct 18
1
Incorrect positioning of raster images on Windows
I am working on dumping raster data from R into PNG files using rasterImage(). I am working with a test matrix from the rasterImage() example and using it to produce a PNG image with the following code: # From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard. testImage <- as.raster(0:1, nrow=3, ncol=5) testImage [,1] [,2] [,3] [,4] [,5] [1,]
2010 Oct 18
1
Incorrect positioning of raster images on Windows
I am working on dumping raster data from R into PNG files using rasterImage(). I am working with a test matrix from the rasterImage() example and using it to produce a PNG image with the following code: # From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard. testImage <- as.raster(0:1, nrow=3, ncol=5) testImage [,1] [,2] [,3] [,4] [,5] [1,]
2009 Oct 13
2
splitting dataframe, assign to new dataframe, add new rows to new dataframe
Hi, all, My objective is to split a dataframe named "cmbine" according to the value of "classes". After the split, I will take the first instance from each class and bin them into a new dataframe, "df1". In the 2nd iteration, I will take the 2nd available instance and bin them into another new dataframe, "df2". >cmbine$names apple tiger pencil chicken
2007 Nov 01
3
Curry: proposed new functional programming, er, function.
Hi all (especially R-core) I suppose, With the introduction of the new functional programming functions into base I thought I'd ask for a Curry() function. I use a simple one that looks this: Curry = function(FUN,...) { .orig = list(...);function(...) do.call(FUN,c(.orig,list(...))) } This comes in really handy when using say, heatmap():
2009 Sep 14
4
Location of Packages?
Sorry, one more: on OSX, I deleted my old 2.9.2 R.app, and installed the 64 bit version of 2.9.0. I then did an "install.packages("car")" under my new 2.9.0. It seems to have worked, but alas, I still get an error that package 'car' was built under R version 2.9.2 . Where exactly does R under OSX install its packages? (is it a bug that another car is loaded?) PS:
2012 Jan 11
1
Inconsistencies in device_Raster when axes are reflected
I noticed some undocumented and inconsistent behavior in device_Raster when a plot is produced with reflected axes such as: image(volcano, xlim = c(1,0), useRaster = TRUE) image(volcano, ylim = c(1,0), useRaster = TRUE) The `pdf` device will perform horizontal and vertical reflections, while `quartz` will ignore the transformations when plotting to the screen, but when plotting to a
2010 Apr 22
1
Rtools for building 64 bit windows packages
Hello R developers, I sincerely apologize if the answer to this question is clearly documented somewhere, but I was unable to figure it out over my morning coffee. I just downloaded today's release of R 2.11.0 and installed it on my Windows 7 64 bit VM. I also downloaded the latest version of Rtools211 from Professor Murdoch's site. The first thing I attempted to do was build some of
2011 Apr 07
1
R 2.13.0-beta for Windows, file.copy() throws suspicious errors due to default value of copy.mode
While checking packages against R 2.13.0-beta on Windows, I have run into a few strange error messages related to copying files. The errors all relate to file.copy() and have the form of: Error in Sys.chmod(to[okay], file.info(from[okay])$mode, TRUE) : 'mode' must be of length at least one After half a day of tinkering, the best reproducible example I can come up with involves using
2010 Apr 09
5
SSH Through R Script
Hi, I am trying to SSH to a remote server through R script. In other words, I would like to know how I can get a SSH connection to the remote server and then execute commands on that server with the R script. So in bash, I would normally type ssh -lusername remoteserver.com; press enter and then wait for the password prompt to key in my password. I have tried system("ssh
2010 Apr 28
1
How to create R package
Hi, Can you tell me how to create R package in Windows, and give me an example that works ? Thanks. [[alternative HTML version deleted]]
2009 Aug 10
1
R to MATLAB translation
Hi, Is there any package out there that might help me with translating R code into MATLAB? Using RSiteSearch I found a bunch of "MATLAB stuff" but it all seems to go in the opposite direction, i.e., emulating MATLAB functions in R. Thanks in advance, Andy __________________________________ Andy Jaworski 518-1-01 Process Laboratory 3M Corporate Research Laboratory ----- E-mail: