Displaying 15 results from an estimated 15 matches for "zerfetzen".
2008 Nov 22
5
What's the BEST way in R to adapt this vector?
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 (10), and formatted in such a
way that if y[1] == 1, then y.new[1:3] == c(1,0,0), and if y[2] ==
2008 Apr 14
5
Equivalent to a BY command in SAS
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 discrete
variable? My best attempts so far are something like...
> mean(x, y_cat=1)
2008 Sep 26
3
Dealing With Extremely Large Files
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 example?
Something like this may make analysis possible.
Once analyzed, is there a way to, say, read
2008 Nov 03
4
How do you apply a function to each variable in a data frame?
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 having luck. My best guess
would be:
sapply(x, FUN=quantile)
--
View this message in
2008 Jul 28
7
Legality Question about R's Open Source GNU GPL License
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 the company
replied that the generalities of GNU GPL may differ from R's specific GNU
GPL license,
2011 Jan 26
2
Sweave: \Sexpr{} inside <<>>?
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. Any ideas? Thanks.
--
2011 Jun 25
2
Multivariate normal density in C for R
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 matters. I would like to
be able to use .C or .Call to pass X, mu, Sigma, and N to a C program and
have
2011 Mar 19
3
How would you avoid loops in this simple example?
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 <- matrix(1:12,P,M)
F <- matrix(1:8,N,P)
### Loop to avoid
for (i in 1:N)
2009 Jan 27
1
WhisperStation R
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 know
nothing about Linux, or WhisperStation R for that matter, and am really
curious what you think?
2010 Dec 29
2
Referring to an object name from within a function
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 test, be able to print "MyModel is a valid object."
Thanks.
--
View this
2008 May 02
1
Errors using nlme's gls with autocorrelation
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 is missing in the model to prevent it from becoming full rank). When
I run the following code...
2008 Apr 17
1
How to extract vectors from an arima() object and into a data frame?
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, 7:14], method =
"ML")
Coefficients:
ar1
2010 Nov 24
0
Laplace Approximation
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 C code,
and am looking for an example in R only. Thanks.
--
View this message in
2011 Oct 02
0
Multivariate Laplace density
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.
2012 Jun 09
0
suppress output of makeCluster()
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 from the R help mailing list archive at Nabble.com.