Hi.
First, please do not post in HTML. It usually scrambles any posted code.
Second, as you did not post any code or data your message was not scrambled
but I wonder what are columns and what are rows and what do you actually
calculates.
From
Suppose the ist column of the
> second matrix is S
Just a caution. There IS an operator of `!!` in the tidyverse called "bang
bang" that does a kind of substitution and you can look up the help page for it
as:
?`!!`
I just tried it on an example and it definitely will in some cases do this
other evaluation.
I doubt this will clash, but of cou
On my keyboard the key is share with the tilde symbol and is up on the left
hand corner.
Sent from my iPhone
> On Jun 23, 2021, at 2:45 PM, David Winsemius wrote:
>
> Backticks. NOT apostrophes.
>
> — David
>
> Sent from my iPhone
>
>> On Jun 23, 2021, at 2:40 PM, Mahmood Naderan wrote:
OK I understand. Thanks a lot.
Regards,
Mahmood
On Wed, Jun 23, 2021 at 11:46 PM Bert Gunter wrote:
> Try:
> ggplot(mydata, aes(x=W, y=`X/Y`)) + geom_violin(trim=FALSE)
>
> Note the use of *backticks*, ``, not single quotes, ' ' . ** They are
> different.**
>
> So, yes, your data got read
Try:
ggplot(mydata, aes(x=W, y=`X/Y`)) + geom_violin(trim=FALSE)
Note the use of *backticks*, ``, not single quotes, ' ' . ** They are
different.**
So, yes, your data got read in correctly, presumably because "/" is
considered a character in your locale. It is not in mine. So my suggestion
was i
Backticks. NOT apostrophes.
— David
Sent from my iPhone
> On Jun 23, 2021, at 2:40 PM, Mahmood Naderan wrote:
>
> Hi Bert,
> I don't know what does "check.names" do here, but my commands look like
>
>
>> mydata <- read.csv('r.3080..csv', header=T,row.names=1)
>
>> head(mydata)
>
Hi Bert,
I don't know what does "check.names" do here, but my commands look like
> mydata <- read.csv('r.3080..csv', header=T,row.names=1)
> head(mydata)
W AX/Y
P1 M 1.469734 0.004144405
P2M 20.584841 0.008010306
P3 M 53.519800 0.1660
Hi Phillips,
Maybe these examples will be useful:
> vec <- c("a","b","c","d","e")
> vec[c(1,1,1,0,0)]
[1] "a" "a" "a"
> vec[c(1,1,1,2,2)]
[1] "a" "a" "a" "b" "b"
> vec[c(5,5,5,5,5)]
[1] "e" "e" "e" "e" "e"
> vec[c(NA,NA,NA,0,0,0,0)]
[1] NA NA NA
> vec[c(NA,NA,NA,1,1,1,1)]
[1] NA NA NA "a" "a"
I found your specification quite vague. What did you mean by a "data file"
-- a data frame in R? -- a file in the file system?
I may be completely wrong here, but another possibility is that you read
your data into an R data.frame via, e.g. read.table() or read.csv(), but
failed to specify the che
Unfortunately, using 'X/Y' doesn't work either.
Instead I used labels like below
P + scale_y_continuous(name="X/Y")
Thanks for the suggestions.
Regards,
Mahmood
On Wed, Jun 23, 2021 at 9:22 PM Eric Berger wrote:
> If no one comes up with a better suggestion:
> a. Change the column name to
IMO that puts the cart before the horse. rlang implements these "operators" in
very focused situations using custom expression parsing, and if they cannot
tell the difference between numeric/logical and character data then rlang is
broken.
That said, I do think as.logical() is more direct than
If no one comes up with a better suggestion:
a. Change the column name to "Y" so that you get the plot you want
b. Use axis labels and legend text to show the text that you want. (The
user never has to know that you changed the column name 😃)
HTH,
Eric
On Wed, Jun 23, 2021 at 9:58 PM Mahmood Nade
On 23/06/2021 2:51 p.m., Jeff Newmiller wrote:
RStudio seems to have done this. If you have it, try typing
ggplot2::line
and the popup will suggest (among other options) geom_line.
Yes, though it may not be quite right. Back in May when I typed
library(rgl
their autocompletion gave me
l
Dear Robert,
Thank you very much for your suggestion.
I solved by compiling R with --with-cairo, and installing cairo-devel
and pango-devel.
Notably, you also need pango-devel.
The configure script does not complain if it is missing, but then
plotting won't work.
Best regards.
On 23/06/2021
On 23/06/2021 11:38 a.m., Mahmood Naderan wrote:
Hi
I have a column in my data file which is "X/Y". With '/' I want to
emphasize that values are the ratio of X over Y.
Problem is that in the following command for a violin plot, I am not able
to specify that '/' even with double quotes.
p <- ggpl
Use backquotes, `X/Y`, to specify a name, not double quotes.
-Bill
On Wed, Jun 23, 2021 at 11:58 AM Mahmood Naderan
wrote:
> Hi
> I have a column in my data file which is "X/Y". With '/' I want to
> emphasize that values are the ratio of X over Y.
> Problem is that in the following command for
Hi
I have a column in my data file which is "X/Y". With '/' I want to
emphasize that values are the ratio of X over Y.
Problem is that in the following command for a violin plot, I am not able
to specify that '/' even with double quotes.
p <- ggplot(mydata, aes(x=W, y="X/Y")) + geom_violin(trim=FA
RStudio seems to have done this. If you have it, try typing
ggplot2::line
and the popup will suggest (among other options) geom_line.
On June 23, 2021 10:10:07 AM PDT, Duncan Murdoch
wrote:
>On 23/06/2021 8:37 a.m., Greg Minshall wrote:
>> hi.
>>
>> at the R prompt, i often hit, e.g., "data.t
I suggest you post this in the r-sig-geo list rather than here. The
expertise you seek is more likely to be there.
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 )
Note that !! and !!! are special operators involving "quasiquotation" in
the dplyr package.
I would use as.logical(x) instead of !!x since its meaning is clear to any
user.
-Bill
On Wed, Jun 23, 2021 at 11:13 AM Jeff Newmiller
wrote:
> For the record, `!!` is not an operator so it does not "op
Perhaps software rendering would work.
Export RSTUDIO_CHROMIUM_ARGUMENTS="--disable-gpu"
/usr/lib/rstudio/bin/rstudio
On Wed, Jun 23, 2021, 10:01 AM Phillips Rogfield
wrote:
> Hello Paul,
>
> thank you for your kind advice.
>
> RStudio doesn't start at all this way. It gives me the following
For the record, `!!` is not an operator so it does not "operate" on anything.
The right ! does per the help page (?`!`) interpret non-zero values as TRUE and
invert that logic, yielding a logical result even if the input is not logical.
The left ! inverts that again, yielding a logical vector wi
I have data matrix of order 24*2192 where 2192 are the days and 24 are hour's
of a single day,so simple words I have 2192 days and each day having 24
observations.the data matrix is divided into two matrix,the ist matrix is of
order 24*1827 and second is of order 24*365. Suppose the ist column o
Dear all,
thank for for your suggestion.
Yes I come from languages where 1 means TRUE and 0 means FALSE. In
particular from C/C++ and Python.
Evidently this is not the case for R.
In my mind I kind took for granted that that was the case (1=TRUE, 0=FALSE).
Knowing this is not the case for R m
Dear R-help ML,
I have downloaded the NUTS shapefiles from here:
https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts
I can load them with the following code:
library(rgdal)
shp_bdir <- [PATH TO SHAPE FILE]
layername <- "NUTS_RG_
On 23/06/2021 8:37 a.m., Greg Minshall wrote:
hi.
at the R prompt, i often hit, e.g., "data.table::", to try to find
a routine in a give package.
however, some packages have a *lot* of functions (i'm looking at *you*,
ggplot2...), so if i know the routine name starts with, e.g., "set", i
can fi
Just as a way to save a bit of typing, instead of
> as.logical(0:4)
[1] FALSE TRUE TRUE TRUE TRUE
> !!(0:4)
[1] FALSE TRUE TRUE TRUE TRUE
DO NOTE that the parentheses in the second expression should never be
omitted, a possible reason to prefer the as.logical() construction.
Also note th
This is unfortunately a bad habit many of us got from earlier languages like
the C group of languages where 0 is FALSE and 1 (and anything non-zero) is
TRUE. A language like Python is arguably even worse in that all kinds of
things can be TRUE or FALSE in odd ways, like a non-empty string or even a
> a variable that equals 1 for the elements I want to select:
>
> t = c(1,1,1,0,0)
How do you typically make such a variable? If you use something like
t <- ifelse(x == "Yes", 1, 0)
you should instead use
t <- x == "Yes"
Naming the variable something like 'isYes' instead of 't' might help
Bert,
> ?ls and note the "pattern" argument.
...
> ls("package:base", pat =".*set.*")
awesome -- thanks!
cheers, Greg
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
In my code, instead of 't', I name a vector of indices with a meaningful
name, such as idxV, to make it obvious.
Alternatively, a minor change in your style would be to replace your
definition of t by
t <- as.logical(c(1,1,1,0,0))
HTH,
Eric
On Wed, Jun 23, 2021 at 6:11 PM Phillips Rogfield
wr
I practically never construct vectors like your `t` so it isn't a problem. And
since I make a habit of verifying the types of all vectors I am using in
expressions, if it did come up I would notice.
On June 23, 2021 8:06:05 AM PDT, Phillips Rogfield
wrote:
>I make the same mistake all over aga
I make the same mistake all over again.
In particular, suppose we have:
a = c(1,2,3,4,5)
and a variable that equals 1 for the elements I want to select:
t = c(1,1,1,0,0)
To select the first 3 elements.
The problem is that
a[t]
would repeat the first element 3 times .
I have to either
Hello Bert,
thank you for your kinds answer.
No I didn't contact the maintainer of the package first, that's my fault :)
I have come to the conclusion that the problem is that I don't have
enough resources on my PC (RAM) for the task at hand.
I have tried to run it on a remote VM with more RAM
Hello Paul,
thank you for your kind advice.
RStudio doesn't start at all this way. It gives me the following error:
$ QT_QPA_PLATFORM=wayland rstudio
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSocketNotifier: Can only be used wi
?ls and note the "pattern" argument.
e.g.
ls("package:base", pat =".*set.*")
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 Wed, Jun 23, 2021 at 5:38 AM Gre
hi.
at the R prompt, i often hit, e.g., "data.table::", to try to find
a routine in a give package.
however, some packages have a *lot* of functions (i'm looking at *you*,
ggplot2...), so if i know the routine name starts with, e.g., "set", i
can filter the returned list of routines by typing
"da
37 matches
Mail list logo