similar to: Using bold font with bquote

Displaying 20 results from an estimated 1000 matches similar to: "Using bold font with bquote"

2009 Aug 12
2
Plotting sigma symbol with unicode and turning into pdf
Paul, You solution worked out really well when I ran my code in R. However, when I try to turn the plot into a pdf, the unicode string no longer seems to function and instead of the sigma symbol there are just two periods (See example code below). The following is the code working in the R environment just like I want it to look: set.seed(1) Data=rnorm(100,sd=10000) plot(density(Data))
2009 Aug 11
1
Paste symbol and calculation in plot
I'm trying to annotate a density plot and I would like to have R calculate the standard deviation and place it in the plot next to the standard deviation symbol "sigma". I can successfully use the text command to paste "StDev =",round(sd(Data),digits=3)) on the plot. However, I have trouble when I want to replace "StDev" with the Greek symbol sigma (See code
2012 Mar 22
2
Quicker way to apply values to a function
Hi all, myint=function(mu,sigma){ integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value } mymu=seq(-3,3,length(1000)) mysigma=seq(0,1,length(500))[-1] k=1 v=c() for (j in 1:length(mymu)) { for (i in 1:length(mysigma)) { v[k]=myint(mymu[j],mysigma[i]) k=k+1 } } Basically, I want to investigate for what values of mu and sigma, the integral is divergent. Is there another way
2009 Jul 20
1
locate substring in the string it belong to
Hi R users, I am trying generate the indices for locating a in the string it come from. Given the length of the string, it will take too long using the combn() for further comparison. I am wondering if R has any built-in function for this purpose. To make it concrete: this.substring="cc" this.string="ccc" start.location=1,2 end.location=2,3 Thanks in advance, Kevin
2009 Aug 05
1
overlap two graph
Hi everyone,I need you all help. I want to create few image in same diagram. For example, I wan draw two ellipse in same diagram. plot(ellipsePoints(2,5, alpha = 60), asp=1) and plot(ellipsePoints(2,5, alpha = 30), asp=1) How to display both ellipse together? both is different in angle. Thank you. -- Hemavathi Ramulu [[alternative HTML version deleted]]
2009 Aug 12
1
inserting into data frame gives "invalid factor level, NAs generated"
I am calculating some values that I am inserting into a data frame. From what I have read, creating the dataframe ahead of time is more efficient, since rbind (so far the only solution I have found to appending to a data frame) is not very fast. What I am doing is the following: # create data frame goframe = data.frame(goA = character(10), goB = character(10), value = numeric(10)) goframe[1,] =
2009 Aug 05
1
Starting NONMEM (nmfe6) from R
Hello, I have made an R script that prepares a NONMEM dataset and I would like to start the NONMEM run right after the dataset is ready. I am using windows XP, R 2.9.1 and NONMEM 6. I have prepared a run.bat file that looks like this: ---------------------------------------- call K:\nmvi\NMdirectories.bat call K:\nmvi\nmfe6 "path\control.txt" "path\output.txt"
2009 Jul 30
1
Continue to finish for loop even there is an error in one of rounds.
I am trying to fit a logistic model to my 10 year data (1999-2008) by year. Codes like below: Year <- c(1999: 2008) for(y in 1:length(year)) { file.input <- paste("C:\\", year[y], "\\data.csv", sep="") table <- read.csv(file=fileinput, header=TRUE, as.is=TRUE, na.strings=c("")) initial <- getInitial(percent ~ SSlogis(age, Asym,
2012 Oct 20
1
Logistic regression/Cut point? predict ??
I am new to R and I am trying to do a monte carlo simulation where I generate data and interject error then test various cut points; however, my output was garbage (at x equal zero, I did not get .50) I am basically testing the performance of classifiers. Here is the code: n <- 1000; # Sample size fitglm <- function(sigma,tau){ x <- rnorm(n,0,sigma) intercept <- 0 beta
2009 Aug 11
1
Prevent sequential repeated values in data frame column
Hi, I'm trying to randomize a sequence of trials for an experimental design. The trials consist of values for each of two factors. As is there are 30 combinations of the two factors, and I want them to be ordered randomly but with the requirement that for one of the factors, the value can never be the same as the previous value. I'm currently randomizing my dataframe by using:
2009 Aug 11
1
Generating R plots via Ruby CGI
Greetings, I'm trying to debug a simple two-line plot routine in R called test.R: cor(swiss) plot(swiss$Catholic, swiss$Examination) These commands work fine when typed into R. They also work fine when I invoke this routine by the following line into my terminal: R --slave < /Library/WebServer/Documents/gsa/test.R My ultimate goal is to send data to this R routine via a web
2010 Jan 25
2
Two == expressions in bquote
Hi, I want to put text on a plot containing something like: a = b^2 = <squared numeric value of b> using bquote. Example: mu = 5 plot(1:10,1:10) text(2,8, bquote(delta == mu^2)) # This works text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable text(2,8, bquote(delta == mu^2 == .(mu^2))) # This doesn't work The last text function returns the error:
2008 Oct 02
1
using bquote to construct function
Hi, R-help, (sessionInfo at the end) I'm trying to construct a function using bquote and running into a strange error message. As an example, what I would like to do is this: z <- 2 eval(bquote(function(x, y) { x^.(z) + y }))(2, 3) However, I get the following: Error in eval(expr, envir, enclos) : invalid formal argument list for "function" However, if I change the
2006 Jul 30
3
main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi, I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. This code works> main= bquote(paste("Results for ", beta ==.(b1)) but I also need the index 3. I tried (simplified): >plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) and a few other versions, but I can not get it to run properly. Any help would
2006 Feb 10
1
?bquote
?bquote says it returns an expression but, in fact, it typically (though not always) returns a call object: > class(bquote(a+b)) [1] "call" > class(bquote(1)) [1] "numeric"
2015 Jul 15
3
bquote/evalq behavior changed in R-3.2.1
Hello, I upgraded from 3.1.2 to 3.2.1 and am receiving errors on code that worked as I intended previously. Briefly, I am using bquote to generate expressions to modify data.table objects within a function, so I need the changes to actually be stored in the given environment. Previously, I used code like the following: test <- list(bquote(x <- 10)) fenv <- environment() rapply(test,
2008 Jan 25
2
Using bquote: question
Hi all Observe: x <- c(1,2) y <- c(1,-1) phi <- 1 p <- 2 par( mfrow=c(1,2)) plot(x , y, main=bquote( paste( p==.(p)," and ",phi==.(phi)) ) ) plot(y ~ x, main=bquote( paste( p==.(p)," and ",phi==.(phi)) ) ) par( mfrow=c(1,2)) On my system (details below), the first plot is correct (in my understanding), and produces a title reading "p=2 and phi=1"
2013 Jan 04
1
Using bquote to create names a for a list
Hello, How would i use bquote to create names for a list. e.g. to create list(a=10) bquote(list(.(X)=10), list(X="a")) does not work. The best i could come up with is bquote({ a=list(10);names(a)=.(X); a}, list(X="a")) which is quite ugly. Is there an elegant way to solve this? Regards Saptarshi [[alternative HTML version deleted]]
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will
2011 Jun 23
1
Saved EPS does not match screen when using bquote(.(i))
Here's a fairly minimal-case example in which the saved EPS does not match the screen. The error comes when using bquote(.(i)) instead of bquote(1), as demonstrated by the two minimally different cases below. Very strange. Any clues as to why? #---------------- begin ------------------- # Version A. X axis labels have subscripts as constants. EPS is correct. windows() layout( matrix( 1:2 ,