[R] suppress output of makeCluster()

2012-06-09 Thread zerfetzen
I'm trying to suppress the output of: makeCluster(detectCores()) and haven't had luck. So far, I've tried invisible, sink, and capture.output. Any ideas are appreciated. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/suppress-output-of-makeCluster-tp4632904.html Sent

[R] Multivariate Laplace density

2011-10-02 Thread zerfetzen
Can anyone show how to calculate a multivariate Laplace density? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-Laplace-density-tp3864072p3864072.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread zerfetzen
Dimitris, Thanks for the great code. When the number of rows of X and mu are large, it is probably faster due to R's vectorization. Thanks again. -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-normal-density-in-C-for-R-tp3624602p3625857.html Sent from the R help

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread zerfetzen
IIRC, package mvtnorm will allow an X matrix, but requires mu to be a vector, so although it's close, it won't do it all...but all suggestions are well received. Dimitrius, you don't happen to have the multivariate t form of that function, do you? -- View this message in context:

[R] Multivariate normal density in C for R

2011-06-25 Thread zerfetzen
Does anyone know of a package that uses C code to calculate a multivariate normal density? My goal is to find a faster way to calculate MVN densities and avoid R loops or apply functions, such as when X and mu are N x K matrices, as opposed to vectors, and in this particular case, speed really

[R] How would you avoid loops in this simple example?

2011-03-19 Thread zerfetzen
I'm trying to code more R-like and avoid loops. Here is an example I'm having a hard time getting away from loops with, and the real matrices are rather large, and the computation is too time-consuming. ### Dimensions N - 2 M - 3 P - 4 ### Array and Matrices nu - array(NA,dim=c(N,M,P)) Lambda -

Re: [R] How would you avoid loops in this simple example?

2011-03-19 Thread zerfetzen
Thanks for the help, and now I have some functions to learn. Both suggestions work great, really appreciate it. -- View this message in context: http://r.789695.n4.nabble.com/How-would-you-avoid-loops-in-this-simple-example-tp3390017p3390549.html Sent from the R help mailing list archive at

Re: [R] Sweave: \Sexpr{} inside ?

2011-01-26 Thread zerfetzen
Thanks Duncan, that helps. It successfully displays what I'm looking for, but it is not executing it. In a previous code chunk, it notes the time it took to run something, and in the successive code chunk, it runs something else where the previous time is now a parameter, but I'd like it to

[R] Sweave: \Sexpr{} inside ?

2011-01-25 Thread zerfetzen
Hi, Is it possible in Sweave to put \Sexpr{} inside ? This is a bad example, but here goes: results=hide Age - 5 @ x - \Sexpr{Age} @ I'm trying to get it to display x - 5, rather than x - Age. It's probably so obvious I'm going to feel sorry for having to ask, just the same, I'm stumped.

[R] Referring to an object name from within a function

2010-12-29 Thread zerfetzen
Can anyone show me how to refer to an object name that is passed to a function, from within the function? For example: MyModel - 1 test - function(x) { if(x == 1) {cat(x is a valid object.\n)} } test(x) What I would like this to do is pass MyModel to function test, and if it passes a

Re: [R] Referring to an object name from within a function

2010-12-29 Thread zerfetzen
Excellent, thanks, and sorry about the test(x) goof. -- View this message in context: http://r.789695.n4.nabble.com/Referring-to-an-object-name-from-within-a-function-tp3167147p3167174.html Sent from the R help mailing list archive at Nabble.com. __

[R] Laplace Approximation

2010-11-24 Thread zerfetzen
Does anyone have any R code that shows how to do a Laplace Approximation? I know there are a variety of these numerical approximation algorithms and I'm pretty open at this point, I'm just curious how it's approximated in R code. I have seen some functions in packages, but I think they all call

[R] WhisperStation R

2009-01-26 Thread zerfetzen
What do you think of this: http://www.microway.com/whisperstation/whisperstation-r.html I'm considering ditching my Windows Vista 2 GB RAM computer for WhisperStation R using Debian 64-bit Linux with 32 GB RAM and setting the whole thing up for R and WinBUGS. I put in a price request, but I

Re: [R] Help with maps

2008-12-07 Thread zerfetzen
I'm brand new to the map function too, here's my attempt at coloring a map of the states according to a rate (rather than count): map('state')$names MyCount - c(1:63); MyRate - runif(63, 0, 1) map('state', fill=TRUE, col=rgb((1-MyRate),MyRate,0,1)) Seeing that there are 63 states, means you'll

Re: [R] What's the BEST way in R to adapt this vector?

2008-11-23 Thread zerfetzen
Thanks for the help, I've a few more functions to get familiar with. Those are definitely concise ways to do this! :) -- View this message in context: http://www.nabble.com/What%27s-the-BEST-way-in-R-to-adapt-this-vector--tp20638991p20647978.html Sent from the R help mailing list archive at

[R] What's the BEST way in R to adapt this vector?

2008-11-22 Thread zerfetzen
Goal: Suppose you have a vector that is a discrete variable with values ranging from 1 to 3, and length of 10. We'll use this as the example: y - c(1,2,3,1,2,3,1,2,3,1) ...and suppose you want your new vector (y.new) to be equal in length to the possible discrete values (3) times the length

[R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread zerfetzen
I want to apply a more complicated function than what I use in my example, but the idea is the same: Suppose you have a data frame named x and you want to a function applied to each variable, we'll just use the quantile function for this example. I'm trying all sorts of apply functions, but not

Re: [R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread zerfetzen
Thank you all for the help, sometime soon I'll know enough to be able to help others who are learning this. Thanks. -- View this message in context: http://www.nabble.com/How-do-you-apply-a-function-to-each-variable-in-a-data-frame--tp20304332p20308611.html Sent from the R help mailing list

Re: [R] Dealing With Extremely Large Files

2008-09-30 Thread zerfetzen
Thank you Gabor, this is fantastic, easy to use and so powerful. I was instantly able to many things with .csv files that are much too large for my PC's memory. This is clearly my new favorite way to read in data, I love it! Is it possible to use sqldf with a fixed width format that requires a

[R] Dealing With Extremely Large Files

2008-09-26 Thread zerfetzen
Hi, I'm sure that a large fixed width file, such as 300 million rows and 1,000 columns, is too large for R to handle on a PC, but are there ways to deal with it? For example, is there a way to combine some sampling method with read.fwf so that you can read in a sample of 100,000 records, for

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-08-05 Thread zerfetzen
I just wanted to let everyone know the good news, that I was approved to use R at work by legal and compliance. Now to begin learning here. Speaking of, is there anyone who is an expert at R and would be willing to have our company pay them as a consultant to come to my place of work (in

[R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread zerfetzen
Hi, I use R at home, and am interested in using it at my work company (which is in the Fortune 100). I began the request, and our legal team has given some gruff about the open source license. Not boring you with the details here, but I used some info on gnu.org as a rebuttal, and someone at

Re: [R] Legality Question about R's Open Source GNU GPL License

2008-07-28 Thread zerfetzen
Thanks to each of you for your excellent input. I have copied the file and will read it tonight. I haven't run into any heat from IT, but if I do, it will be in the near future. The exact legal issue was touched upon. There was a concern that anything associated with R (my code, etc.) would

[R] Errors using nlme's gls with autocorrelation

2008-05-02 Thread zerfetzen
Hi, I am trying out a generalized least squares method of forecasting that corrects for autocorrelation. I downloaded daily stock data from Yahoo Finance, and am trying to predict Close (n=7903). I have learned to use date functions to extract indicator variables for Monday - Friday (and Friday

[R] How to extract vectors from an arima() object and into a data frame?

2008-04-17 Thread zerfetzen
This should be very easy, but alas, I'm very new to R. My end goal is to calculate p-values from arima(). Let's say I just ran this: MyModel - arima(y[1:58], order=c(1,0,0), xreg=MyData[1:58,7:14], method=ML) MyModel And I see: arima(x = y[1:58], order = c(1, 0, 0), xreg = MyData[1:58,

Re: [R] How to extract vectors from an arima() object and into a data frame?

2008-04-17 Thread zerfetzen
This has been solved, and I'm thankful for the help. The solution is: z = MyModel$coef/diag(MyModel$var.coef) ...and from there I will use a for loop and pnorm to get the p-values. Thanks again! Byron zerfetzen wrote: This should be very easy, but alas, I'm very new to R. My end goal

Re: [R] Equivalent to a BY command in SAS

2008-04-14 Thread zerfetzen
Thanks all. I will try to use both tapply and by, and have no idea how I missed the by function. Thanks again. -- View this message in context: http://www.nabble.com/Equivalent-to-a-BY-command-in-SAS-tp16670452p16676280.html Sent from the R help mailing list archive at Nabble.com.

[R] Equivalent to a BY command in SAS

2008-04-13 Thread zerfetzen
Hi, I'm very new to R and absolutely love it. Does anyone know how to use something in R that functions like a BY command in SAS? For example, let's say you have a variable x, and you want to see the mean. Easy... mean(x) But what if you want to see the mean of x conditional on another