similar to: How do I obtain the current active path of a function that's being called?

Displaying 20 results from an estimated 11000 matches similar to: "How do I obtain the current active path of a function that's being called?"

2012 Aug 14
3
set working directory to current source directory
Hi all, Is there a way to get cran R to set the working directory to be wherever the source file is? Each time I work on a project on different computers I keep having to set the working directory which is getting quite annoying. Thanks, Sachin [[alternative HTML version deleted]]
2011 Dec 07
6
nice report generator?
Hi all, I am looking for recommendations/pointers about best report generator you think that are currently available? i.e. the package that can help turn console output into nice-looking neat report to send to bosses? thanks a lot! [[alternative HTML version deleted]]
2012 Feb 02
9
sqldf for Very Large Tab Delimited Files
Hi All, I have a very (very) large tab-delimited text file without headers. There are only 8 columns and millions of rows. I want to make numerous pieces of this file by sub-setting it for individual stations. Station is given as in the first column. I am trying to learn and use sqldf package for this but am stuck in a couple of places. To simulate my requirement, I have taken iris dataset as an
2010 Jun 11
4
setting the current working directory to the location of the source file
AFAIK a script run through source() does not have any legit way to learn about it's own location. I need this to make sure that the script will find its datafiles after I move the whole directory. (The datafiles are in the same directory.) Here is a hack I invented to work around it: print(getwd()) source_pathname = get("ofile",envir = parent.frame()) source_dirname =
2006 Feb 28
3
does svm have a CV to obtain the best "cost" parameter?
Hi all, I am using the "svm" command in the e1071 package. Does it have an automatic way of setting the "cost" parameter? I changed a few values for the "cost" parameter but I hope there is a systematic way of obtaining the best "cost" value. I noticed that there is a "cross" (Cross validation) parameter in the "svm" function. But I
2005 Jul 19
1
Minor "bug" in source()
For R v2.1.1 patched and R v2.2.0 devel: Calling source(file, chdir=TRUE) with is.character(file) != TRUE, that is, with 'file' as a connection, will generate an error. Example: > file <- textConnection("cat('Hello world\n')") > source(file, chdir=TRUE) Error in source(file, chdir = TRUE) : Object "ofile" not found Of course, it does not make
2010 Sep 29
2
Script auto-detecting its own path
Hi all, Forgive me if this question has been addressed, but I was unable to find anything in the r-help list or in cyberspace. My question is this: is there a function, or set of functions, that will enable a script to detect its own path? I have tried file.path() but that was not what I was looking for. It would be nice to be able to put all the related scripts I use in the same folder with a
2010 Feb 22
3
relative file path
Hello, Is there a way to find where a script is located within a script? getwd() doesn't do what I want because it depends on where R was called from. I want something like source("randomFile") and within randomFile there is a function called whereAmI() which returns c:\blah\blah2\randomFile.R In perl there is a library called FindBin and $FindBin::Bin has the directory of the file
2014 Dec 03
2
[PATCH] test_compression.sh
* Use `mktemp` instead of playing with date(1). * Use -f instead of removing the file every time. * "echo ERROR; exit 1" is what die() is for. * Some cosmetic renamings ('k' to 'comp' for compression etc). * Remove the MacOSX comment. It's not MacOSX specific, and it's not a problem anyway. The number behaves just right. * Remove the $((${size}+10)). It's
2000 Jul 06
1
R 1.1.0 dev.print()
Hi, I just upgraded to 1.1.0 from 1.0.1 this morning on my OSF/1 machine. I now have problems with the following code: %E /tmp 43% R --vanilla Version 1.1.0 (June 15, 2000) ... > test2 <- function () { plot(runif(30)) ofile <- "/tmp/newfile.ps" dev.print(file = ofile) } + + + + + > > test2() Error in device(...) : Object "ofile" not found However, if
2016 May 23
7
[PATCH 1/5] mllib: make external_command echo the command executed
Add an optional parameter to disable this behaviour, so the Curl module in v2v won't print user-sensible data (like passwords). --- builder/checksums.ml | 1 - builder/downloader.ml | 1 - builder/sigchecker.ml | 1 - mllib/common_utils.ml | 4 +++- mllib/common_utils.mli | 7 +++++-- v2v/curl.ml | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git
2006 Mar 08
8
how to use the randomForest and rpart function?
Hi all, I am trying to play around with the randomForest function for classification. I know its performance is great. I am currently using the default options. It has many options. How do I further tweak the options so that I can make its performance even better? What are the options that are mostly used? Thanks a lot! M [[alternative HTML version deleted]]
2019 Apr 16
2
Measure network bandwidth per process
Hi, Is there a way to measure network bandwidth per process in CentOS Linux release 7.6.1810 (Core) using any utility? I was reading about nethogs but it does not have the option to run it in daemon mode so that we can take a look at historical data to figure out the process which was consuming high network bandwidth instead it is a good tool for Live monitoring. Please suggest. Thanks in
2010 Nov 29
1
map() and pdf clipping
Hello, Below is a function (test.map) that permits drawing the same map using three different devices. The "pdf" device doesn't clip polygons to the plot region as I see it does by both the native device (in my case "Quartz") and the "png" device. test.map("pdf") # produces "test-map.pdf" with no clipping test.map("png") #
2007 Apr 23
1
Bug in R 2.4.1 ?
Hello everybody, I'm using hdf5 files to store results from intermediate calculations. These are usually part of a list, called "res". As I want the hdf-files to contain all the members of res in its top "directory", I used to do attach(res) do.call("hdf5save", args=c(fileout=file.path(dir, ofile), as.list(names(res)))) detach(res) which did what I
2014 Dec 03
7
[PATCH] Improve LPC order guess
Hi, This patch improves compression a very tiny bit on average, but up to 0.1 percentage point for classical music. I haven't found any tracks that show worsening compression with this patch. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Improve-LPC-order-guess.patch Type: text/x-patch Size: 0 bytes Desc: not available Url :
2007 Dec 02
3
documenting yoru progress
Hello all: I have a function that writes a fairly elaborate report based on some survey data. For documentation and bookkeeping purposes, I'd like to write out in the report the function call that produced the report, or at least enough information to help me recreate the steps that led to that report. I've been generating all the reports with scripts, in order to be able to recreate
2006 Mar 07
3
how to use the rpart function?
Hi all, What parameter do I normally change in the rpart function? How do I set the "cp" option? Is there a way to read off error rate directly from the "rpart" function for training data; I imagine for testing data I have to apply a "predict", but for training data I guess the error count would be somewhere existing once the "rpart" function is
2015 Oct 23
2
[PATCH 1/2] resize: add --unknown-filesystems
Introduce a new option to control how virt-resize behaves when asking to expand a filesystem, either unknown to libguestfs or that virt-resize cannot expand. The default keeps the current behaviour, i.e. just warn. --- bash/virt-resize | 3 +++ resize/resize.ml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++-- resize/virt-resize.pod | 28 +++++++++++++++++++++- 3 files
2009 Jul 03
1
Zimbra IMAP authentication - SOLVED
Hello, everyone. No need to read this message. I'm posting for documentation for other poor, ignorant slobs like me who are struggling to pull together the many technologies to make converged networks happen. Hopefully, this will help save someone else the time I spent. I started the below email until I realized I had solved multiple parts of a compound problem but not all at the same time.