What does the !! operator / notation stand for in R? - r

I was reading a question in SO and came up with the !! operator. Ive been working with R for some time and never have seen it. First, Ive search for questions about it, and couldnt find one in SO (so this may be a duplicate). Also, go back to diferent R operators post and pages, and no one says anything of it.
In the question, the !! preceded an R oject, like:
> !!object
Thanks for the help.
P.D.: If its a duplicate, please close.

Related

Convert Enrichlist to Dataframe

Is their a way to convert an enrichlist from CBNplot into a dataframe, so I can use the the function bngeneplotCustom ?
https://github.com/noriakis/CBNplot
You can get the 'information' from an enrichlist as a dataframe using e.g.
e_list <- enrichKO(data)
enrichlist_df <- e_list#result
NB. the bngeneplotCustom() function appears to require the enrichlist object, not just a dataframe of the results. If this answers your question but doesn't solve your problem, and you need more help troubleshooting, please edit your question to include the code you've tried and any error messages or other info that might help. Please see https://stackoverflow.com/help/how-to-ask / https://stackoverflow.com/help/minimal-reproducible-example / How to make a great R reproducible example for more info on asking 'good' questions, and/or ask the folks at https://bioinformatics.stackexchange.com/ as they are likely more knowledgeable on this topic.

When should I use "#" sign while using r language:

Every time I miss spell this at(#) character while writing R code so what is the usage as it has a special colour so I supposed it was meant to do something useful. Any comments on that?
The "at"-sign is used to access S4 slots. It is the equivalent of the "dollar"-sign used to access lists (of which data.frames are but one example.)
On the other hand you might be talking about its special use in certain external packages? But I'm guessing that's not going to be the case here, because that would imply that you knew quite about about R.

White squares when using plotmath expressions

Whenever I try to use symbols in a plotmath expression in R, I get white squares. For example, when I run demo(plotmath), I get the following.
Does anyone have an idea where the problem may lie? I am using R 3.4.1 in Rstudio on Mac OS X 10.11.6.
Update:
As mentioned in the comments, it seems to be an issue with my fonts.
When I look at Symbol, I have two "Symbol Regular"s, and the second one appears as question marks when viewing both together. However, when I click on the second one individually, the fonts appear normally. I tried to validate fonts and remove duplicates, but Font Book did not detect any problems. What should I do?
If you go to Fontbook.app and examine the Symbol font, is it perhaps duplicated or can you see any other evidence of corruption? – 42- 25 mins ago
#42- Thanks very much, it does seem to be an issue with the Symbol font. I listed what I see above; do you know what I should do with the font to fix it? – angryavian 9 mins ago
Delete it. It will get replaced from some magic Apple storeroom buried deep in the bowels of the System.
I don't know how this happens, but it used to happen to me fairly often. Doesn't seem to be happening lately. I remain puzzled. I'm guessing there may be answers at Ask Different (but I didn't find an answer.) Whatever the mechanism it's been around for a long, long time:
http://hints.macworld.com/article.php?story=20031025010930633

Removing duplicate in wordcloud in r

I am generating a word cloud of my tweets. But the problem is i am getting duplicate like shown below which are treated as separated character in my word cloud instead of one.
1) myname
2) "myname
3) myname"
My other problem is i am also getting some symbols in the word cloud
like ^ ~ etc. How to get rid of these symbols
#docendodiscimus answer solved my problem but I am getting now meaning words in my cloud like 'sadi24', 'yu1' etc even I though I removed Hashtags and # words ? how can i get rid of them?
this is the output where i can identify this is happening but may be there are many other words that may be suffering from this problem . please provide your thoughts on this.
Please note that I may have numerous similar kind of issue. Please provide solution to which i can easily generalize to all others
I am providing a screen shot of other data having the problem
Here I am getting words such as manager185878 and sadi24. You can see the output with some absurd symbol even after removing the Punctuation.

Amount value regular expression

I am trying to create a regular expression for a dollar amount that accepts values between 5.00 and 1000.00.
Here is what I have so far:
^([5-9](\d){0,4}([.](\d){1,2})?|1000([.](0){1,2})?)?$
I have already tried the range validator and it isn't working this field.
Any help is much appreciated.
This is what I came up with, which could likely be improved. It seems to work for my limited testing. You may want to tag your question with "regex" to get some expert advice!
^(?:[5-9](?:\.\d{0,2})?|\d{2,3}(?:\.\d{0,2})?|1000(?:\.0{0,2})?)$

Resources