similar to: methods vs. functions

Displaying 20 results from an estimated 2000 matches similar to: "methods vs. functions"

2011 Jan 20
4
puzzled with plotmath II
sorry, I forgot my sessionInfo: please see below. -------- Original Message -------- Subject: puzzled with plotmath Date: Thu, 20 Jan 2011 12:48:18 +0100 From: Claudia Beleites <cbeleites at units.it> To: R Help <r-help at r-project.org> Dear all, I'm puzzled with matrix indices in plotmath. I'm plotting matrix elements: Z [i, i], and I'd like to put that as label.
2008 Nov 03
1
Fourier Transform with irregularly spaced x
Dear all, I work with (vibrational) spectra: some kind of intensity (I) over frequency (nu), wavelength or the like. I want to do fourier transform for interpolation, smoothing, etc. My problem is that the spectra are often irregularly spaced in nu: the difference between 2 neighbouring nu varies across the spectrum, and data points may be missing. Searching for discrete fourier transform
2010 Aug 17
1
prompt () and backticks for default arguments
Dear all, I just noticed, that prompt () looses backticks that protect default arguments: f <- function (FUN = `*`) {} cat (prompt (f, NA)$usage) yields: \usage{ f(FUN = *) } %- maybe also 'usage' for other objects documented here. without the backticks, which is of course found by R CMD check as syntax error. While this is easily fixed if the .Rd is further edited manually, I
2010 Feb 28
1
dots for sample
Dear R-Developers, could 'sample' gain a ... argument? As a convenience function, I added a sample Method to my hyperSpec class. This function however has a flag indicating whether the results should be returned directly as a hyperSpec object or rather as indices that give a random sample. For the moment, I use SetGeneric to add the dots argument, but this of course gives a warning
2008 Dec 22
2
... (dotMethods) and cbind/rbind: how to give the signature?
Dear List, I'm struggling with the signature writing cbind/rbind functions for a S4 class. First of all, I'm very happy that it is now possible to dispatch on ... I follow the example for "paste" in ?dotMethods, which works as far as this: ### start example setClass ("cbtest", representation = representation (data = "data.frame"),
2010 Nov 12
1
Xapply question
Dear list, I'm stuck with looking for a function of the *apply family, which I suppose exists already ? just I can't find it: What I'm looking for is somewhere between sweep and mapply that does a calculation vectorized over a matrix and a vector: It should work complementary to sweep: for each row of the matrix, a different value of the vector should be handed over. Close to
2010 Nov 10
2
force apply not to drop the dimensions of FUN results ?
Dear R users, Here is my problem: I have an array with at least four dimensions: > dim(myArray) [1] 20 17 3 6 I'd like to apply a function to each occurrence of the matrix (3x6) defined by the last two dimensions. This interpolation function always return a matrix of the same dimensions as its argument: > interpSecteurs.f(myArray[1, 1, , ]) secteur rotation 1 2 3
2010 Oct 05
3
SweaveInput + keep.source = TRUE trouble
Dear all, I have trouble with R-beta sweaving files that include definitions with \SweaveInput in combination with keep.source = TRUE Symptom: SInput is taken from too far down the input file (the shift is the number of lines of the included file). Is that known? Searching didn't turn up anything, yet I think there are more people than just me using keep.source. Example: $
2011 Feb 18
6
sort a 3 dimensional array across third dimension ?
I'm attempting to sort a 3 dimensional array that looks like this > x , , 1 [,1] [,2] [1,] 9 9 [2,] 7 9 , , 2 [,1] [,2] [1,] 6 5 [2,] 4 6 , , 3 [,1] [,2] [1,] 2 1 [2,] 3 2 Such that it ends up like this .... > y , , 1 [,1] [,2] [1,] 2 1 [2,] 3 2 , , 2 [,1] [,2] [1,] 6 5 [2,] 4 6 , , 3 [,1] [,2]
2010 Oct 28
2
R and Matlab
Dear Group, I am looking for ways to use R and Matlab. Doing the data transformations in R and using the data in Matlab to analyze with some pre-defined scripts. Any good ways to transfer the data into matlab in its most recent version? I tried using R.matlab but the writeMat output is not readable by Matlab. I just need to output a data.frame and read it as is into matlab where I can do any
2010 Mar 12
2
Data frame question
Hi, I have the following question about creating data frames. I want to create a data frame with 2 components: a vector and a matrix. Let me use a simple example: y <- rnorm(10) x <- matrix(rnorm(150), nrow=10) Now if I do dd <- data.frame(x=x, y=y) I get a data frame with 16 colums, but if, according to the documentation, I do dd <- data.frame(x=I(x), y=y) then str(dd)
2011 Jan 20
1
plotmath indices: suggested addition to help file
Dear all, I just stumbled over the fact that subsetting by square bracket will only output the first given index. I guess the rest is thrown away by the CADDR in RenderSub (plotmath.c l. 1399). Maybe changing this could be considered as "low-priority desired" (would be nice if the output works for ? However, I suggest to announce the fact that only the first parameter is printed in
2010 Oct 12
1
need help with nnet
HI, Dear R community, My data set has 2409 variables, the last one is response variable. I have used the nnet after feature selection and works. But this time, I am using nnet to fit a model without feature selection. I got the following error information: > dim(train) [1] 1827 2409 nnet.fit<-nnet(as.factor(out) ~ ., data=train, size=3, rang=0.3, decay=5e-4, maxit=500) # model
2010 Aug 25
3
approxfun-problems (yleft and yright ignored)
Dear all, I have run into a problem when running some code implemented in the Bioconductor panp-package (applied to my own expression data), whereby gene expression values of known true negative probesets (x) are interpolated onto present/absent p-values (y) between 0 and 1 using the *approxfun - function*{stats}; when I have used R version 2.8, everything had worked fine, however, after updating
2008 Dec 12
0
Fwd: Re: The end of Matlab (sorry, I messed up a sentence)
---------- Weitergeleitete Nachricht ---------- Betreff: Re: [R] The end of Matlab Datum: Freitag 12 Dezember 2008 Von: Claudia Beleites <cbeleites at units.it> An: r-help at r-project.org Am Freitag 12 Dezember 2008 13:10:20 schrieb Patrick Burns: > How about: > > x[, -seq(to=ncol(x), length=n)] Doing it is not my problem. I just agree with Mike in that I would like if I could
2010 May 24
2
ROC curve
HI, Dear R community, I want to know how to select the optimal decision threshold from the ROC curve? At what threshold will give the highest accuracy? Thanks! -- Sincerely, Changbin -- [[alternative HTML version deleted]]
2008 Oct 10
1
Creating a new connection type
Hello. I have an instrument, actually a step motor indexer that I want to drive from R. It uses an RS-232 connection. I already have a few C subroutines that I access from R but I would like to be able use R's connection related functions - readLines, writeLines, cat, read.table, etc - directly. Does any one have any suggestions on how a I should proceed to create a new connection type? Is it
2008 Oct 31
2
Row and Column positions
Hi R, m=data.frame(a=c(1,NA,5,5),b=c(4,5,6,7),c=c(NA,NA,NA,5)) I want to know the methods of getting row and column positions of NA in the above dataframe. How do I do this? Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}}
2008 Nov 19
2
simplify this instruction
Hi R users, Is there a way to simplify this instruction: ifelse(B=="0","A", ifelse(B=="1","A", ifelse(B=="2","A", ifelse(B=="3","A", ifelse(B=="4","A", ifelse(B=="5","A", ifelse(B=="6","A", ifelse(B=="7","A",
2010 Mar 11
1
modifying the dots argument - how?
Is there a way to modify the dots-argument? Let's consider I have a function that passes on its ... arguments to another function. For some reason I know, that some elements in ... will cause problems. Can I modify the ... structure somehow, e.g. delete elements? foo <- function(...){ innerFoo <- function(...){ } AT THIS POINT I WANT TO MODIFY THE CONTENT OF ... BEFORE IT IS