Displaying 20 results from an estimated 1000 matches similar to: "Question about merge()"
2006 Oct 20
1
Questions about date/time and truncating
I'm getting a weird behavior using R 2.5.0 for MacOS X -- I have a csv file
with a "properly formatted" date/time field, e.g. After reading in the csv
to "hourly_met_data", with a "date" field
hourly_met_data$date <- as.POSIXct(hourly_met_data$date)
works exactly as it is supposed to (e.g. Min/max of that field are
calculated correctly). However, when I
2006 Sep 23
3
Data frames questions
Hi there, couple of questions on data frames:
1) Is there a way to build an empty data frame, containing nothing but the
data frame variable names?
2) Is there a way to reorder the variables in a data frame, e.g. When I go
to write out a data frame using write.table or write.matrix, I want the
output in a certain order...
3) How to I "append" to the bottom of a dataframe?
Thanks!
--j
2006 Nov 02
2
poly() question
Besides the primary citation, "Kennedy, W. J. Jr and Gentle, J. E. (1980)
Statistical Computing Marcel Dekker." (which is $300 and my library doesn't
have it), is there any other documentation on how to take a poly() object
and predict "by hand" new data? E.g. What do those coefficients actually
mean ("The orthogonal polynomial is summarized by the coefficients, which
2006 May 10
3
Contour plot overlayed with line plot
I apologize for what may be a newbie question: I have two sets of data, one
is X,Y,Z data that I'd like to make a contour plot of (Z defining the
contours), and a second set of X,Y data (Y as a function of X) which I would
like made into a line plot OVERLAYED on the contour plot (X and Y from both
plots are in the same units and will have overlapping values). Any
suggestions on how to do this
2006 Jul 02
1
Optional variables in function?
I'm a bit new to writing R functions and I was wondering what the "best
practice" for having optional variables in a function is, and how to test
for optional and non-optional variables? e.g. if I have the following
function:
helpme <- function(a,b,c) {
}
In this example, I want c to be an optional variable, but a and b to be
required. How do I:
1) test to see if the user
2006 Oct 21
1
ReadLines question
I'm getting the following error:
> headerinfo=readLines(met_station_file,n=8)
> headerinfo
[1] "Plot Title: tahoe met validation ,,,,,,,"
[2]Error: invalid multibyte string
met_station_file's first 8 lines are as follows:
Plot Title: tahoe met validation ,,,,,,,
#,"Time, GMT-07:00","Temp, ?F",Coupler Attached,Host Connected,Coupler
2009 Aug 27
19
Best R text editors?
Quick informal poll: what is everyone's favorite text editor for working
with R? I'd like to hear from people who are using editors that have
some level of direct R interface (e.g. Tinn-R, Komodo+SciViews). Thanks!
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The
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
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 Jun 16
2
Statistically detecting thresholds...
Rers:
I have some ecological data (stream velocity vs. % cover of submerged
weeds) that shows strong evidence of a thresholding step-function, e.g.
below some velocity, % cover ranges from 0% to 100% (with no apparent
relationship to velocity within this range of velocities), but above a
certain "threshold" velocity, the % cover does not appear to exceed,
say, 10%. There are good
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
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
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, ...) :
2012 May 02
6
Quickest way to make a large "empty" file on disk?
R-helpers:
What would be the absolute fastest way to make a large "empty" file (e.g.
filled with all zeroes) on disk, given a byte size and a given number
number of empty values. I know I can use writeBin, but the "object" in
this case may be far too large to store in main memory. I'm asking because
I'm going to use this file in conjunction with mmap to do parallel
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)
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
2013 Sep 27
2
Error: C stack usage is too close to the limit when using list.files()
R-helpers:
I'm running a file search on my entire drive (Mac OS X) using:
files_found <- list.files(dir="/",pattern=somepattern,recursive=TRUE,full.names=TRUE)
where somepattern is a search pattern (which I have confirmed via a
unix "find / -name somepattern" only returns ~ 3 results).
I keep getting an error:
Error: C stack usage is too close to the limit
when
2009 Jul 06
7
Testing memory limits in R??
Hello Everyone,
We have recently purchased a server which has 64GB of memory running
a 64bit OS and I have compiled R from source with the following config
./configure --prefix=/usr/local/R-2.9.1 --enable-Rshlib
--enable-BLAS-shlib --enable-shared --with-readline --with-iconv
--with-x --with-tcktk --with-aqua --with-libpng --with-jpeglib
and I would like to verify that I can use
2009 Jul 01
3
"Error: cannot allocate vector of size 332.3 Mb"
Dear R-helpers,
I am running R version 2.9.1 on a Mac Quad with 32Gb of RAM running
Mac OS X version 10.5.6. With over 20Gb of RAM "free" (according to
the Activity Monitor) the following happens.
> x <- matrix(rep(0, 6600^2), ncol = 6600)
# So far so good. But I need 3 matrices of this size.
> y <- matrix(rep(0, 6600^2), ncol = 6600)
R(3219) malloc: ***