similar to: problem with function "rep"

Displaying 20 results from an estimated 10000 matches similar to: "problem with function "rep""

2009 Oct 15
1
Discriminant plot
Hi Alejo, According to my knowledge the two plots are different because in the first one a point belongs to a group depending on its group in the data whereas in the second plot a point belongs to the group predicted by the linear discriminant analysis. I hope somebody will correct me if I am wrong. Alain Alejo C.S. wrote: > Hi Alain, this is the code: > > > library(MASS) >
2018 Feb 06
3
Aggregate behaviour inconsistent (?) when FUN=table
Dear R users, When I use aggregate with table as FUN, I get what I would call a strange behaviour if it involves numerical vectors and one "level" of it is not present for every "levels" of the "by" variable: --------------------------- > df <- data.frame(A=c(1,1,1,1,0,0,0,0),B=c(1,0,1,0,0,0,1,0),C=c(1,0,1,0,0,1,1,1)) >
2011 Jun 06
2
adding an ellipse to a PCA plot
Hi, I created a principal component plot using the first two principal components. I used the function princomp() to calculate the scores. now, I would like to superimpose an ellipse representing the center and the 95% confidence interval of a series of points in my plot (as to illustrate the grouping of my samples). I looked at the ellipse() function in the ellipse package but can't get it
2013 Mar 20
3
Introduction to R. Any such documentation in Vietnamese?
Dear fellow users Are there any Vietnamese language resources for beginners of R? If so, I would be interested in hearing from people who have had experience with them and which are better (if there is more than one). I am involved with an aid project in Vietnam, and would like to move the scientists involved from using Excel for 'analysis' to R. Thanks .... Peter Alspach The
2018 Feb 06
0
Aggregate behaviour inconsistent (?) when FUN=table
Don't use aggregate's simplify=TRUE when FUN() produces return values of various dimensions. In your case, the shape of table(subset)'s return value depends on the number of levels in the factor 'subset'. If you make B a factor before splitting it by C, each split will have the same number of levels (2). If you split it and then let table convert each split to a factor, one
2012 Jan 12
1
problems with method ken.sto in package soil.spec: subscript out of bounds
Hi All, I would like to use Kennard-Stone algorithm for splitting a dataset. > mydata <- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/binary.csv ")) > library("soil.spec") > ken.sto(mydata,per.n=0.3) Error in ken.sto(mydata, per.n = 0.3) : subscript out of bounds I found that other people run into this problem as well:
2009 May 25
2
inconsistency in ?factor
In the almost current development version (2009-05-22 r48594) and also in https://svn.r-project.org/R/trunk/src/library/base/man/factor.Rd ?factor contains (compare the formulations marked by ^^^^^^) \section{Warning}{ The interpretation of a factor depends on both the codes and the \code{"levels"} attribute. Be careful only to compare factors with the same set of levels (in
2008 Jul 16
1
NAMESPACE vs internal.Rd
Hi the list, When we use package.skeleton, it create some file in the man directorie. - If we use package.skeleton with namespace=FALSE, it create a file toto-internal.Rd - If we use package.skeleton with namespace=TRUE, it does not create the file toto-internal.Rd Why is that ? Christophe
2008 Oct 29
2
definition of a function
Hello, R subscribers. I would like to define a function like this one: Fun <- function(x) sin(x)/x with value 1 at x=0. How can I do that? Is there a way to plot it "symbolically", without using x as a vector? e.g. x <- seq(from=-10, to=10, length=100) plot(x, Fun(x)) Thank you in advance.
2009 Feb 22
2
How to reshape this data frame from long to wide ?
I tried cast and melt in reshape package, but still can't convert this data frame m m [,1] [,2] [1,] "A" "1" [2,] "A" "2" [3,] "B" "3" to this form. m1 [,1] [,2] [1,] "A" "B" [2,] "1" "3" [3,] "2" NA Please help. [[alternative HTML version deleted]]
2009 May 27
1
Constrained fits: y~a+b*x-c*x^2, with a,b,c >=0
I wonder whether R has methods for constrained fitting of linear models. I am trying fm<-lm(y~x+I(x^2), data=dat) which most of the time gives indeed the coefficients of an inverted parabola. I know in advance that it has to be an inverted parabola with the maximum constrained to positive (or zero) values of x. The help pages for lm do not contain any info on constrained fitting. Does anyone
2008 Dec 05
3
Logical inconsistency
Dear colleagues Please could someone kindly explain the following inconsistencies I've discovered when performing logical calculations in R: 8.8 - 7.8 > 1 > TRUE 8.3 - 7.3 > 1 > TRUE Thank you, Emma Jane [[alternative HTML version deleted]]
2008 Dec 02
1
r2 for lm() with zero intercept
Hello list I'm a little confused about the R2 and adjusted R2 values reported by lm() when I try to fix an intercept. When using +0 or -1 in the formula I have found that the standard error generally increases (as I would expect) but the R2 also increases (which seems counter intuitive). I've pasted a short test script below to illustrate. I do realise that many will say I shouldn't be
2008 Dec 01
2
Warning: missing text for item ... in \describe?
Hello: What might be the problem generating messages like "Warning: missing text for item ... in \describe" with "R CMD check" and "R CMD install"? With the current version of "fda" on R-Forge, I get the following: Warning: missing text for item 'fd' in \describe Warning: missing text for item 'fdPar' in \describe
2009 Apr 27
2
The .tex version of the manual in foo.Rcheck
In version 2.8.1, running Rcmd check on the package foo would leave the file foo-manual.tex in the folder foo.Rcheck. But as of 2.9.0 only foo-manual.pdf and foo-manual.log are there. Is this intentional? Anyway it is inconvenient, because I would occasionally like to include the manual at the end of a set of exercises, and this was a convenient file to \input with a few select %'s added.
2008 Feb 13
3
indices of rows containing one or more elements >0
Hi, Given test <- matrix(c(0,2,0,1,3,5), 3,2) > test[test>0] [1] 2 1 3 5 These are values >0 > which(test>0) [1] 2 4 5 6 These are array indices of those values >0 > which(apply(test>0, 1, all)) [1] 2 This gives the row whose elements are all >0 I can't seem to get indices of rows containing one or more elements >0 [[alternative HTML version deleted]]
2009 Mar 26
1
Bug? FORTTRAN help
I was feeling masochistic the other day and we have been having some wierd memory problems so I started digging into the source for L-BFGS-B. In the lbgfsb.c file I see the following code: /* Cholesky factorization of (2,2) block of wn. */ F77_CALL(dpofa)(&wn[*col + 1 + (*col + 1) * wn_dim1], &m2, col, info); if (*info != 0) { *info = -2; return; } If I am not mistaken
2007 Dec 06
1
Solve.QP
Hi there, I have a major problem (major for me that is) with solve.QP and I'm new at this. You see, to solve my quadratic program I need to have the lagrange multipliers after each iteration. Solve.QP gives me the solution, the unconstrained solution aswell as the optimal value. Does anybody have an idea for how I could extract the multipliers? Thanx, Serge "Beatus qui prodest quibus
2009 Jul 13
2
Problems in plotting with abline
Dear R-users, I am using R(a package igraph) to calculate certain topological features of networks. When I try to draw a plot between these features I get an error. Following is the code I am using : *> plot(met_eco_deg,met_eco_bet) > lmout<-lm(met_eco_bet ~ met_eco_deg) > abline(lmout) Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new
2007 Dec 05
1
Quadratic programming
Hi, I'm quite new at R and I haven't found the answer to my question anywhere on the net, so either it is trivial or not documented. So, bare with be. I am using the quadprog package and its solve.QP routine to solve and quadratic programming problem with inconsistent constraints, which obviously doesn't work since the constraint matrix doesn't have full rank. A way to solve this