search for: jgreenberg

Displaying 8 results from an estimated 8 matches for "jgreenberg".

Did you mean: greenberg
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 Sep 23
2
Question about merge()
If I want to do a join based on *two* matching fields in two data frames, can merge() handle this? It appears to only handle a single matching column -- do I need to make a "metacolumn" or is there some way to do this? E.g.: Dataframe 1 contains columns A,B,C and Dataframe 2 contains A,B,D I want an output A,B,C,D which places C and D together if A and B match (otherwise, make two
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 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 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
2018 Feb 21
1
Checking for a proper "stop" statement...
Folks: Consider the following two use cases: goodfunction <- function() { stop("Something went wrong..." } # vs. badfunction <- function() { notgood() } Is there a way for me to test if the functions make use of a stop() statement WITHOUT modifying the stop() output (assume I can't mod the function containing the stop() statement itself)? For "goodfunction" the
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