![]() As before, I relied heavily on Stack Exchange and many other sites for figuring out how to get my plot looking the way I needed it to, and so this is my attempt to contribute back to the broader community. Now about the confusion around GraphQLList: if it's just a list, there's actually no need to define a separate GraphQL type for that.This is another post regarding some plots that I needed to make for a publication. That's why you're getting "items": null in the query response. But the getItems() function returns an array or a promised array and does not have field items. Therefore, the query's itemList field must be resolved to an object which has an items field. In your schema query, itemList field is of type itemListType. Then I'll discuss how GraphQLList is generally used. I'll first explain the root cause of your problem. Rownames(A_1) <- NULL rownames(A_2) <- NULLĬolnames(A_1) <- NULL colnames(A_2) <- NULLįinally, solve the optimization problem and retrieve the parameter values: library(quadprog)Īfterwards, given a matrix X_test, the model can be used to predict via: Y_pred <- sign(apply(X_test, 1, function(x) beta_0 + sum(beta * as.vector(x)))) If you want to assign by reference within a ame or data.table (replacing an existing column only) then set from the data.table package works (even with ames) library(data.table)Įval and bquote dat1 <- ame(x=1:5)įor(x in sapply(c('dat1','dat2'),as.name)), 0, 0, 0. To manipulate entirely using character strings using get and assign assign('dat2', `[[<-`(get('dat2'), 'VAR1', value = 2:51)) If you want to assign new values to VAR1 within dat2, dat2] <- 1:50 What you are looking for is [[<- # assign the values from column (named element of the list) `VAR1` Note that assignment to an attached list or data frame changes theĪttached copy and not the original object: see attach and with.Ī column of a ame is an element of a list Set elements of vectors, names, attributes, etc. You can also note this from the help page for assignĪssign does not dispatch assignment methods, so it cannot be used to ![]() ![]() Don't use assign and get if you can avoid it. Lets assume that we have a valid ame with 50 rows in each dat2 <- ame(c1 = 1:50, VAR1 = 51:100)ġ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |