Displaying 20 results from an estimated 3000 matches similar to: "Converting to subscripts and superscripts"
2008 Jul 22
2
Decoding subscripts/superscripts from CSVs
Hi,
I have a CSV file with various biological reactions. Subscripts, superscripts,
and italics are encoded in carats, and I was wondering if R can actually
recognize those and print actual superscripts, etc. Here's an example:
<i>S</i>-adenosyl-L-methionine + rRNA = <i>S</i>-adenosyl-L-homocysteine +
rRNA containing
2012 Apr 12
3
Remove superscripts from HTML objects
Is there some way to remove superscripts from objects returned by
html/xmlParse (XML package)?
h <- "<html><p>Cat<sup>a</sup></p><p>Dog</p></html>"
doc <- htmlParse(h)
xpathSApply(doc, "//p", xmlValue)
[1] "Cata" "Dog"
I could probably remove the <sup> tags from the "h" object above,
2008 Jul 01
3
Change name of a specific column of a data frame
Hi,
Sorry for the simple question. Is there a way to change the name of only one
column of an existing data frame?
I know colnames allows you to set the name of all the columns, but only one
column in the middle of my data frame needs a new name.
Thanks,
-Nina
2008 Jun 30
4
Problem reading a CSV
Hi,
I have a CSV file where each row has at least 20 columns and some rows have up
to 30 columns of data. When I use the command,
Pathways<-read.table('MetaCycSample3.csv',sep=',',header=FALSE,quote='"')
anything past the 21st column gets kicked down to a new row. How can I fix this?
Thanks,
-Nina
2008 Jul 01
3
Ignore blank columns when reading a row from a table
Hi,
I am extracting data from a table where the rows have different column lengths,
and empty columns have NA in them. Whenever I extract a row with some empty
columns, the resulting vector carries all the NAs. Is there a way to ignore the
empty columns?
Thanks,
-Nina
2008 Jul 17
3
Display variables when running a script
Hi,
I know this must be a stupid question, and sorry in advance for being such a
noob. But, is there way to get R to display only certain variables when running
a script. I know if you want to see the value of a variable when using the
interface, you just type it in and hit enter, but is there a command that I can
use in a script file that will show the value at a certain point?
Thanks,
-Nina
2004 Aug 09
4
Simultaneous subscripts and superscripts
Dear List,
I'd like to add text to a plot where a text symbol has both a
superscript and subscript. For example, the variable S with a
superscript 2 and a subscript t. I have been able to accomplish this
using either
expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
or
expression( {S[t]}^2 )
but the spacing isn't quite right (or rather what I'd like) using
either of
2008 Jul 02
2
Problem reading from a data frame
Hi,
I have a data frame with strings that have two letters and four numbers. When I
store a whole row as a new vector and try to remove the preceding letters using
the gsub command, it returns characters of single numbers that have no relation
to the numbers in each string. I also noticed that when I view the new vector
before using gsub, it includes the original headers from the data frame. For
2009 May 18
2
Superscripts and subscripts in trellis graphics
I'd like to annotate an xyplot with an R^2 value, but can not find the
syntax to define the superscript format for the text.
I'd appreciate suggestions,
xyplot(SharkSloughEggs.df$Sharkeggs.rel +
SharkSloughEggs.df$SharkHatched.rel + SharkSloughEggs.df$SharkFlooded.rel +
HSI.shark$MEAN ~ Year,
pch=c(1,9,5,4), lty=c(1,6,3,4), lwd = c(2), col = c("black",
2008 Jul 24
2
Help with which()
Hi,
I'm using which to find the position of a value in my data table, and it is
returning the correct position and the position of another number that differs
by an extra decimal place. For example, when I do:
where1<-which(Operons==3573.1,arr.ind=TRUE)
it returns the position of that number and of 3573.15.
Is it possible to get the function to only return a position if the number
2008 Aug 01
1
Properly Parsing Pre-Superscripts & Displaying Them With grid.text
Hi all... I?m making a chart dealing with frequencies of isotopes of various
elements. For instance, I'd like the following text to appear on a chart
with the "35" and "37" as superscripts:
Based upon:
35Cl: 75%
37Cl: 25%
I am having problems properly parsing the superscript that preceeds the
"Cl", since there is no character ahead of the superscript (I saw
2008 Jun 10
1
Really simple question
Hi,
I don't have too much programming experience - sorry in advance if this question
is very basic, and thanks for the help.
I have a vector of numbers and another vector of a subset of those numbers. How
can I create a third vector with all the numbers in the original list that
aren't in the given subset. Like this:
List1 subset --> result
1 1 2
2 3
3 4
2008 Jun 11
1
Search entire table for a value
Hi,
I have a table of numbers without any repeats. Is there a function that will
search the entire table for a specified value and return the indices if it is
found? Also, some rows may have columns without values.
Thank you so much,
-Nina
2008 Jun 18
1
Extract only certain rows from a table
Hi,
I have a table where column 1 has ID numbers and column two has data, and I have
a vector containing a subset of those ID numbers. How can I create a new table
with only the rows from the old table that match the IDs in the vector, like
below:
Original Table:
ID Value
1 123
2 123
3 123
4 123
vect: [2, 3]
New table:
ID Value
2 123
3 123
2008 Jun 27
1
Error reading a table
Hi,
I get the following error when I try to read in a CSV file:
> Path<-read.table('MetaCycSample2.csv',sep=',', header=FALSE)
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 17 did not have 5 elements
Some of the rows have more columns than others. Also when I try the read.csv
command, the very last column, which only has one cell
2008 Jul 14
1
Help with an error message
Hi,
I am writing a very long program that deals with multiple large databases which
often have missing data cells and other quirks. I've been testing it on small
samples of the data so it doesn't take too long, but when I tried it using the
real files, it ran for about a minute and then gave me this error message:
Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow
2002 Jun 19
1
superscripts in xyplot labels
R-helpers;
I tried to get a superscripted 3 in the following xyplot example but failed:
>data(whiteside)
>xyplot(Gas ~ Temp | Insul, whiteside, panel =
function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.lmline(x, y, ...)
}, xlab = "Average external temperature (deg. C)",
ylab = paste(paste("Gas consumption (1000", expression(ft^3),")"), aspect
2009 Jul 27
6
Superscripts and rounding
I am new to the world of R/programming so this may be a really easy question.
I thank you for your patience and help in advance
I would like the characters km^2 to be displayed on the plot subtitle as km
squared - two as a superscript.
I would also like to have the numbers from the data set for longitude and
latitude to be rounded to four decimal places.
Thank you.
plot (
2011 May 05
3
cross-correlation table with subscript or superscript to indicate significant differences
Hi, I wonder whether the following is possible with R, and whether anyone has done that and can share his/her code with me. I have a correlation matrix, and I want to create a correlation table that I can copy to Microsoft Word with a superscript above each correlation, indicating significant differences in the same row. That is, when correlations in the same row do not share superscript, it means
1999 Dec 13
1
Superscript or subscript on Left hand side of symbol
Is there a way to get subscripts and superscripts on the left hand side of
a symbol? For example, oC or oF (degree Celsius or Fahrenheit)
TIA
Partha
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the