similar to: as.numeric

Displaying 20 results from an estimated 12000 matches similar to: "as.numeric"

2002 Jun 14
2
minor quirk in rnbinom
I don't want to spoil a nice joke, and recognise it's not a bug as it does have the intended effect, but the error message that is returned if rnbinom is given four parameters is slightly obscure: > rnbinom(0.5,0.5,0.5,0.5) Error in rnbinom(0.5, 0.5, 0.5, 0.5) : couldn't find function "error" > Cheers, Mike.
2002 Apr 03
1
optim()
I was having some problems persuading optim() to give me the answers I wanted, & simplified down to: sqr<-function(x){(x+1)^2} optim(1,sqr) I accept this is a hammer to crack a nut, but was still expecting the answer -1. I got: $par [1] -0.8 $value [1] 0.04 $counts function gradient 12 NA $convergence [1] 0 $message NULL so I've
2002 Oct 25
4
points on a sphere
Not an R question directly, but has anyone got a method for placing a moderately large number of (near) equi-spaced points on a sphere? I have a nasty feeling platonic solids are needed for exact solutions and I'm thinking of samplings involving around 200 - 1000 regularly-spaced points, Thanks, Richard Rowe Richard Rowe Senior Lecturer Department of Zoology and Tropical Ecology, James
2002 Aug 28
2
all possible subsets of r out of n
Has anyone written a function that returns all possible subsets of r elements out of a vector that contains n elements? I have not been able to find an answer in the FAQ or the archives. Say I have a vector: letters[1:10]. I want to get a matrix of 120 rows that contains all possible subsets of 3 letters out of the 10. And I would like to be able to generalize to any r out of n, like
2008 Apr 08
3
post hoc statistical power
I remember reading about post hoc statistical power on R-help. But I can't seem to find them with RSiteSearch("post hoc statistical power") and variations of it. I would like to learn more about post hoc statistical power, its meaningfulness, advantages and disadvantages. I thought the issue was settled after Tukey's 1993 paper about post hoc statistical power being
2003 Feb 12
2
rl_callback_read_char error on Solaris 7
This question is about compiling R-1.6.2 from source on a Sparcstation-20 machine running Solaris 7, gcc-2.95.3 and readline-4.2 (both gcc and readline from sunfreeware.com). I searched the r-help archive and the FAQ. The errors seem to be related to the binary readline libraries, and I have /usr/local/lib/libreadline.a,libreadline.so@, and libreadline.so.4. The attached errors are from
2000 Jun 23
1
Errors in Compiling R
I am having trouble compiling R-1.1.0 on a Sun Ultra 60 machine running Solaris 7. Suggestions are greatly appreciated. I modified the CPPFLAGS and LIBS variables in the config.site file. As far as I can tell, I have included all the non-standard headers and libraries installed on my Sun station. My GNU stuff is installed in /opt/Summertime_98.sparc/, and at the bottom of this message I
2006 Nov 23
4
Ryacas and fractions with simultaenously very large numerators and denominators
Dear All I am doing the following: > x <- yacas("3/2") > for (i in 2:400) + x <- yacas(paste(x,"*",x)) > x expression(Inf^1.260864167e+117/Inf^6.304320836e+116) > Eval(x) [1] NaN No luck this way. However, I am successful with > y <- yacas("(3/2)^400") > y expression(7.05507910865533e+190/2.58224987808691e+120) > Eval(y) [1]
2007 Aug 11
1
xyplot() with segments() superposed?
In the hypothetical example below, how do I add two segments() into the two panels, respectively? Say segments(x0=5, y0=10, x1=5, y1=20) on the left and segments(x0=15, y0=-10, x1=15, y1=-2) on the right? Many thanks in advance, Yuelin Li. ps. part of the code came from a solution given by Deepayan Sarkar. ------------------- library(lattice) set.seed(12345) x <- 0:20 y.male.obs <- - 1.2
2002 May 16
1
glm(y ~ -1 + c, "binomial") question
This is a question about removing the intercept in a binomial glm() model with categorical predictors. V&R (3rd Ed. Ch7) and Chambers & Hastie (1993) were very helpful but I wasn't sure I got all the answers. In a simplistic example suppose I want to explore how disability (3 levels, profound, severe, and mild) affects the dichotomized outcome. The glm1 model (see below) is
2011 Mar 31
2
fit.mult.impute() in Hmisc
I tried multiple imputation with aregImpute() and fit.mult.impute() in Hmisc 3.8-3 (June 2010) and R-2.12.1. The warning message below suggests that summary(f) of fit.mult.impute() would only use the last imputed data set. Thus, the whole imputation process is ignored. "Not using a Design fitting function; summary(fit) will use standard errors, t, P from last imputation only. Use
2003 Nov 30
1
Escape optimization
Hello, I'm using optim and I'd like to know if there is a way to escape the optimization process at a given time (for example by pressing some sequence on the keyboard) while retaining the optimization results achieved. I found this very useful using the Aptech GAUSS optimization module. Thanks Paolo
2002 Dec 20
1
GetRNGstate() crashes with 'Segmentation fault'
Dear R-masters, I tried to compile this simpel C-code: //----------------- #include<R.h> int main() { GetRNGstate(); return 0; } //----------------- Compiling: ~> gcc -o a a.c -I/usr/lib/R/include/ -L/usr/lib/R/bin/ -lR ~> ldd a libR.so => /usr/lib/libR.so (0x40018000) libc.so.6 => /lib/libc.so.6 (0x401a8000) libblas.so.2 =>
2007 Sep 06
1
Rggobi compilation error: display.c
On a ubuntu linux computer (Feisty, i386), I compile R and additional packages from source. The compiler is gcc 4.1.2. The problem is, I can run "sudo R" and successfully compile all packages (e.g., MASS, lattice) except rggobi. The error seems to be in display.c. My ggobi is in /usr/local/, which R can find. I don't think this is a dependence issue because install.packages(...,
2011 Mar 10
1
power for repeated-measures ANOVA lacking sphericity
Is there a function that calculates the power of a repeated-measure ANOVA design, e.g., 2 groups, 4 within-subject factors, an average 0.40 correlation between the 4 within factors, etc. I don't think I can use power.anova.test() because it does not consider corr=0.40. I am hoping that someone has already implemented the method by Muller & Barton (1989, JASA 84: 549-555) on how to
2006 Jul 28
20
3510 JBOD ZFS vs 3510 HW RAID
Hi there Is it fair to compare the 2 solutions using Solaris 10 U2 and a commercial database (SAP SD scenario). The cache on the HW raid helps, and the CPU load is less... but the solution costs more and you _might_ not need the performance of the HW RAID. Has anybody with access to these units done a benchmark comparing the performance (and with the pricelist in hand) came to a conclusion.
2005 Oct 19
2
Automatic rounding of values after factors , converted to numeric, are multipled by a real number
I am wondering if someone would have any suggestion about my issue? I have the following code: wgts<-aggregate(subset(lendata,select=c(Length)),list(lendata$Cruise,len data$Station,lendata$Region,lendata$Total),mean) wgts<-wgts[order(wgts$Group.3,wgts$Group.1,wgts$Group.1),] names(wgts)<-c("Cruise","Station","Region","Total","MLen")
2002 Oct 03
1
install.packages("grid") failed
I just successfully compiled R-1.6.0 on a Red Hat 7.2 machine. When I tried to install "grid" from source, I got this error. Any suggestions? I don't think it is a dependency problem. I also attach the output from library(). Yuelin Li. ------------- > install.packages("grid") trying URL `http://cran.r-project.org/src/contrib/PACKAGES' Content type
2006 Oct 27
2
qplot of ggplot package how to plot different size according to the values and not to the weights?
I have the following Data structure $ step45 : Factor w/ 2 levels $ obserror : num 6.2 6.2 5.6 6.6 6.6 ... $ Mon : num 2.2 2.0 1.0 3.2 2.0 ... $ inc.comp : num 4 5 2 5 5 5 5 5 4 4 ... all I wanted to do is plotting Mon against obserror, the colors should be by step45 and the size of the symbol should be according to inc.comp so I did this:
2002 Jun 06
1
generating overdispersed poisson & negative binomial data
I would like to try a simple parametric bootstrap, but unfortunately (stupidly?) my models are "overdispersed" gams & glms. I'm hoping for a function that generates overdispersed poisson or negative binomial data with a given mean, scale (& shape parameter). The loose definition I'm using is overdispersed poisson produces integer values with variance=const*mean &