similar to: minor diagonal in R

Displaying 20 results from an estimated 1200 matches similar to: "minor diagonal in R"

2010 Feb 03
3
diagnostic plots
Dear all, does anybody ever encountered the problem with diagnostic plots? x<-rnorm(100) y<-rnorm(100) plot(lm(x~y)) It gives the following message "Waiting to confirm page change..." and nothing happens. Thanks a lot! [[alternative HTML version deleted]]
2010 Jan 13
4
<= returns wrong result? Why
Dear all, Does anybody know the probable reason why <= gives false when it should give true? These two variables are of the same type, and everything works in the cycle but then it stops when they are equal. this is the output result > Rk[47] <= RB[21] [1] FALSE > Rk[47] [1] 0.002842007 > RB[21] [1] 0.002842007 Thanks a lot. [[alternative HTML version deleted]]
2010 Jul 09
3
strange floor rounding
Dear all, might seem and easy question but I cannot figure it out. floor(100*(.58)) [1] 57 where is the trick here? And how can I end up with the right answer? Thanks a lot everybody for your help. Trafim [[alternative HTML version deleted]]
2010 Jul 14
4
reverse string
Dear all, Are there any functions in R to reverse the order of the string. smth like reverse("abc") to get "cba"? Thanks a lot. [[alternative HTML version deleted]]
2010 Jan 14
3
plot type any symbols?
Dear all, I have a question is there a possibility to plot points with different symbols like stars, crosses? I looked at different types for plot command and didn't find anything like that. Thanks a lot. [[alternative HTML version deleted]]
2010 Jan 07
2
Graph titles from massive
Dear all, I would like to ask you if there is a possibility in R to give the names to graphs which are not const. For example, How to name each plot, or to add notes like a=x[i], b=y[i] in this cycle x<-c(1,2,3,4,5,6) y<-c(7,8,9,10,11,12) par(mfrow=c(2,3)) for (i in 1:6){ plot(x,y) } Thank you for your time and help! [[alternative HTML version deleted]]
2010 Feb 05
3
Extract p-value from lm for the whole model
Dear all, I would like to ask how to extract the p-value for the whole model from summary(lm). This didn't help a lot summary.lm summary(lm(speed~dist, cars)) Thanks a lot! [[alternative HTML version deleted]]
2010 Sep 09
1
createDataPartition
Dear all, does anyone know how to define the structure of the required samples using function createDataPartition, meaning proportions of different types of variable in the partition? Smth like this for iris data: createDataPartition(y = c(setosa = .5, virginica = .3, versicolor = .2), times = 10, p = .7, list = FALSE) Thanks a lot for your help. Regards, Trafim [[alternative HTML version
2009 Dec 09
1
Bootstrapping in R
Dear all, I have some error trying to bootstrap from a matrix. The error message is "Error in sample(n, n * R, replace = TRUE) : element 2 is empty; the part of the args list of '*' being evaluated was: (n, R)" vv <- c(0.5,3.2,5.4,1.1,1.4,1.2,2.3,2.0) Reg <- matrix(data=vv, nrow = 4, ncol = 2) bootcoeff <- function(x){ coefficients(lm(x[,1]~x[,2]))[2]+1 }
2010 Jan 22
4
Extract R-squared from summary of lm
Dear all, I cannot find to explicitly get the R-squared or adjusted R-squared from summary(lm()) Thanks a lot! [[alternative HTML version deleted]]
2010 Apr 05
3
Matrix elements are vectors
Dear all, My question how is it possible to define a matrix A with 10 rows 1 column, so that its elements are vectors of undefined length. I need to have a possibility later to add elements like A[1,1] <- c(A[1,1],3,4,5) Thanks a lot for the help! [[alternative HTML version deleted]]
2009 Dec 02
2
Joint density kde2d works improperly?
Dear all, Please, look at the following code: attach(geyser) f1 <- kde2d(duration, waiting, n = 5) a <- 0 for (i in 1:5){ for (j in 1:5){ a <- a + f1$z[i,j] } } As far as I understood from Help kde2d returns matrix elements of which are values of joint probability mass function Pr(X=x,Y=y) therefore, sum of its elements should sum to 1. Which is not the case from my check. Where is
2009 Dec 02
2
Histogram probabilities >1 ????!!!
Hi everybody, well, I definitely don't understand anything. Why the hist function with freq=FALSE gives such a strange result??? R <- c(-1.10, 0.79, -1.17, -0.53, -0.26, -0.22, 0.29, -0.26, -0.26, 0.39) hist(R, freq=FALSE, breaks=10) Thanks everybody [[alternative HTML version deleted]]
2010 Jan 07
2
Extract p-value from linear model
Dear all, I have the following question. Is it possible in R to call for the p-value directly in a model like this a <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) b <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) summary(lm(a~(b+0))) or even in this a <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) b <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
2010 Apr 01
2
pdf files in loops
I need to make a bunch of PDF files of histograms. I tried gatelist = unique(mdf$ArrivalGate) for( gate in gatelist) { outfile = paste("../", airport, "/", airport, "taxiHistogram", gate, ".pdf", sep="") pdf(file = outfile, width = 10, height=8, par(lwd=1)) title=paste("Taxi time for Arrival Gate", gate, "by
2010 Jul 20
1
Call to rgamma using .C causes R to hang
Hi, I've been trying to get this working for ages, but it causes R to hang. Here is my C code saved as test1.c # include <R.h> # include <Rmath.h> void test1 (double *x, double *result) { result[0] = rgamma(*x, 2.0); } This was compiled using R CMD SHLIB test1.c & loaded in R using: dyn.load("test1.dll") out <-
2010 Oct 15
1
creating 'all' sum contrasts
OK, my last question didn't get any replies so I am going to try and ask a different way. When I generate contrasts with contr.sum() for a 3 level categorical variable I get the 2 orthogonal contrasts: > contr.sum( c(1,2,3) ) [,1] [,2] 1 1 0 2 0 1 3 -1 -1 This provides the contrasts <1-3> and <2-3> as expected. But I also want it to create <1-2> (i.e.
2010 Oct 29
2
R version 2-12.0 - running as 32 or as 64 bit?
Question: I installed R verison 2-12.0 on my Windows 7 (64 bit) PC. When I was installing it, it did not ask me anything about 32 vs. 64 bit. So, if I run R now - is it running as a 32-bit or a 64-bit? thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Aug 03
1
expand.gird with constraints?
Hi, R users, Here is an example. k <- c(1,2,3,4,5) i <- c(0,1,3,2,1) if k=1, then j=0 from i if k=2, then j=0, 1 from i if k=3, then j=0, 1, 2, 3 from i if k=4, then j=0, 1, 2 from i if k=5, then j=0, 1 from i so i'd like to create a list like below. > list k j 1 1 0 2 2 0 3 2 1 4 3 0 5 3 1 6 3 2 7 3 3 8 4 0 9 4 1 10 4 2 11 5 0 12 5 1 I tried expand.grid, but I
2009 Nov 15
2
Relase positive with log and zero of negative with 0
This is a very simple question but I couldn't form a site search quesry that would return a reasonable result set. Say I have a vector: x <- c(0,2,3,4,5,-1,-2) I want to replace all of the values in 'x' with the log of x. Naturally this runs into problems since some of the values are negative or zero. So how can I replace all of the positive elements of x with the log(x) and the