I have added to R a global option $blogdown.hugo.dir = "C:/Hugo"
which makes devtools::check() crash.
-- Checking ------------------------------------------ eurobarometer --
Setting env vars:
* _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
* _R_CHECK_CRAN_INCOMING_ : FALSE
* _R_CHECK_FORCE_SUGGESTS_ : FALSE
-- R CMD check -------------------------------------------------------------
Error: 2:39: unexpected symbol
2: options(blogdown.hugo.dir = 'C:/Hugo').Last
^
Execution halted
I tried to set
options(blogdown.hugo.dir = 'C:/Hugo')
I re-installed with clear startup options RStudio and R, but I cannot remove the global option. I can change it, but not remove it.
Can anyone point me out how to completely remove an element from options, or to get a fresh option. Many packages re-set settings, but only for standard ones, not custom options.
Look at ?options. You should see a third item in the Usage list, .Options. That's actually the name of the structure that holds the names and values of options so you should be able to set a particular one to NULL which is the standard R method to remove items from lists. I tried with:
.Options$demo.ask <- NULL
Success.
I thought that that using options(key = NULL) will leave an entry in the .Options tree, since NULL is a valid value for a list item, but I was wrong. There's no such named value after that operation.
Related
I am trying to learn how to manipulate microarrays for differential expression analysis. While I am trying to add some annotation I can not find the keytype related to:
select(hugene10sttranscriptcluster.db,
keys = my_keys,
columns = c("GENENAME", "SYMBOL"),
keytype = "PROBEID")
-------------------------------------------------------
Error in .testForValidKeys(x, keys, keytype, fks) :
None of the keys entered are valid keys for 'PROBEID'. Please use the keys method to see a listing of valid arguments.
Being the keys:
my_keys
---------------------------------------------------------------------
[1] "16650045" "16650047" "16650049" "16650051" "16650053" "16650055" "16650057" "16650059"
I tried every possible type from keytypes(hugene10sttranscriptcluster.db) with no successful result:
"16650045" %in% keys(hugene10sttranscriptcluster.db, "GENEID")
------------------------------------------------------------------
[1] FALSE
Is there any documentation/alternative where I can find it. I have been looking through the documentation (Array Express) but did not help me. I am also not sure; is it possible that I require a different package (hugene10sttranscriptcluster.db)?
Effectively, I did have a problem with the package. If anyone has the same problem just try to look for the annotation of the microarray in the documentation (pd.hugene.2.0.st in my case) to install and use the proper package (hugene20sttranscriptcluster.db)
To check the code quality of my package I am using the package lintr using the command
lintr::lint_package()
and get one result that I want to ignore:
functions should have cyclomatic complexity of less than 15
How can I ignore this single "false positive" lintr result of a single lintr (cyclocomp_linter)
for a file (line number range)?
Edit 1: Currently I am using this .lintr config file as a workaround (by disabling the lintr completely):
linters: with_defaults(
cyclocomp_linter = NULL # instead of NULL I could use: cyclocomp_linter(16)
)
Although it doesn't solve your problem exactly, you can wrap that function with # nolint start then # nolint end to prevent any linter from flagging that function.
The syntax for preventing a specific linter from flagging a specific set of lines is currently under development - see https://github.com/jimhester/lintr/pull/660 . This will be present in the next major lintr release (3.0.0).
I am trying to create a package in Oracle SQL Developer and want to have a public input parameter that another user can input a date to. I tried the following code -
Create PACKAGE Assignment_1_Pack is
vstartDate date := to_date('&startDate', 'DD/MM/YYYY');
vendDate date := to_date('endDAte', 'DD/MM/YYYY');
END;
When I try to run it I get the following message
Empty package Assignment_1_pack definition (no public members).
I was expecting the window that pops up to prompt for an input but I haven't used packages before so I am not sure what it is I am doing wrong
run set define on;
Use a command create OR REPLACE package Assignment_1_Pack ...
SET DEFINE ON/OFF toggles the substitution variables on or off. Probably the substitution of variables was turned off, so SQLDeveloper doesn't ask for the value
See this for details: https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12040.htm#sthref2736
SET DEF[INE] {& | c | ON | OFF} Sets the character used to prefix
substitution variables to c.
ON or OFF controls whether SQL*Plus will scan commands for
substitution variables and replace them with their values. ON changes
the value of c back to the default '&', not the most recently used
character. The setting of DEFINE to OFF overrides the setting of the
SCAN variable.
create OR REPLACE package ... prevents from errors in a case when the package has already been created. Simple CREATE PACKAGE xxx command fails if the package already exists. If you create the package for the first time, then all subsequent attempts will fail. Create OR REPLACE ... drops the package if it already exists, and then creates it again, so it newer fails.
We're using Boost-Build to build our software. To help facilitate this, we've written a library of rules and actions. Boost-Build allows passing in command line arguments and will pass along any argument prefixed with --. Currently, to get a hold of the arguments and check for flags we're doing something like:
import modules ;
local args = [ modules.peek : ARGV ] ;
# or like this
if "--my-flag" in [ modules.peek : ARGV ]
Which works to get and check values. However, developers that use Boost-Build and our jam libraries have no idea that these flags are available and would like to see some help on these flags whenever they run either bjam -h or bjam --help. I see that BB has a help module, but I don't see any way to register arguments with the help system.
Is there a way to register command line flags, complete with short documentation, that the help system will pick up?
In response to my own question, I have added the very feature that I was asking about: https://github.com/boostorg/build/pull/23
It uses the existing options plugin system. Whenever you want to create a new command-line option create a new module within the options directory. Within that new module, create a variable that holds a value or is empty. Above the variable create a comment. The comment is used as the command-line documentation and the value (if given) is used to describe the default value of that variable.
Create a process rule within the new module and register your option with the system. This allows importing the option module and getting the value from a single source. This requires that each variable name is prefixed with the name of the module.
Create a variable named .option-description. Its value is the section separator and its comment is the description of the section.
For example:
# within options/cool.jam
# These are the options for the Cool option plugin
.option-description = Cool Options
# This enables option1
.option.--cool-option1 ?= ;
# This enables something cool
.option.--cool-default-option ?= "my default value" ;
rule process (
command # The option.
: values * # The values, starting after the "=".
)
{
option.set $(command) : $(values) ;
}
When running bjam with the --help-options flag, it will output all modules that follow the above patterns within the options directory. It will have an output similar to the following:
Boost.Build Usage:
b2 [ options... ] targets...
* -a; Build all targets, even if they are current.
* -fx; Read 'x' as the Jamfile for building instead of searching for the
Boost.Build system.
* -jx; Run up to 'x' commands concurrently.
* -n; Do not execute build commands. Instead print out the commands as they
would be executed if building.
* -ox; Output the used build commands to file 'x'.
* -q; Quit as soon as a build failure is encountered. Without this option
Boost.Jam will continue building as many targets as it can.
* -sx=y; Sets a Jam variable 'x' to the value 'y', overriding any value that
variable would have from the environment.
* -tx; Rebuild the target 'x', even if it is up-to-date.
* -v; Display the version of b2.
* --x; Any option not explicitly handled by Boost.Build remains available to
build scripts using the 'ARGV' variable.
* --abbreviate-paths; Use abbreviated paths for targets.
* --hash; Shorten target paths by using an MD5 hash.
* -dn; Enables output of diagnostic messages. The debug level 'n' and all
below it are enabled by this option.
* -d+n; Enables output of diagnostic messages. Only the output for debug
level 'n' is enabled.
Debug Levels:
Each debug level shows a different set of information. Usually with higher
levels producing more verbose information. The following levels are supported:
* 0; Turn off all diagnostic output. Only errors are reported.
* 1; Show the actions taken for building targets, as they are executed.
* 2; Show quiet actions and display all action text, as they are executed.
* 3; Show dependency analysis, and target/source timestamps/paths.
* 4; Show arguments of shell invocations.
* 5; Show rule invocations and variable expansions.
* 6; Show directory/header file/archive scans, and attempts at binding to
targets.
* 7; Show variable settings.
* 8; Show variable fetches, variable expansions, and evaluation of 'if'
expressions.
* 9; Show variable manipulation, scanner tokens, and memory usage.
* 10; Show execution times for rules.
* 11; Show parsing progress of Jamfiles.
* 12; Show graph for target dependencies.
* 13; Show changes in target status (fate).
Cool Options:
These are the options for the Cool option plugin
* --cool-option1: This enables option1. Default is disabled.
* --cool-default-option: This enables something cool. "my default value".
Later on in your own Jam code, you can then get a hold of values from the registered options by doing:
import option ;
option1 = option.get '--cool-option1' ;
if $(option1) {
# do_something ;
}
There is no way to "register" individual options with the B2 help system. As generally that's just not how the help system works. The help system documents B2 modules (i.e. classes) and projects (i.e. jamfiles) only. What you see when you do "b2 --help" is a collection of the project help information and module information. All the data is extracted from the parse jamfiles.
For modules you add comments to classes and arguments and they get formatted for output. For example take a look at the "container.jam" source. In that the second comment on the file is a module help doc, the comment before "class node" is a class help doc, the comment before "rule set" is a method help doc, and the comment after the "value ?" argument is a help doc.
For projects the second comment in the project's jamfile is taken as the help doc. For example the Boost Jamroot has a large help doc comment for the usage information. This is printed out if you:
cd <boost-root>
b2 --help
If you such a comment to one of your project jamfiles (note: it assumes the first comment is a copyright notice and hence skips it and uses the second comment block for the help doc), and cd to that project directory and do b2 --help you should see it printed.
Which type of help doc you want is of course dependent on your project and your intentions.
I am trying to use the special variable .RECIPEPREFIX in order to avoid the hard to see tabs, but it does not seem to work. My simple test makefile is:
.RECIPEPREFIX = +
all:
+ #echo OK
but I get the message:
xxx:4: *** missing separator. Stop.
Which version of gnu make are you using? 3.81?
The .RECIPEPREFIX is only supported since 3.82. I've tested out your sample on 3.82 and it works.
http://cvs.savannah.gnu.org/viewvc/make/NEWS?revision=2.109&root=make&view=markup
New special variable: .RECIPEPREFIX allows you to reset the recipe
introduction character from the default (TAB) to something else. The
first character of this variable value is the new recipe introduction
character. If the variable is set to the empty string, TAB is used again.
It can be set and reset at will; recipes will use the value active when
they were first parsed. To detect this feature check the value of
$(.RECIPEPREFIX).