Displaying 20 results from an estimated 1000 matches similar to: "Question about selective importing of package functions..."
2013 Oct 03
1
Including R code from another package...
R-developers:
I had a quick question for the group -- let's say a package I am
developing depends on a single, small function from a large
CRAN-listed package. I can, of course, set a dependency within my own
package, but are there means by which I can include the R script + man
file DIRECTLY in my package (of course attributing the code to the
original programmer). Does it require me
2013 Oct 30
2
Where to drop a python script?
R-developers:
I have a small python script that I'd like to include in an R package I'm
developing, but I'm a bit unclear about which subfolder it should go in. R
will be calling the script via a system() call. Thanks!
--j
--
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic
2013 Jul 12
2
"Proper" way to use a "hidden" function in an R-package?
R-developers:
I'm working on updating my R package "spatial.tools", and one thing I
was wondering was the proper way to have hidden functions -- should I
simply not export them to the namespace and use the ::: operator to
call them (which is what I currently do)?
--j
--
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS)
2013 Jan 22
2
Adding a line to barchart
R-helpers:
I need a quick help with the following graph (I'm a lattice newbie):
require("lattice")
npp=1:5
names(npp)=c("A","B","C","D","E")
barchart(npp,origin=0,box.width=1)
# What I want to do, is add a single vertical line positioned at x = 2 that
lays over the bars (say, using a dotted line). How do I go about doing
this?
2013 Feb 01
3
Loading a list into the environment
R-helpers:
Say I have a list:
myvariables <- list(a=1:10,b=20)
Is there a way to load the list components into the environment as
variables based on the component names? i.e. by applying this theoretical
function to myvariables I would have the variables a and b loaded into the
environment without having to explicitly define them.
--j
--
Jonathan A. Greenberg, PhD
Assistant Professor
2013 Jun 10
1
Policy/best practices on renaming functions in packages
R-developers:
I'm beginning to work on a manuscript for a set of functions I
developed for a package I have on CRAN (spatial.tools), and I'd like
to rename a function in my package to give a better idea of what it
does prior to manuscript submission -- is there a "safe" way to do a
backwards-compatible rename of a function within a CRAN package (so
functions that rely on the
2013 Mar 21
2
Check if a character vector can be coerced to numeric?
Given an arbitrary set of character vectors:
myvect1 <- c("abc","3","4")
myvect2 <- c("2","3","4")
I would like to develop a function that will convert any vectors that can
be PROPERLY converted to a numeric (myvect2) into a numeric, but leaves
character vectors which cannot be converted (myvect1) alone. Is there any
simple way
2013 Apr 16
4
Singular design matrix in rq
Quantreggers:
I'm trying to run rq() on a dataset I posted at:
https://docs.google.com/file/d/0B8Kij67bij_ASUpfcmJ4LTFEUUk/edit?usp=sharing
(it's a 1500kb csv file named "singular.csv") and am getting the following
error:
mydata <- read.csv("singular.csv")
fit_spl <- rq(raw_data[,1] ~ bs(raw_data[,i],df=15),tau=1)
> Error in rq.fit.br(x, y, tau = tau, ...) :
2009 Nov 02
2
"Safe" way to automatically install required packages...
R-helpers:
I'm working on an r-package that I want to make as easy-to-use as
possible for a novice R-user, which includes automatically installing
required packages. I, myself, am a novice R-packager, so the solution
I came up with was to embed:
print("Loading required packages...")
if (!require("reshape")) { install.packages("reshape") }
if
2009 Mar 18
2
How do I set the Windows temporary directory in R?
I'm trying to redirect where temporary files go under R to
D:\temp\somerandomname from its default (C:\Documents and
Settings\username\Temp\somerandomname) -- how do I go about doing this?
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
2011 Aug 23
5
Easier ways to create .Rd files?
R-helpers:
Are there any ways to auto-generate R-friendly (e.g. will pass a
compilation check) .Rd files given a set of .R code? How about GUIs
that help properly format the .Rd files? Thanks! I want a basic set
of .Rd files that I can update as I go, but as with most things my
documentation typically lags behind my coding by a few days.
--j
--
Jonathan A. Greenberg, PhD
Assistant Project
2007 Jul 05
1
(no subject)
I'm trying to hunt down an appropriate kriging package for my specific
application, and I was hoping someone on the R list might have some pointers
-- I'm interested in performing kriging and related spatial interpolations
with one of the R packages, but I need to be able to provide my own
point-to-point distances (e.g. I do not want to use standard between point
distances, as calculated
2011 Jun 29
1
Querying the path separator?
Hopefully this is a pretty easy fix -- I need to have R query the path
separator for some code I'm trying to write (it involves using a
system() call) -- the call requires a path and a wildcard, e.g.:
command="mycommand /path/to/*.files" in the case of unix or,
command="mycommand.exe C:\\path\\to\\*.files" on a windows box
System.which is working correctly, so the
2012 Apr 05
4
Best way to search r- functions and mailing list?
R-helpers:
It looks like http://finzi.psych.upenn.edu/search.html has stopped
spidering the mailing lists -- this used to be my go-to site for
searching for R solutions. Are there any good replacements for this?
I want to be able to search both functions and mailing lists at the
same time. Cheers!
--j
--
Jonathan A. Greenberg, PhD
Assistant Professor
Department of Geography
University of
2008 Oct 29
1
Suppressing internal grid in filled.contour
Rers:
I can't seem to locate the command to suppress what appears to be a
faint internal grid when running the following command to make a filled
contour plot of some data I have (x,y,z being the inputs):
2011 Nov 21
3
How do I query "..." in a function call?
This is probably a very noobish question, but if I want to create a
function that allows an undetermined number of, say, numeric vectors to be
fed to it, I would use:
myfunction = function(...)
{
# Do something
}
Right? If so, how do I a) count the number of vectors "fed" to the
function, and b) how do I treat those vectors as variables, e.g. for the
call:
2009 Mar 13
2
Using format to add leading zeroes
I have a numerical vector which contains a (poorly) formatted time
column, which, in theory, should be HHMM, but was distributed as an
integer, so, for 12:15 am, it is saved as "15" (e.g. HHMM = 0015 with
the zeroes stripped). I'm trying to use this in conjunction with
strptime, but I'm thinking because each time is an integer ranging from
1 to 4 digits, I probably need to
2009 Oct 23
2
splitting a vector of strings...
Quick question -- if I have a vector of strings that I'd like to split
into two new vectors based on a substring that is inside of each string,
what is the most efficient way to do this? The substring that I want to
split on is multiple characters, if that matters, and it is contained in
every element of the character vector.
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
2009 Apr 07
1
Constrained, multiple response statistics
R'ers:
I was hoping I could get some direction on this. I have a dataset
of the form:
Y1,Y2,...,YM = f(X1,X2,...,XN), where N is >>> M
The response data (Y1,Y2,...,YM) is frequency data, such that the sum of
all Yi = 1.0. Both Xj and Yi are continuous variables.
I'm trying to figure out the best approach(es) to solving for the model
f() -- any ideas? I could solve
2009 Jan 25
2
.Renviron for multiple hardwares...
Our lab has a lot of different unix boxes, with different hardware, and
I'm assuming (perhaps wrongly) that by setting a per-user package
installation directory, the packages will only work on one type of
hardware. Our systems are all set up to share the same home directory
(and, thus, the same .Renviron file) -- so, is there a way to set, in
the .Renviron file, per-computer or