[R] problem understanding the result of pnorm2d()
Hi all, I am using the fMultivar package for calculating probabilities of bivariate normal distribution. I use the manual's example to understand what is going on, but let's take it for smaller dimensions of x and y: ## Bivariate Normal Density: x = c(0.3,10) y = c(-10,0.2) X = grid2d(x,y) z = pnorm2d(X$x, X$y, rho = 0.5) Z = list(x = x, y = y, z = matrix(z, ncol = length(x))) persp(Z, theta = -40, phi = 30, col = steelblue) What does the grid2d() command do? In the Z- result in the matrix, I really cannot figure out where the 4 probabilities are referring to. Can anyone enlighten me? Thank you for your time! Ismini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] anova() or aov()?
Dear all, I have a simple (I think) question that is troubling me lately: Is there any main difference between anova() command and aov() command when performing an ANOVA in Experimental design analyses? Thank you for your time, Ismini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] what is there in a numeric (0)?
Hello! I will repeat my question :what is there in a numeric(0)? In a function, I have several matrices with dimensions 288x1, also matrices with dimensions 0x1 (numeric(0)). But I really do not know in which matrix there are elements or not. So, these matrices that do not contain anything, if I am saying this correctly, I would like to make them matrices with the same dimensions as the first ones but with NA elements and the ones with elements to remain as they are. For this reason, I thought to use the ifelse command. But I have problems determining the arguments of this ifelse... I tried to use: A1 - ifelse(nrow(A)==0,matrix(rep(NA,288),288,1),A) If A is a matrix with elements, then I get a A1 matrix with replicated 288 times its first element, but I want the initial A matrix. If A is a matrix with no elements (numeric(0)) then I get only 1 NA. So, how can I test if there are elements in my matrix and if there are to return itself the matrix and if there are not to get a matrix 288x1 with NAs? Thank you for your time! Ismini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] a date x-axis in a xyplot
Dear all, In the x-axis of a xyplot I define dates ,for example 01-10-2007 instead of numbers, in a range of 77 days. I would like in my output to have the whole date as a point. When I plot it, then the output is a big mess! I can not distinguish anything; the result is a thick, black line of overlapping dates. Is there any solution so I can really distinguish and see clearly the dates in the x-axis? Thanks in advance! Ismini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] difficulties in reading a .prn file
Hello, I am having problems in reading appropriately a huge .prn file of almost 450.000 rows and 29 columns. The variables are consisted of characters, dates, time, numeric values. I use read.table(file.prn, header=F, sep=\t, na.strings=*), where the missing values are declared as *. The R engine is reading it like it, but when I am asking for the dimensions of the data frame I get the right number of rows but only 1 column... dim(file) [1] 422344 1 It is somehow as it reads the whole row as one column. When I am asking for the first 3 lines for example I got the message that R is reading everything as factors and I get something like this below: data12L[1:3,] ID DATETime RRR VEl Leng Weig Sub var1 var2 var3 var4 var5 var6 var7 var8 var9 var10var11var12var13var14var15VAR1VAR2VAR3 VAR4VAR5VAR6VAR7VAR8VAR9 VAR10 VAR11 VAR12 VAR13 VAR14 VAR15 [2] 54678611 39356 0.1572569RW 892014 21400 V11A11 4500 7200 4700 5000 * * * * * * * * * * * 0 527 594 567 * * * * * * * * * * * [3] 54678612 39356 0.158RW 811716 33000 T11O3 7100 9100 5700 5600 5500 * * * * * * * * * * 0 397 605 133 133 * * * * * * * * * * 422344 Levels:ID DATETime RRR VElLeng Weig Sub var1 var2 var3 var4 var5 var6 var7 var8 var9var10var11var12var13var14var15 VAR1VAR2VAR3VAR4VAR5VAR6VAR7VAR8VAR9 VAR10 VAR11 VAR12 VAR13 VAR14 VAR15 .. Is there any solution? Any suggestion? And what is going on with the *? Is there any suggestion for this as well??? Thanks for your time! Ismini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.