similar to: PBSmodelling: Change the "edit" option of a widget

Displaying 20 results from an estimated 600 matches similar to: "PBSmodelling: Change the "edit" option of a widget"

2010 Apr 19
2
How to pass a list of parameters into a function
Does anyone know how to pass a list of parameters into a function? for example: somefun=function(x1,x2,x3,x4,x5,x6,x7,x8,x9){ ans=x1+x2+x3+x4+x5+x6+x7+x8+x9 return(ans) } somefun(1,2,3,4,5,6,7,8,9) # I would like this to work: temp=c(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9) somefun(x1=1,x2=2,temp) # OR I would like this to work: temp=list(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9)
2010 Jul 09
3
apply is slower than for loop?
I thought the "apply" functions are faster than for loops, but my most recent test shows that apply actually takes a significantly longer than a for loop. Am I missing something? It doesn't matter much if I do column wise calculations rather than row wise ## Example of how apply is SLOWER than for loop: #rm(list=ls()) ## DEFINE VARIABLES mu=0.05 ; sigma=0.20 ; dt=.25 ; T=50 ;
2010 May 10
3
update.packages fails with directory not found
Windows XP. I have just updated to R 2.11.0 and then run update.packages. In the series of updates, a few will succeed, then I get a failure like package 'mvtnorm' successfully unpacked and MD5 sums checked package 'party' successfully unpacked and MD5 sums checked package 'PBSmodelling' successfully unpacked and MD5 sums checked Error in normalizePath(path) :
2011 Dec 07
2
curve fitted ... how to retreive data
Dear R users, I have now managed to fit the curve using the thin plate spline as follows: library(mgcv) b <- gam(y~s(x1,x2,k=100),data =dat) vis.gam(b) What I want now is to get the fitted data for y and copy it so that I use it for further analysis. Many thanks in advance mintewab
2013 Mar 12
2
funtion equivalent of jitter to move figures on device
hello all, I'm overlaying numerous scatter plots onto a map (done in PBSmodelling). In this case I'm placing each plot by setting par(fig) to the centroid of map polygons. The location/mapping part is not so important. There are cases of small overlaps for some plots (ie figures) so I'm keen to write or find a function that moves my small scatter plots so they don't overlap. A
2009 Mar 13
2
Using format to add leading zeroes
I have a numerical vector which contains a (poorly) formatted time column, which, in theory, should be HHMM, but was distributed as an integer, so, for 12:15 am, it is saved as "15" (e.g. HHMM = 0015 with the zeroes stripped). I'm trying to use this in conjunction with strptime, but I'm thinking because each time is an integer ranging from 1 to 4 digits, I probably need to
2011 Aug 29
3
replacing elements of a zoo object
Why doesn't this work? x = zoo(1:5, as.Date('2001-01-01')+1:5) x[as.Date('2001-01-05')] x[as.Date('2001-01-05')] = 0 x I think this is especially bad because it doesn't cause an error. It lets you do something to x, but then you can't see x again to see what it did. [[alternative HTML version deleted]]
2011 Sep 06
2
Possible to access a USB volume by name in windows
On the Mac it's pretty easy to get to a USB drive by name. For example the following command works if you have a USB drive named "MYUSB" setwd('/Volumes/MYUSB') Is there a way to do the same thing in Windows (without knowing the drive letter)? Thanks! [[alternative HTML version deleted]]
2011 Dec 06
2
read.table performance
** Disclaimer: I'm looking for general suggestions ** I'm sorry, but can't send out the file I'm using, so there is no reproducible example. I'm using read.table and it's taking over 30 seconds to read a tiny file. The strange thing is that it takes roughly the same amount of time if the file is 100 times larger. After re-reviewing the data Import / Export manual I think
2011 Dec 06
2
To Try or to TryCatch, I have tried to long
So after about 4 hours struggling with Try and TryCatch I am throwing in the towel. I have a more complicated function that used logspline through iterative distributions and at some point the logspline doesnt function correctly for some subsets but is fine with others so I need to be able to identify when the error occurs and stop curtailing the distribution and I think this Try or TryCatch
2011 Sep 26
4
Testing for arguments in a function
I don't understand how this function can subset by i when i is missing.... ## My function: myfun = function(vec, i){ ret = vec[i] ret } ## My data: i = 10 vec = 1:100 ## Expected input and behavior: myfun(vec, i) ## Missing an argument, but error is not caught! ## How is subsetting even possible here??? myfun(vec) Is there a way to check for missing function arguments, *and*
2011 Feb 23
4
The L Word
I've been wondering what L means in the R computing context, and was wondering if someone could point me to a reference where I could read about it, or tell me what it's called so that I can search for it myself. (L by itself is a little too general for a search term). I encounter it in strange places, most recently in the "save" documentation. save(..., list = character(0L),
2009 Jul 22
3
How to replace NAs in a vector of factors?
# Just when I thought I had the basic stuff mastered.... # This has been quite perplexing, thanks for any help ## Here's the example: db1=data.frame( olditems=c('soup','','','','nuts'), prices=c(4.45, 3.25, 4.42, 2.25, 3.98)) db2=data.frame( newitems=c('stew','crackers','tofu','goatsmilk','peanuts'))
2011 Feb 04
4
aggregate function - na.action
Can someone please tell me what is up with na.action in aggregate? My (somewhat) reproducible example: (I say somewhat because some lines wouldn't run in a separate session, more below) set.seed(100) dat=data.frame( x1=sample(c(NA,'m','f'), 100, replace=TRUE), x2=sample(c(NA, 1:10), 100, replace=TRUE), x3=sample(c(NA,letters[1:5]), 100, replace=TRUE),
2010 Sep 15
3
Keyword to clear the screen
Hi all, can anyone please tell me what is the key-word to clear the screen? I am aware of the "cont+L", however I need some R-syntax, that can be typed into the console to clear the screen.   Thanks [[alternative HTML version deleted]]
2011 May 20
8
Building Custom GUIs for R
I am looking to build simple GUIs based on the R codes I have. The main objective is to hide the scary R codes from non-programming people and make it easier for them to try out different inputs. For example, 1. The GUI will have means to upload a csv file which will be read by the R code. 2. A button to preprocess data (carried out by a R function behind) 3. A button to build some models
2010 Feb 17
1
Dock graphs when using R in Eclipse with StatET plug In
Does anyone know how to dock graphics windows in Eclipse when using the StatET plug-in for R? Right now every time I make a graph it pops up as a separate window, which takes up too much real estate. By the way, if you have not tried the StatET thing, you should. It's really nice, and I'm sure I'm not even using all the bells and whistles. The "automatic variable
2009 Sep 04
1
where did ggplot go?
This must be explained somewhere, but I've been searching for a couple of hours and not found it. What happened to ggplot? It appears to be missing on CRAN, except in the archives. http://cran.r-project.org/web/packages/ggplot/index.html Has ggplot2 replaced ggplot? I was trying to run some examples and found that "pscontinuous" and "ggline" are not part of ggplot2.
2011 Jan 12
2
Require
I think that the "quietly" argument in "require" isn't working > require('JumboShrimp', quietly=TRUE) Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'JumboShrimp' > By the way, the behavior is the same with options(warn=0) or options(warn=1) I'm using R 2.12
2011 Jan 25
1
ggplot - controlling point size
Can anyone illuminate the following for me? How can I get rid of the blue line in the key in the second plot? ## Create a simple data frame df=data.frame(x=1:1000, y=2*1:1000+rnorm(1000,sd=1000), type=sample(letters[1:2],1000, replace=TRUE)) ## Very nice! Almost what I want qplot(x, y, data=df, colour=factor(type)) + geom_smooth() ## Make a nicer plot, with smaller points ## but why