Displaying 20 results from an estimated 10000 matches similar to: "Problem with mathematical expression and loop"
2006 Mar 06
3
how to make plotmath expression work together with paste
Recent questions about using plotmath have renewed my interest in this question
I want to have expressions take values of variables from the
environment. I am able to use expressions, and I am able to use paste
to put text and values of variables into
plots. But the two things just won't work together.
Here is some example code that shows what I mean.
plot(NA,xlim=c(0,100),ylim=c(0,100))
2000 Dec 18
2
Segmentation fault with expression on linux
I have a problem, that the plot of mathematical formula sometimes
crashes R on Linux (SuSE 6.2 and 7.0 on a Dual PIII/500 machine with 1GB
RAM). The problem occurs for example in demo("graphics"), i.e. in the
last part were the mathematical symbols are plotted.
There are several circumstances to reproduce this segmentation fault,
but the following is one of the most simple examples. The
2007 Jan 10
2
prime in expression in plot
I want to write something like (LaTeX style)
b_{norm}=\frac{F\prime(0)}{R\prime(0)}
how do I add the "prime" (first derivative) to a R-plot? The help of
"plotmath" just talks about "partialdiff". Can you complete this
command?
text( 30,0.05,labels=expression(b[plain("norm")]==frac(F(0),R(0))) )
Thanks,
Thomas
2008 Jan 16
2
Own classes in "histogram"
Hi,
I try to make a histogram from a variable that contains the number of
shoots from about 1000 individuals from a specific plant species (the range is 1-110).
Those numbers are highly skewed to the right.
My question is: how can I make my own classes with the lattice
"histogram"?
I tried it with "breaks=c(0,5,10,15,20,25,110)" but my "25-110"-class is presented
2012 Sep 17
4
Using paste to create and evaluate a variable expression
Is it possible to use "paste" to write out an expression and evaluate it?
Suppose I want to add two vectors X1 and X2, defined as follows:
X1 <- 1:6
X2 <- 6:1
If I write the following it looks like what I want but is a character:
noquote(paste(paste("X", 1, sep = ""), paste("X", 2, sep = ""), sep = "+"))
Is there a way to tell R
2010 Feb 24
1
Remove missing observations
Hi everyone
I have the following problem: My dataframe has 3 variables: ID, Year and
and an outcome variable. The dataframe contains repeated measurements
because the subjects filled out a questionnaire every year. The time span
covers 2 years.
Now I want to check if there is a significant change in the outcome over
the 2 years with a paired wilcox.test. The problem: Not every subject
2020 Nov 05
1
Named class vector
The source to the noquote() function looks like this:
noquote <- function(obj, right = FALSE) {
## constructor for a useful "minor" class
if(!inherits(obj,"noquote"))
class(obj) <- c(attr(obj, "class"),
if(right) c(right = "noquote") else "noquote")
obj
}
Notice what happens with right =
1997 Aug 20
1
R-alpha: R-0.50-a3(+) Method despatching bug ?
It is very wierd... Can some of you confirm the following behavior ?
It is a new bug (feature ?) which was not yet in 0.49 ...
noquote <- function(obj) {
## constructor for a useful "minor" class
if(!inherits(obj,"noquote")) class(obj) <- c(class(obj),"noquote")
obj
}
"[.noquote" <- function (x, subs) structure(unclass(x)[subs], class =
2007 Oct 22
2
save as pdf
Hello,
I just wanted to save a graphic in the pdf-format. But id failed:
Fehler: Invalid font type
Zus?tzlich: Warning messages:
1: font family not found in PostScript font database
2: font family not found in PostScript font database
I use R 2.6.0 with all packages updated recently.
Any idea?
Thank you very much!
Best,
Denis
__
Denis Aydin
mailto:Denis.Aydin at stud.unibas.ch
Montag, 22.
2005 Mar 17
1
kernlab sigest
hello,
I have the following problem setting parameter 'frac' in the sigest
function of the kernlab package.
## executing the ?sigest example:
library(kernlab)
data(spam)
srange <- sigest(type~.,data = spam)
## works fine...
## setting 'frac' explicitly
## (in this case even to the default of .25)
options(error=recover)
srange <- sigest(type~.,data = spam, frac = .25)
##
2011 Jan 24
2
normality and equal variance testing
I currently have a program that automates 2-way ANOVA on a series of endpoints,
but before the ANOVA is carried out I want the code to test the assumptions of
normality and equal variance and report along with each anova result in the
output file. How can I do this?
I have pasted below the code that I currently use.
library(car)
numFiles = x #
2009 Aug 11
1
Passing a list object to lapply
Hello,
I'm having difficulty passing an object name to a lapply function. Can
somebody tell me the trick to make this work?
#Works
T13702 <- TRACKDATA[["13702.xls"]][["data"]]
min(unlist(lapply(list(T13702), function(x) mdy.date(x[1, 2], x[1, 1],
x[1, 3]))))
16553
#Works
d<-2
assign(paste("T",substr(names(TRACKDATA)[d],1,(nchar(names(TRACKDATA)[d]
2024 Feb 02
1
gathering denominator under frac
... or if I understand correctly, simply
expression(frac(additive ~ HCO[3]^"-",
true ~ HCO[3]^"-" )))
Cheers,
Bert
On Fri, Feb 2, 2024 at 3:06?AM Rui Barradas <ruipbarradas at sapo.pt> wrote:
> ?s 10:01 de 02/02/2024, Troels Ring escreveu:
> > Hi friends - I'm plotting a ratio of bicarbonates i ggplot2 and
> >
> >
2010 Feb 08
2
object 'xxx' not found
The following line of code seems fairly straight forward, yet it is kicking
back an error message:
for (i in
1:length(mean.natveg.frac)){month.observed[i]=as.numeric(names(mean.natveg.frac[i]))%%12}
Error message:
Error in month.observed[i] = as numeric(names(mean.natveg.frac[i]))%%12 :
object 'month.observed' not found
Seems like its not found because I'm trying to define it. Also
2024 Feb 02
1
gathering denominator under frac
?s 10:01 de 02/02/2024, Troels Ring escreveu:
> Hi friends - I'm plotting a ratio of bicarbonates i ggplot2 and
>
> ylab(expression(paste(frac("additive BIC","true BIC")))) worked OK - but
> now I have been asked to put the chemistry instead - so I wrote
>
>
2015 Feb 20
2
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
Hi,
my proposal is based on a mathematical proof (see mail
before) and yours is correct too. They cannot but match.
Let's inspect your examples:
Ady wrote:
> ISO size: 1'085'736'960 bytes ( > 1GiB)
This are exactly 132 cylinders of 255x63.
132 is divisible by 4. So there is no padding needed.
> Cylinders (1st attempt)=132
> [...]
> 2120580 / 4 = 530145, so
2008 Jun 15
1
c.noquote() weirdness
I haven't been able to get anywhere tracking this down. It seems that c.noquote() does
something strange with its third (and subsequent) parameters:
R-2.7.0 under NetBSD, R-2.6.0 under Solaris, and R-2.8.0 (unstable) (2008-06-10 r45893)
under WinXP, I get:
> c(noquote('z'), 'y', 'x', '*')
[1] z y x * x *
>
or:
> c(noquote('z'),
2024 Feb 02
1
gathering denominator under frac
Hi friends - I'm plotting a ratio of bicarbonates i ggplot2 and
ylab(expression(paste(frac("additive BIC","true BIC")))) worked OK - but
now I have been asked to put the chemistry instead - so I wrote
?ylab(expression(paste(frac("additive",HCO[3]^"-","true",HCO[3]^"-"))))
- and frac saw that as additive = numerator and HCO3- =
2009 Aug 20
1
lattice xyplot strip colors and location
Hi all,
I've been trying (unsuccessfully) to modify an xyplot I created using the lattice package. I would like to change default strip colors and locations.
I started with numeric data in 4 columns, which look like this:
0.25 2 1 32
0.25 2 2 30
0.25 2 3 27
0.25 2 4 23
0.25 2 5 17
0.25 3 1 30
0.25
2009 Apr 07
3
write text file as output without quotes
Hi R,
When I use the below to write the text file
try=data.frame(rep("a",5), rep("b",5))
write.table(try,"z:\\try.txt",row.names=F,col.names=F,sep="\t")
the output contains two columns with quotes! Is there a way to write
without quotes?
I tried
try[,1]=noquote(try[,1])
try[,2]=noquote(try[,2])
Thank you,
Regards,
Ravi Shankar