Re: [R] appending to a vector

2011-04-14 Thread Jonathan P Daily
a for loop, your second example is faster since it does not rewrite x2 each iteration. An excellent reference on this subject and many other R pitfalls is 'The R Inferno' http://lib.stat.cmu.edu/s/Spoetry/Tutor/R_inferno.pdf -- Jonathan P. Daily Technician

Re: [R] Using help in Windows version of R with disabled browser

2011-04-12 Thread Jonathan P Daily
try: options(help_type = 'text') ?options If this works, you can create a site profile (A default is created automatically in windows, if I remember correctly) where you can set this to run in each session. -- Jonathan P. Daily Technician - USGS Leetown

Re: [R] RExcel

2011-04-11 Thread Jonathan P Daily
It is asking the obvious, but did you run the commands from the rcom package after installation (see inline ***s)? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

Re: [R] Estimates at each iteration

2011-04-08 Thread Jonathan P Daily
called limiter. HtoH, Jon -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread Jonathan P Daily
Would options(error = recover) be of some help? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do

Re: [R] Using graphics straight from R into published articles

2011-03-29 Thread Jonathan P Daily
I think you should google search Sweave, as well as check out the ?Sweave page. Not to mention the graphics devices that embed quite nicely into documents, like ?postscript. HTH, Jon -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown

Re: [R] passing arguments via ...

2011-03-29 Thread Jonathan P Daily
? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly r

Re: [R] ) Error in eval(expr, envir, enclos) : object '' not found

2011-03-23 Thread Jonathan P Daily
It looks like your column name has periods in it somewhere. Is your header separated by something other than commas? look at: names(data.sex) or test by age %in% names(data.sex) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] memory increasing

2011-03-22 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly r-help

Re: [R] Understanding tryCatch

2011-03-18 Thread Jonathan P Daily
tryCatch will only execute it's error function on errors. If you are getting warnings, you may find it helpful to set: options(warn = 2) ?options tryCatch(warning(!), error = function(x) print(Error!)) -- Jonathan P. Daily Technician - USGS Leetown Science

Re: [R] a question

2011-03-16 Thread Jonathan P Daily
-- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly r-help-boun

Re: [R] Scope of variable?

2011-03-16 Thread Jonathan P Daily
?cat cat prints text, and returns an invisible NULL. Also, it is general practice to assign values using '-' even inside of functions, for reasons detailed in ?- -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV

[R] (no subject)

2011-03-15 Thread Jonathan P Daily
to do this? Thanks, Jon PS I apologize if this double-sends, but I am having mail client issues. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does

Re: [R] Keyboard Input

2011-03-15 Thread Jonathan P Daily
through the results of a large simulation. As I think about it more, though, it is probably going to be easier to dump the data into files and look through it outside of R. Thanks anyways, Jon -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649

Re: [R] indeterminate for loop

2011-03-15 Thread Jonathan P Daily
?while You don't want a for loop. You need a while loop. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have

Re: [R] Keyboard Input

2011-03-15 Thread Jonathan P Daily
Solved. Thanks. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] tryCatch - Continuing for/next loop after error

2011-03-10 Thread Jonathan P Daily
-- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal

Re: [R] tryCatch - Continuing for/next loop after error

2011-03-10 Thread Jonathan P Daily
: -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early

Re: [R] tryCatch - Continuing for/next loop after error

2011-03-10 Thread Jonathan P Daily
I did not know that. When reading the help topic for the first time myself, I think I assumed that it returned no value since it had no Value section, and I haven't used it in a way that it would return a value. -- Jonathan P. Daily Technician - USGS Leetown

Re: [R] sum of variables in function

2011-03-10 Thread Jonathan P Daily
How about: x - rnorm(1000) fn - function(k) sum(x[1:k]*(x[k+1] + x[k+2])) vals - sapply(1:100, fn) vals -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its

Re: [R] Complex sampling?

2011-03-09 Thread Jonathan P Daily
-- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal

Re: [R] generate 3 distinct random samples without replacement

2011-03-07 Thread Jonathan P Daily
would this work? s - sample(d1, 300, F) D - data.frame(a = s[1:100], b = s[101:200], c = s[201:300]) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty

Re: [R] Probabilities greather than 1 in HIST

2011-03-03 Thread Jonathan P Daily
If you read ?hist, you will answer your own question. The issue in your code is the parameter prob = T, which does nothing. By default, hist reports density. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV

Re: [R] Vector manipulations

2011-03-02 Thread Jonathan P Daily
Is this what you want? I don't know what your v looks like, but this won't work if there are cases in which v won't sum to exactly x. x - 20 v - sample(0:1, 100, T) w - v[1:which(cumsum(v)==x)] -- Jonathan P. Daily Technician - USGS Leetown Science Center

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal

Re: [R] bootstrap resampling - simplified

2011-03-02 Thread Jonathan P Daily
(bigsamp == x)[1:5])))[1:20] samp - bigsamp[idx] I apologize for my lack of clarity, though after reading the original post I'm not sure which solution the OP was looking for. Cheers, Jon -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649

Re: [R] bootstrap resampling question

2011-03-01 Thread Jonathan P Daily
: bigsamp - sample(1:20, 100, T) idx - sort(unlist(sapply(1:20, function(x) which(bigsamp == x)[1:5])))[1:20] samp - bigsamp[idx] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still

Re: [R] Variable names AS variable names?

2011-02-25 Thread Jonathan P Daily
To access a variable by a character string name, try for(code in codes) { dat - get(code) [stuff] } Other options include ?assign if you need to manipulate the original, or ?with to use the subject of codes as an environment. -- Jonathan P. Daily Technician

Re: [R] Running code sequentially from separate scripts (but not functions)

2011-02-24 Thread Jonathan P Daily
(code3.r) # Use this to run anytime eval(run1) eval(run2) eval(run3) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself

Re: [R] create dummy variables by for loop

2011-02-24 Thread Jonathan P Daily
See inline below. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] Using string to call/manipulate an object

2011-02-23 Thread Jonathan P Daily
-- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early

Re: [R] R script HELP!

2011-02-18 Thread Jonathan P Daily
It looks to me like when you assign ID_min and ID_max that you want them to be vectors. In R, this is accomplished by ?c. Example: ID_min - c(976834501, 290018099.3145, 1000) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] R script HELP!

2011-02-18 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly r-help-boun...@r

Re: [R] CDF of Sample Quantile

2011-02-14 Thread Jonathan P Daily
-- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly r-help-boun...@r

Re: [R] help - the condition has length 1 and only the first element will be used

2011-02-10 Thread Jonathan P Daily
The issue here is that if only accepts a single True/False argument. Try these functions: ?ifelse ?all ?any -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its

Re: [R] R-/Text-editor for Windows?

2011-01-31 Thread Jonathan P Daily
if you just use RTerm/RGui by replacing all the instances of Console with the appropriate R executable. [1]www.autohotkey.com [2]sourceforge.net/projects/console -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430

Re: [R] R-/Text-editor for Windows?

2011-01-28 Thread Jonathan P Daily
hand, geany is cross platform. As always, EMACS + ESS and Vim are also options. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing

Re: [R] Quantile Regression: Extracting Residuals

2011-01-19 Thread Jonathan P Daily
Try looking here: ?rq.object ?residuals R has excellent documentation that can answer many such questions with less than a minute of reading. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724

Re: [R] Question about histogram

2011-01-13 Thread Jonathan P Daily
that a randomly chosen computer is running Ubuntu? Density is more universal, IMO. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Jonathan P Daily
a - rey lo ong charrr Although the indentation is just personal preference. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Jonathan P Daily
, pch = 5, cex = .75) num - ((a1 + a2 + a3)/b1 + (a4 + a5 + a6)/b2) / b3 -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Jonathan P Daily
charrr, sep = ) print(a) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] matrices call a function element-wise

2011-01-03 Thread Jonathan P Daily
IIRC, R is perfectly able to call matrices as vectors, so you might be able to do this: FT - function(i) fisher.test(matrix(c(A[i],B[i],C[i],D[i]),2)) E - sapply(1:100, FT) Though I don't know how much time you will save. -- Jonathan P. Daily Technician

Re: [R] randomForest speed improvements

2011-01-03 Thread Jonathan P Daily
analysis. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] Windows editor suggestions - autosave

2010-12-29 Thread Jonathan P Daily
for myself in AutoHotKey in about 2 mins), it has a ton of other options and is cross-platform. Geany: www.geany.org -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

Re: [R] Faster way to do it??...using apply?

2010-12-28 Thread Jonathan P Daily
I don't know if it's any faster, but it is also possible this way: y - ifelse(x ==1, round(runif(x)), sign(x)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when

Re: [R] Fitting a Triangular Distribution to Bivariate Data

2010-12-23 Thread Jonathan P Daily
)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly r-help-boun...@r

Re: [R] How to optimize function parameters?

2010-12-20 Thread Jonathan P Daily
as a wrapper to many optimization algorithms and offers methods to compare them side-by-side. Good luck, Jon -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty

Re: [R] How to optimize function parameters?

2010-12-20 Thread Jonathan P Daily
If you can somehow add the sign of the output to the root square error, nlm, nlminb, and many options within optimx accept bounds. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480

Re: [R] Alter plot point size by value of the plot value

2010-12-17 Thread Jonathan P Daily
Assuming your plot values are X and Y: cex.val - 1 + (Y 1E-6)*.5 - (Y 1E-3)*.5 plot(X, Y, cex = cex.val) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its

Re: [R] Integrate two function in R

2010-12-16 Thread Jonathan P Daily
As a minor plug for my favorite non stat-based mathematics software, sagemath also has a rudimentary R interface built-in -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still

Re: [R] Help about nlminb function

2010-12-15 Thread Jonathan P Daily
or having variables on very different scales. Since you did not follow the posting guide (important part *'d below), my only suggestion is to ?nlminb -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480

Re: [R] Help about nlminb function

2010-12-15 Thread Jonathan P Daily
. Try changing parametres[,3] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] Integration with LaTex and LyX

2010-12-13 Thread Jonathan P Daily
?Sweave LyX is a bit harder, although you can probably export LyX docs to a *.tex and Sweave those fairly painlessly. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still

Re: [R] string

2010-12-07 Thread Jonathan P Daily
?paste collapse = T may be necessary. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we

[R] More elegant magnitude method

2010-12-07 Thread Jonathan P Daily
){ + length(charToRaw(format(trunc(x), scientific = F)))-1} a - 123456789 b - 1E15 c - 12.345 scl(a) [1] 8 scl(b) [1] 15 scl(c) [1] 1 Thanks -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724

Re: [R] More elegant magnitude method

2010-12-07 Thread Jonathan P Daily
What a brain fart... Thanks! -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] Optimize multiple variable sets

2010-12-06 Thread Jonathan P Daily
+ 1*x, at x = 0. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] Optimize multiple variable sets

2010-12-06 Thread Jonathan P Daily
. As for the returned x issue, you are correct that it is a 'tol' issue: reducing tol to something reasonably low approximates the min fairly well. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room

Re: [R] rpart results - problem after oversampling

2010-12-02 Thread Jonathan P Daily
of them now. So the choice of which 6 to split is arbitrary. (Someone with more knowledge of rpart's guts feel free to correct me). -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room

Re: [R] Sequence for repeated numbers

2010-12-01 Thread Jonathan P Daily
, grade) dat - dat[order(grade),] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] Two dimensional Array defined on intevals

2010-11-29 Thread Jonathan P Daily
Does this work for you? g - function(x,y) ifelse(x .5, 0, 2) + ifelse(y .5, 1, 2) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room

Re: [R] Population abundance, change point

2010-11-24 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly

Re: [R] Population abundance, change point

2010-11-24 Thread Jonathan P Daily
akin to tree outputs than piecewise regression outputs. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose

Re: [R] Check for is.object

2010-11-22 Thread Jonathan P Daily
I think you want the function ?exists if(!exists(NewObject)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have

Re: [R] question about constraint minimization

2010-11-19 Thread Jonathan P Daily
Does ?constrOptim look as though it will handle your needs? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have

Re: [R] predict() an rpart() model: how to ignore missing levels in a factor

2010-11-18 Thread Jonathan P Daily
): test.set - test.set[test.set$crop %in% original.set$crop,] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose

Re: [R] Population abundance, change point

2010-11-17 Thread Jonathan P Daily
, count) lines(year, fitted(fit)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] Population abundance, change point

2010-11-17 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal

Re: [R] help on IDE

2010-11-17 Thread Jonathan P Daily
cases, a custom Run command. Linux systems also often ship language specific IDEs with dependency checks on R, but not always. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room

Re: [R] Anyone can help with this question

2010-11-16 Thread Jonathan P Daily
assuming your data takes the form of locationlatitudelongitude string num num string2 num num try: sub - dat[sample.int(length(dat$location), 1000),] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] Null values in R

2010-11-15 Thread Jonathan P Daily
Would ?is.null be what you are looking for? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we

Re: [R] external R scripts

2010-11-10 Thread Jonathan P Daily
It would be possible to call other R scripts using calls to ?system or ?system2 and ?Rscript, provided you formatted what you passed as [args] and how your scripts handled [args]. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] maptools package

2010-11-10 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early

Re: [R] Random Sample

2010-11-08 Thread Jonathan P Daily
Use set.seed() -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] improve R memory under linux

2010-11-05 Thread Jonathan P Daily
it can't allocate an object of size .02. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] subsets, %in%

2010-11-05 Thread Jonathan P Daily
Any logical value can be negatively compared using ! does: subset(dat, !(dat$ID %in% someID)) provide what you need? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

Re: [R] cross-validation for choosing regression trees

2010-11-04 Thread Jonathan P Daily
be more informative. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] memory allocation problem

2010-11-03 Thread Jonathan P Daily
of steps needed. Good luck! -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] optim works on command-line but not inside a function

2010-11-03 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly From: Damokun dmroi

Re: [R] programming questions

2010-11-03 Thread Jonathan P Daily
For data frames you can also use with() in your example: with(d, exists(z)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room

Re: [R] R script on linux?

2010-11-02 Thread Jonathan P Daily
What is the error message? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] R script on linux?

2010-11-02 Thread Jonathan P Daily
was not created executable, in which case the terminal command chmod +x myscript.R will do it. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room

[R] Possible memory leak in loop.

2010-11-01 Thread Jonathan P Daily
- memory.size() memA returns as 9.3, and memB returns 11.3. I'm not familiar with fluctuation patterns in RAM usage (if there are any). Does anyone with more experience know if this is indicative of a memory leak? Thanks, Jon -- Jonathan P. Daily

Re: [R] Possible memory leak in loop.

2010-11-01 Thread Jonathan P Daily
Thank you, I will give that a try. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] Zoom in in a plot

2010-10-27 Thread Jonathan P Daily
In that case you may wish to look into the rggobi package, which provides an R interface to the ggobi tools. I haven't used it much, but it has a lot of interactive options. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] Best IDE for R

2010-10-27 Thread Jonathan P Daily
I noticed that nabble link presented Notepad++ as having to copy/paste into the editor. There is a companion to NP++, though, that allows line/file passing directly to an R console, auto-completion, and a bunch of other goodies called NppToR. -- Jonathan P

Re: [R] Best IDE for R

2010-10-27 Thread Jonathan P Daily
on a USB stick with ease. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] Reading in a tab delimitated file

2010-10-26 Thread Jonathan P Daily
A call to read.table(..., sep = , ...) reads in any length of whitespace as the delimiter. On your sample text it read in a 2 column dataframe. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724

Re: [R] Reading in a tab delimitated file

2010-10-26 Thread Jonathan P Daily
Right, I forgot to mention to use header = T. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we

Re: [R] Zoom in in a plot

2010-10-26 Thread Jonathan P Daily
I think that this would be possible if you save the graph to a scalable format. Try looking into: ?postscript ?xfig ?pdf -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still

Re: [R] anomalies with the loess() function

2010-10-26 Thread Jonathan P Daily
?loess use this instead: fit - loess(b~a) lines(a, predict(fit)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself

Re: [R] lowess() won't handle NAs

2010-10-25 Thread Jonathan P Daily
Try using the loess() function instead - it has an na.action parameter that should be able to handle your problem. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

[R] Passing rq models to Fstats

2010-03-04 Thread Jonathan P Daily
a lm. Has anyone had this issue? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's