On 19/08/18 16:12, Jim Lemon wrote:
Hi Rolf,
That's what comes of being in a hurry.
legend(4.1,30,c("A+","A","B","C","D","E","U"),
fill=c("white","lightblue","blue","orange","green","red","pink"))
and I thank you for alerting me to the fact that the legend arguments
in barp don't position the
On 19/08/18 16:58, Peter Langfelder wrote:
My guess is that space has no effect because (1) the first element is
zero and (2) the code in OP's message has
barplot(gceac[,3], ...
i.e. barplot does not see a matrix, only a vector.
To the OP, try formatting the data to be plotted as a matrix, n
Hello,
It also works with class "factor":
df <- data.frame(variable = c("12.6%", "30.9%", "61.4%"))
class(df$variable)
#[1] "factor"
as.numeric(gsub(pattern = "%", "", df$variable))
#[1] 12.6 30.9 61.4
This is because sub() and gsub() return a character vector and the
instruction becomes an
My guess is that space has no effect because (1) the first element is
zero and (2) the code in OP's message has
barplot(gceac[,3], ...
i.e. barplot does not see a matrix, only a vector.
To the OP, try formatting the data to be plotted as a matrix, not as a
vector, then the space argument should b
Hi Rolf,
That's what comes of being in a hurry.
legend(4.1,30,c("A+","A","B","C","D","E","U"),
fill=c("white","lightblue","blue","orange","green","red","pink"))
and I thank you for alerting me to the fact that the legend arguments
in barp don't position the legend properly. I'll fix it.
Jim
O
Jim:
(a) There's no legend.
(b) I am still curious as to why the OP's code didn't work, in that
the "space=c(0,2)" argument seemed to have no effect.
cheers,
Rolf
On 18/08/18 20:45, Jim Lemon wrote:
Hi citc,
Try this:
geac<-matrix(c(9,9,8,8,8,23,23,23,23,22,27,27,27,25,24,
19,19,19,20,2
So running the code in my headas long as that column's data type is a
vector of characters then it should work.
Did you try it out?
On Sat, Aug 18, 2018, 5:02 PM Jeff Reichman wrote:
> Given it’s a variable would I just change the 12.6 in
> as.numeric(gsub(pattern = "%","","12.6%"))
>
> To
Hey there,
as.numeric(gsub(pattern = "%","","12.6%"))
On Sat, Aug 18, 2018 at 4:20 PM, Jeff Reichman
wrote:
> R-Help Forum
>
>
>
> How do I convert a chr variable that contains percentages to an integer
>
>
>
> Example 12.6% (chr) to 12.6 (int)
>
>
>
> Jeff
>
>
> [[alternative HTML vers
u 12.6 is not an integer.
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sat, Aug 18, 2018 at 2:20 PM Jeff Reichman
wrote:
> R-Help Forum
>
>
>
> How
Given it’s a variable would I just change the 12.6 in as.numeric(gsub(pattern =
"%","","12.6%"))
To the variable name say … as.numeric(gsub(pattern = "%","",df$variable))
From: GALIB KHAN
Sent: Saturday, August 18, 2018 4:23 PM
To: reichm...@sbcglobal.net
Cc: r-help@r-project.org
Subject
Hello,
You have to get rid of the percent sign first. This can be done with ?sub
x <- "12.6%"
y <- sub("%$", "", x)
z <- as.numeric(y)
1) The dollar sign means "end of string". See ?regexpr.
2) You can all of that in one code line, no need to create y.
z <- as.numeric(sub("%$", "", x))
Hope
R-Help Forum
How do I convert a chr variable that contains percentages to an integer
Example 12.6% (chr) to 12.6 (int)
Jeff
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
ht
On Sat, 18 Aug 2018, MacQueen, Don wrote:
It's not obvious what would be causing that error from read.csv. But
here's what I would probably try:
I'd try switching to the more general read.table.
Don/Peter,
I found the problem: it was in the following line in the script which
referenced '
Hi,
I would be tempted, as a start, to read the entire file in as rows of text,
split each line by the expected delimiter, and then count the number of
elements each split line yields. Once you know each row splits into the
expected number of
txt <- "name,easting,northing,elev,sampdate,prcp
What Don said, and also notice that the error is not about anything having
value 0, it is about replacing something with something of _length_ 0. It is
not obvious where that happens, sometimes a traceback() can give a clue, but
probably Don is right that the issue is that there is something not
I don't think labels as such can be rotated. Newer versions of Tk allows
rotation in canvases but this was implemented some years after the tcltk
package was developed, so some assembly may be required. If you can extrapolate
from Python, there may be some relevant ideas in this post:
https://s
Hi citc,
Try this:
geac<-matrix(c(9,9,8,8,8,23,23,23,23,22,27,27,27,25,24,
19,19,19,20,20,17,17,17,18,19,8,8,8,9,9,2,2,3,3,3),ncol=5,byrow=TRUE)
library(plotrix)
barp(geac,names.arg=2014:2018,main="A level grades chemistry",
xlab="Year",ylab="Percentage of each grade",ylim=c(0,30),
col=c("white
Dear Duncan,
thanks again for your response.
> I'm talking about the R Core developers.
Now it make sense. Those [R Core] are the key words that were omitted in
your original email.
> If you think this is a new bug, you should report it to the bug tracking
system (which requires you to be regi
18 matches
Mail list logo