similar to: Question on applying vectors to data.frames by row

Displaying 20 results from an estimated 1000 matches similar to: "Question on applying vectors to data.frames by row"

2005 May 05
2
Numerical Derivative / Numerical Differentiation of unknown funct ion
Hi, I have been trying to do numerical differentiation using R. I found some old S code using Richardson Extrapolation which I managed to get to work. I am posting it here in case anyone needs it. ######################################################################## richardson.grad <- function(func, x, d=0.01, eps=1e-4, r=6, show=F){ # This function calculates a numerical approximation
2010 May 29
1
modifying only certain rows in a data-frame
Hi, I have a data-frame r (shown below is a subset) with the following column names: date time sample vct norm hct deltact $time has 8 levels: 0h, 0.5h, .....24h. $deltact holds real numbers. I want to subset this dataframe by the levels of $time. For all the rows which have r$time == "0h" I would like to convert the present value of r$deltact to 0. Any pointers to a
2006 Mar 12
2
Numerical Derivatives in R
Hi, Suppose I have an arbitrary function: arbfun<-function(x) {...} Is there a robust implementation of a numerical derivative routine in R which I can use to take it's derivative ? Something a bit more than simple division by delta of the difference of evaluating the function at x and x+delta... Perhaps there is a way to do this using D or deriv but I could not figure it out.
2005 May 05
2
Numerical Derivative / Numerical Differentiation of unkno wn funct ion
Ah... I searched for half an hour for this function... you know, the help function in R could really be a lot better... But wait a minute... looking at this, it appears you have to pass in an expression. What if it is an unknown function, where you only have a handle to the function, but you cannot see it's implementation ? Will this work then ? -----Original Message----- From: Berton Gunter
2011 Feb 07
1
Unusual slowing of R matrix multiplication version 2.12.1 (2010-10-15) vs 2.12.0
R Version 2.12.1 (2010-10-15) vs 2.12.0 has slowed down 8 fold for dual core and 17 fold for dual-core-dual-processor Macs. I have checked this result on 3 different macs using the following R-script: Using Version 2.12.0 on a dual core dual processor Mac: > source("http://www.bio.umass.edu/biology/kunkel/pub/R/CuriousResult.R") matrix multiplication 43.543 1.308 14.788
2010 Oct 19
2
head.matrix() unintelligent
Hi Just a simple question really. I?ve got these large 2d matrices that I?d like to inspect, but not from start to finish. The head() command is convenient when columns are few. For large nxn matrices, however, head() and head.matrix() are still cumbersome. Is there a simple way of viewing both the columnwise and rowwise heads of a matrix? cheers, Bruce -- View this message in context:
2002 Mar 21
5
repeating rows or columns within a matrix
Hello Spse I have a matrix, say 1 2 3 4 5 6 7 8 9 and I would like to expand it by repeating rows within the matrix, to get, if the repeating factor is 2, say: 123 123 456 456 789 789 (or columnwise as well) . There must be a smart way of doing that? Many thanks Juhana Vartiainen juhana.vartiainen at labour.fi -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
1998 Sep 25
1
format(numericmatrix, ...) : proposal for a change
Since format, i.e., format.default(.), is a pretty basic function I thought I'd ask before just changing it... aa <- cbind(1:7, rnorm(7)) format(aa) or format(aa, digits=7) looks like [,1] [,2] [1,] " 1.0000000" " 0.2406669" [2,] " 2.0000000" "-0.4973221" [3,] " 3.0000000" " 0.4672260" [4,] "
2009 Dec 17
2
Exchange NAs for mean
Hi all, I'm have a matrix (X) with observations as rows and parameters as columns. I'm trying to exchange all missing values in a column by the column mean using the code below, but so far, nothing happens with the NAs... Can anyone see where the problem is? N<-nrow(X) # Calculate number of rows = 108 p<-ncol(X) # Calculate number of columns = 88 # Replace by columnwise
2005 Jan 03
1
row ("FORTRAN") order?
Reading about 'R_max_col' in "Writing R extensions", Version 2.1.0,(2005-01-03), I find: "Given the nr by nc matrix matrix in row ("FORTRAN") order, ..." Looks like a contradiction to me, since FORTRAN stores matrices columnwise. So is this a documentation bug? -- G?ran Brostr?m tel: +46 90 786 5223 Department of Statistics
2011 Sep 06
2
subsetting tables
Hi guys, one of the questions where you need a real human instead of a search engine, so it would be great if you could help. I have a matrix of z-scores which I would like to filter, sometimes columnwise, sometimes rowwise. Data looks like this: Allstar hsa.let.7a hsa.let.7a.1 hsa.let.7a.2 2 0.87 0.79 -0.57 1.07 3 0.67 -1.14 -0.78 -0.95 4
2001 Dec 08
2
Building under IRIX 6.5 (report)
On my IRIX system (SGI compilers, gcc not installed) ./configure runs fine, but there is a problem with make (output below) that can be solved by changing one line in src/modules/lapack/Makefile. If this line is changed, make runs without problems. 'make check' still has a problem (sh[14]: /usr/sbin/perl: arg list too long), but I assume this is "cosmetic". Manfred -----------
2007 Mar 04
1
Scoping issue?
Hello, The code below is supposed to be a wrapper for matplot to do columnwise visible comparison of several matrices, but I'm doing something wrong because I can't access an argument called 'colnum'. I'd be most grateful for some insight. Thanks, John Thaden Little Rock, AR ################################ # mmatplot is a matplot wrapper to compare the same column of #
2011 Dec 21
1
matrix multivariate bootstrap: order of results in $t component
[This question is hopefully straight-forward, but difficult to provide reproducible code.] I'm doing a multivariate bootstrap, using boot::boot(), where the output of the basic computation is a k x p matrix of coefficients, representing a tuning constant x variable, as shown in the $t0 component from my run, giving a 3 x 6 matrix > lboot$t0 GNP Unemployed Armed.Forces
2005 Jan 16
1
p.adjust(<NA>s), was "Re: [BioC] limma and p-values"
I append below a suggested update for p.adjust(). 1. A new method "yh" for control of FDR is included which is valid for any dependency structure. Reference is Benjamini, Y., and Yekutieli, D. (2001). The control of the false discovery rate in multiple testing under dependency. Annals of Statistics 29, 1165-1188. 2. I've re-named the "fdr" method to "bh" but
2010 Nov 18
0
On efficiency, Vectorize and loops
In my last e-mails, I have asked for help regarding 1. 'defining functions inside loops' 2. 'integrating functions / vector arithmetics' 3. 'vectors out of lists?' 4. 'numerical integration' Since some of these topics seemed to be relevant (I'm guessing by the # of replies I got), I'm posting a modified section of my code. Any thoughts on improvements would
2007 Feb 10
5
TMG -- MS Visual Foxpro errors
I'd like very much to be able to run "The Master Genealogist" under Wine. TMG is a MS Visual Foxpro application for genealogy database work. On my Kubuntu 6.10 system I have successfully downloaded and installed Wine 0.9.30, and then installed TMG ver. 6 including updates to 6.12, the current version. During TMG installation, there was a problem with a lack of
2002 Mar 30
2
Inconsistency among mean, median, max, var
I found a strange inconsistency: If m is a matrix and d is a data frame then - mean(m), median(m), max(m) and max(d) all return a single value but - mean(d) returns the column means - median(d) fails - both var(m) and var(d) return the variance covariance matrix You pretty much have to experiment to figure this out since much of this behavior is not readily obvious from the help files.
2006 Jul 18
2
how can I delete rows?
Hello, I am very new in R so I am so sorry for this question. I have the Barro-Lee data set which contains 98 countries and I want to run the regressions only for the Latin America countries, so what do you recomend? How can I delete all the other countries or how can I select the countries of Lat. Am. thank you this is the list of countries SHCODE COUNTRY NAME WBCTRY
2014 Jan 11
2
Linux reinstallation without rebooting? Alternative to kickstart and other such tools?
Hi All. I am curious if it is possible to reinstall linux distribution to centos (or another distro) if I have a remote linux server with no kvm access (i do not want to use virtualization). I know that for installation pxe, tftpboot and kickstart or a proper iso/cd and kickstart are standard options. But for such operations I would need kvm access. Are there any alternatives which do not need