Error In Xj I
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about
Error In Xj I Invalid Subscript Type 'list' In R
Stack Overflow the company Business Learn more about hiring developers or posting ads with error in xj i drop = false subscript out of bounds us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Error In Xj I Invalid Subscript Type 'list'
a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error in xj[i] : invalid subscript type 'list' up vote 0 down vote favorite error in xj i invalid subscript type 'closure' I tried to split the data(bank) into training data and test data. But I somehow got an error below.How can I solve this problem? train = bank[1:100, ] test = bank[!train,] Status.test =Status[!train] glm.fit=glm(Status~Length+Right+Bottom+Top+Diagonal,data=bank,family=binomial,subset=train) #Error in xj[i] : invalid subscript type 'list' glm.probs=predict(glm.fit,test,type="response") glm.pred=rep("genuine",100) glm.pred[glm.probs>.5]="counterfeit" table(glm.pred,test)##classification on training data #Error in table(glm.pred, test) : all arguments must have the same length r share|improve this question edited Feb 21 at 7:58 error in xj[i] : invalid subscript type 'list' lda nicola 13k11022 asked Feb 21 at 6:53 K.heer 213 1 Maybe use -(1:100) instead of !train -- it's not clear what you're trying to do there. You may also be interested in the split function. –Frank Feb 21 at 6:57 It gets me the same error. bank data contains 200 rows so I want to split two parts and test my model into the test subset. –K.heer Feb 21 at 7:01 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote The issue is in subset=train. According to the ?glm. the subset should be a vector as oppose to a subset of original dataset: subset an optional vector specifying a subset of observations to be used in the fitting process. Hence, you may need to change the code to: glm.fit=glm(Status~Length+Right+Bottom+Top+Diagonal,data=train,family=binomial) or glm.fit=glm(Status~Length+Right+Bottom+Top+Diagonal,data=bank,family=binomial,subset=1:100) share|improve this answer edited Feb 21 at 14:53 answered Feb 21 at 14:27 Sixiang.Hu 1594 I solve this first one. But I tried the second one, it generates an error. >table(glm.pred,Status.test)##classification on training data Error in table(glm.pred, Status.test) : all arguments must have the same length > length(Status.test);length(glm.pred) [1] 68 [1] 60 –K.heer Feb 21 at 23:14 @K.heer, To compare the prediction with actual, you ca
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Error In .subset(x J) Invalid Subscript Type 'list'
policies of this site About Us Learn more about Stack Overflow the lapply invalid subscript type 'list' company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Error In Xj[i] : Invalid Subscript Type 'list' Random Forest
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes http://stackoverflow.com/questions/35533219/error-in-xji-invalid-subscript-type-list a minute: Sign up R: invalid subscript type 'list' up vote 11 down vote favorite I'm trying to use the indices of a sorted column of a dataset. I want to reorder the entire dataset by one sorted column. area.sort<-sort(xsample$area1, index.return=TRUE)[2] The output is a list, so I can't use it index through the whole dataset. Error in xj[i] : invalid http://stackoverflow.com/questions/8275876/r-invalid-subscript-type-list subscript type 'list' Someone suggested using unlist but I can't get rid of the ix*. Any ideas? Thanks > area.sort<-unlist(area.sort) ix1 ix2 ix3 ix4 ix5 ix6 ix7 ix8 ix9 ix10 ix11 ix12 ix13 45 96 92 80 53 54 24 21 63 81 40 66 64 list r subscript share|improve this question edited Apr 24 '14 at 18:27 Waldir Leoncio 3,06783458 asked Nov 26 '11 at 2:36 Peter Becich 3311516 add a comment| 2 Answers 2 active oldest votes up vote 13 down vote accepted The call to sort with index.return=TRUE returns a list with two components: x and ix. Indexing with [2] returns a subset of the list - still a list. If you index using [[2]] it should work better. That returns the element in the list. But indexing using $ix is perhaps a bit clearer. But then again, if you only need the sorted indices, you should call order instead of sort... share|improve this answer edited Nov 26 '11 at 16:00 42- 166k8147277 answered Nov 26 '11 at 2:56 Tommy 23.7k36067 3 +1 for mentioning order, which i
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://stackoverflow.com/questions/31899340/r-steamgraph-error-invalid-subscript-type-list about Stack Overflow the company Business Learn more about hiring developers or posting http://openmx.psyc.virginia.edu/thread/832 ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up R Steamgraph error: “invalid subscript type list” up vote 0 down error in vote favorite I get the following error using the steamgraph package library(streamgraph) streamgraph(data, "Keys" ,"Box.Office", date = 11-11-2011, interactive=TRUE) Error in .subset(x, j) : invalid subscript type 'list' Sample of the data: days;Box.Office;Key 1; 2324234;Lucy 2; 123123;Lucy 3; 898989;Lucy ..... 1; 231231;Interstellar 2; 32423;Interstellar r visualization stream-graph share|improve this question edited Aug 8 '15 at 23:26 SabDeM 4,5921727 asked Aug 8 '15 at 22:47 user3656702 13 * error in xj could not add the steamgraph tag –user3656702 Aug 8 '15 at 22:47 in the future, you're more likely to get pkg author help via github issue filings as I am not actively monitoring [r] streamgraph on SO. –hrbrmstr Aug 8 '15 at 23:48 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote First thing first, there is a typo in your code: Keys should be Key and the interactive argument is set to TRUE by default, you do not need to specify it. Most likely the problem is that streamgraph does not know how to deal with the days column, in fact if you change the days column with something (numeric or character) that can be converted to as.Date it works well. The example of the official page show that all example do have column (numeric or character) that can be interpreted as valid date, furthermore you can explore the body of the function with just typing streamgraph in R and you'll see more closely what it does. With the provided data, to allow function work you need other informations. Here is an example where I have converted the days column to dates. It works well an
Create new account Request new password Recent News Version 2.6.7 of OpenMx now available Version 2.5.2 of OpenMx now available Version 2.3.1 of OpenMx now available Advanced Genetic Epidemiology Statistical Workshop: October 26-30 2015, in Richmond, VA New features in OpenMx v2.2 Concerning the Currently Available Versions of OpenMx Version 2.0.1 now available OpenMx version 2.0 is officially released! Third OpenMx 2.0 beta is released Second OpenMx 2.0 beta is released more Navigation Feed aggregator Home › Forums › OpenMx Help › OpenMx Error Messages Error in .subset(x, j) : invalid subscript type 'list' Login or register to post comments 3 replies [Last post] Wed, 03/09/2011 - 22:03 svrieze Offline Joined: 01/03/2010 Hello, not sure this is the best place for this question, but here goes. I have a growth curve and I'm using the age at assessment as a definition variable in the factor loadings. There is missing data, both in the observed variables and the definition variables. It's an ACE twin model. The script is pasted below. I am getting an error message I've never seen before: ------begin output------- growthMalesFit <- mxRun(growthMales) Running growthMales Error in .subset(x, j) : invalid subscript type 'list' ------end output-------- Can anyone explain? Thanks for your time! growthMales <- mxModel("growthMales", mxModel("ACEm", mxData(observed=agem, type="raw"), mxMatrix("Lower",nf,nf, free=T, values=.8, byrow=TRUE, name="alm"), mxMatrix("Lower",nf,nf, free=T, values=.8, byrow=TRUE, name="clm"), mxMatrix("Lower",nf,nf, free=T, values=.8, byrow=TRUE, name="elm"), mxData(observed=agem, type="raw"), mxMatrix("Full",nrow=nv,ncol=nf, free=F, labels= c("data.ONE", "data.age110", "data.ONE", "data.age140", "data.ONE", "data.age170", "data.ONE", "data.age200", "data.ONE", "data.age240", "data.ONE", "data.age290"), byrow=TRUE, name="flm0"), mxMatrix("Full",nrow=nv,ncol=nf, free=F, labels= c("data.ONE", "data.age111", "data.ONE", "data.age141",