search for: xname

Displaying 20 results from an estimated 88 matches for "xname".

Did you mean: name
2003 Apr 04
3
trellis.graphic in for-loop
...1,2,2,5,5,5) as.data.frame(cbind(a,b,c))->q21 varnames<-colnames(q21) i<-9999 for (i in 1:3) { round(table(q21[,i])/sum(table(q21[,i])),3)*100->z1 as.data.frame.table(table(q21[,i]))->z1 round(z1[,2]/sum(z1[,2]),3)*100->z1[,2] colnames(z1)<-c(varnames[i],"y") xnames<-levels(z1[,1]) paste(xnames[1]," - low",sep="")->xnames[1] paste(xnames[length(xnames)]," - high",sep="")->xnames[length(xnames)] z1[,1]<-xnames as.factor(z1[,1])->z1[,1] barchart( horizontal=FALSE, z1[,2]~z1[,1], ylab=li...
2020 Jan 18
1
How to get an object name from C?
(earlier I sent it as html by mistake). Hi, How can I get from C an object name used as a function argument? I have sample code in C that gives me access to the name of the function being called: SEXP xname(SEXP x) { const char *fun_name = CHAR(PRINTNAME(CAR(x))); x = CDR(x); const char *arg_name = isNull(TAG(x)) ? "" : CHAR(PRINTNAME(TAG(x))); Rprintf("fn_name: %s, arg_name: %s\n", fun_name, arg_name); return R_NilValue; } > xname &lt...
2015 Feb 11
2
[PATCH] Fix for client certificate validation does not work
...c 2015-02-11 00:31:24.986198000 -0500 +++ dovecot-2.2.9/src/login-common/ssl-proxy-openssl.c 2015-02-11 00:32:19.262198000 -0500 @@ -951,54 +951,25 @@ return strstr(cert, "PRIVATE KEY---") != NULL; } -static void load_ca(X509_STORE *store, const char *ca, - STACK_OF(X509_NAME) **xnames_r) +static void load_ca(SSL_CTX *ssl_ctx, const char *ca) { - /* mostly just copy&pasted from X509_load_cert_crl_file() */ - STACK_OF(X509_INFO) *inf; - X509_INFO *itmp; - X509_NAME *xname; - BIO *bio; - int i; - - bio = BIO_new_mem_buf(t_strdup_noconst(ca), strlen(ca)); - if (bio == NULL) -...
2017 May 07
2
deparse(substitute(x)) fails in implied call to an S3 print method
In an implied call to an S3 print method, deparse(substitute(x)) returns "x", regardless of the name of object in .GlobalEnv, as indicated in the following: > Xnamed <- 1 > class(Xnamed) <- 'name.x' > print.name.x <- function(x, ...){ + namex <- deparse(substitute(x)) + cat('How can I get the name of x in .GlobalEnv?\n', + 'deparse(substitute(x)) gives only ', namex, '\n') + } > Xnamed How can I...
2009 Sep 19
3
eval(expr) without printing to screen?
...It works, but it prints to screen each time, which is annoying. There must be simple way to suppress this, or to use a slightly different set of commands, which will be obvious to those wiser than I... Here is a simpler mockup which shows the issue: x = data.frame(rbind(c(1,2,3),c(1,2,3))) xnames = c("a", "b", "c") names(x) = xnames for(i in 1:length(x)) { # Create a varying string expression expr = paste("y = x$", xnames[i], "[1]", sep="") # evaluate expression eval(parse(text=print(expr))) # This command prints the expression...
2010 Jun 17
0
Modifyiing R working matrix within "gee" source code
...(dim(y)[2] > 2) stop("Only binomial response matrices (2 columns)") } offset <- model.extract(m, offset) id <- model.extract(m, id) if (is.null(id)) { stop("Id variable not found") } nobs <- nrow(x) p <- ncol(x) xnames <- dimnames(x)[[2]] if (is.null(xnames)) { xnames <- paste("x", 1:p, sep = "") dimnames(x) <- list(NULL, xnames) } if (is.character(family)) family <- get(family) if (is.function(family)) family <- family() if (...
2017 May 07
0
deparse(substitute(x)) fails in implied call to an S3 print method
On 07/05/2017 3:56 PM, Spencer Graves wrote: > In an implied call to an S3 print method, deparse(substitute(x)) returns > "x", regardless of the name of object in .GlobalEnv, as indicated in the > following: > > > > Xnamed <- 1 > > class(Xnamed) <- 'name.x' > > print.name.x <- function(x, ...){ > + namex <- deparse(substitute(x)) > + cat('How can I get the name of x in .GlobalEnv?\n', > + 'deparse(substitute(x)) gives only ', namex, '\n') &...
2005 May 13
0
randomForest partialPlot x.var through function
...t; acoust.rf <- randomForest(VocalTF~Cruise+Spot+Spin+Delph+Stripe+Steno+Turs+Gramp+Lags+ + Lisso+FerPsu+Glob+mixspotspin+mixother+mixed+Size, + data=acoust,importance=TRUE,keep.forest=TRUE) > cruise.pp <- pplot(acoust.rf,Cruise) Error in "[.data.frame"(pred.data, , xname) : undefined columns selected Here's the traceback call... > traceback() 6: stop("undefined columns selected") 5: "[.data.frame"(pred.data, , xname) 4: pred.data[, xname] 3: partialPlot.randomForest(x = rf, pred.data = acoust, x.var = pred.var) 2: partialPlot(x...
2012 Aug 31
7
splits with 0s in middle columns
Hi, A column of my df looks like A 10/20/30 40/20 60/10/10/5 80/10 I want to split it such that the last column has the last composition and if there are not enough the middle columns get the 0s. That way my df would look like A1 A2 A3 A4 10 20 0 30 40 0 0 20 60 10 10 5 80 0 0 10 How can I do that ?? [[alternative HTML version deleted]]
2010 Dec 18
3
use of 'apply' for 'hist'
...These looks ok. However, I would like to achieve more. Apart from using a loop, is there are fast way to 'add' the titles to be more informative? that is, in the histograms, I want the titles to be 't distribution with dof=' the degrees of freedom. I have tried apply(Q5,2,hist,xnames=dof) which does not work; apply(Q5,2,hist(,xnames=dof)); does not work either and similarly, how do I add titles to qqnorm plot to make them informative? Thanks! casper -- View this message in context: http://r.789695.n4.nabble.com/use-of-apply-for-hist-tp3093811p3093811.html Sent from the...
2008 Oct 28
1
Source code for ppr (Projection Pursuit Regression)
Dear R users, I am looking for the source code of the implementation of ppr (Projection Pursuit Regression) in R. It will be great if citations of the source papers on which the implementation is based, are also provided. Thank you, Arvind Iyer, Grad student, Deptt. of Biomedical Engineering Viterbi School of Engineering University of Southern California, Los Angeles [[alternative HTML
2006 Jul 03
1
xlab, ylab in balloonplot(tab)?
I'm not understanding something. I'm trying to add xlab & ylab to a balloon plot of a table object. From docs I thought following should work: require(gplots) # From balloonplot example: # Create an example using table xnames <- sample( letters[1:3], 50, replace=2) ynames <- sample( 1:5, 50, replace=2) tab <- table(xnames, ynames) balloonplot(tab) # Try xlab, ylab: balloonplot(tab, xlab = "MyX", ylab = "MyY") But second plot is no different from first. R.version.string:...
2012 May 03
1
deparse(substitute(x)) on an object with S3 class
...an someone explain to me why deparse(substitute(x)) does not seem to work when x is of a user-defined S3 class? In my actual problem, my print method is part of a package, and the method is registered in the NAMESPACE, if that should make a difference. > print.testclass <- function(x,...){ xname <- deparse(substitute(x)) cat("Your object name is",xname,"\n") } testlist <- list() testlist[[1]] <- 1:10 class(testlist) <- "testclass" # This does not work as expected: > testlist Your object name is structure(list(1:10), class = "testclass...
2019 Oct 01
1
Improvement in hist command documentation
...he word "label" explicitly appear in the documentation for the ylab key That way, people looking either for the word "label" or the word "Frequency" in hist?s help will get more chance to find the ylab key. Here is the diff with revision 77240 17c17 < xlab = xname, ylab, --- > xlab = xname, ylab = "Frequency", 65,66c65,66 < \item{main, xlab, ylab}{these arguments to \code{title} have useful < defaults here.} --- > \item{main, xlab, ylab}{to change the default value of the main title, > the label of the x axis or the...
2005 Jul 17
1
printing the name of the arguments passed to a function
R2.1.1 Win 2k I have a function, B, within a function, A. I would like to have B print the name of the argument passed to it (not the value of the arguments). i.e., A<-function() { B<-function(x,y) { fit1<-lm(y~x,data=jo) print(summary(fit1) I want B to print the string "age" and the string "height". } B(age,height) }
2012 Mar 20
1
IMAP and POP3 per SSL
...included in Redhat Enterprise Linux 6.2: *** src/login-common/ssl-proxy-openssl.c 2010-12-30 10:42:54.000000000 +0100 --- src/login-common/ssl-proxy-openssl.c_1 2012-03-20 09:48:28.359508087 +0100 *************** *** 924,930 **** X509_STORE *store; STACK_OF(X509_NAME) *xnames = NULL; ! SSL_CTX_set_options(ssl_ctx, SSL_OP_ALL | SSL_OP_NO_SSLv2); if (*set->ssl_ca != '\0') { /* set trusted CA certs */ store = SSL_CTX_get_cert_store(ssl_ctx); --- 924,930 ---- X509_STORE *store; STACK_OF(X509_NAME) *x...
2002 Feb 27
1
Bug in glm.fit? (PR#1331)
...glm.fit ========================= 1 glm.fit <- 2 function (x, y, weights = rep(1, nobs), start = NULL, etastart = NULL, 3 mustart = NULL, offset = rep(0, nobs), family = gaussian(), 4 control = glm.control(), intercept = TRUE) 5 { 6 x <- as.matrix(x) 7 xnames <- dimnames(x)[[2]] 8 ynames <- names(y) 9 conv <- FALSE 10 nobs <- NROW(y) 11 nvars <- NCOL(x) 12 if (nvars == 0) { 13 cc <- match.call() 14 cc[[1]] <- as.name("glm.fit.null") 15 return(eval(cc, parent.fr...
2008 Aug 02
3
Bubble plots
Is there a way to create a 'bubble plot' in R? For example, if we define the following data frame containing the level of y observed for 5 patients at three time points: time<-c(rep('time 1',5),rep('time 2',5),rep('time 3',5))
2006 Sep 15
3
An update method for lists?
...exported function called updateList for a while, which looks like > lattice:::updateList function (x, val) { if (is.null(x)) x <- list() if (!is.list(x)) stop("x must be NULL or a list") if (!is.list(val)) stop("val must be a list") xnames <- names(x) for (v in names(val)) { existing <- v %in% xnames if (existing && is.list(x[[v]]) && is.list(val[[v]])) x[[v]] <- updateList(x[[v]], val[[v]]) else x[[v]] <- val[[v]] } x } Basically, it recursively replaces e...
2001 Oct 23
0
problems with postscript device
...is function and other I have producing plots, is that this uses split.screen(). I include the plot in latex, and the result is 1) a very small, unreadabkle plot and 2) the plot is rotated on head! I had no problems with other functions: boot.stat <- function (x, B = 1000, norm = FALSE) { xname <- deparse(substitute(x)) means <- meds <- numeric(B) for (i in 1:B) { s <- sample(x, replace = TRUE) means[i] <- mean(s) meds[i] <- median(s) } CImedian <- quantile(meds, c(0.025, 0.5, 0.975)) CImean <- quantile(means, c(0.025, 0....