similar to: Any way to add to data frame saved as .rData file?

Displaying 20 results from an estimated 1000 matches similar to: "Any way to add to data frame saved as .rData file?"

2005 May 25
3
Rounding fractional numbers to nearest fraction
Hi all, I've got a matrix of fractional data that is all positive and greater than zero that I would like to "loosely" classify, for lack of a better word. It looks something like this : 1.07 1.11 1.27 1.59 0.97 0.76 2.23 0.98 0.71 0.88 1.19 1.02 What I'm looking for is a way to round these numbers to the nearest 0.25, i.e. the above matrix would be
2005 Oct 03
3
Problem building/checking library that requires input from user
Hi all, I've got a package i've written that i am trying to check, build, and install. This is my 1st time doing this, so apologies in advance... ;) The package that I've written requires input from the user. It needs to know sample sizes and then runs some calcs, (sample sizes are just integers), and it gets this info from the user as num_reps <- readline("How many reps
2007 Oct 26
1
Problems with scan() in a tab-sep .txt file with cells that have '///' (three frontslashes)
Hello all, I'm using the following scan() parameters on a tab-separated text file that was generated by R. temp_file <- scan(file = outfile, sep="\t", what = character(), skip = 1, nlines = 1) The problem is that within some cells, there are cases where there are three frontslashes ( /// ). However, the file itself is tab-separated, and the exact problem is that even if I
2005 Jul 11
2
Isolating string containing only file name from complete path
Hi all, What I'd like to do is to is to be able to extract a string corresponding to only the file name from a string containing the complete path, i.e. from the following path string: "/Users/ken/Desktop/test/runs/file1" I would like to end up with: "file1" This would be most ideally done in a platform-independent way. Thanks in advance, -Ken
2006 Jan 23
3
ordering a data frame to same order as a chr vector
Hi all, I've got a data frame that has an identical column to a chr vector. I would like to use the chr vector to order the rows of the data frame to be identical to the order in the chr vector (the contents of the chr vector are completely identical to one col of the data frame), but this is proving trickier than it sounds.. Any help would be much obliged, -Ken
2005 Apr 08
1
Princomp$Scores
Hi all, I was hoping that someone could verify this for me- when I run princomp() on a matrix, it is my understanding that the scores slot of the output is a measure of how well each row correlates (for lack of a better word) with each principal component. i.e. say I have a 300x6 log2 scaled matrix, and I run princomp(). I would get back a $scores slot that is also 300x6, where each value
2011 Apr 27
6
Assignments inside lapply
Dear all I would like to ask you if an assignment can be done inside a lapply statement. For example I would like to covert a double nested for loop for (i in c(1:dimx)){ for (j in c(1:dimy)){ Powermap[i,j] <- Pr(c(i,j),c(PRX,PRY),f) } } to something like that: ij<-expand.grid(i=seq(1:dimx),j=(1:dimy)) unlist(lapply(1:nrow(ij),function(rowId) { return
2010 Mar 12
1
Length as fun.aggregate in cast function of reshape package: unexpected error
Dear Everyone, I am having problems with use of the reshape package's cast function using length as an aggregating function. Unexpectedly, I receive the error: 2 arguments passed to 'length' which requires 1 I don't understand this at all - the data I'm using is very simple, and appears almost identical to that used in the ChickWeight example in the package. The problem can
2010 Feb 08
1
R ggplot2 legend text left justify
In ggplot2 how do you justify the legend text ? In the example below the opts(legend.text = theme_text(size = 9,hjust=0)) changes the size of the text OK but it remains right justified. > mydata=data.frame(RowID=c("A","B","C"),Name=c("long long long long long name","short name ","medium medium name"),Speed=c(100,140,120)) >
2012 Aug 17
2
How can we compare corresponding values of x and y (first value of x exacly matches with the first value of y)?
df <- data.frame ( "RowId" = 4:7, "x"=c("1_1", "2_2", "3_3", "3_3"), "y"=c("1_1", "3_3", "2_2", "3_3") ) How can we compare corresponding values of x and y (first value of x exacly matches with the first value of y)? If they were not matced
2020 Sep 24
1
How to use `[` without evaluating the arguments.
Hello R-devel, I am currently attempting to implement an API similar to data.table wherein single bracket subsetting can accept an unquoted expression to be evaluated in the context of my object. A simple example from the data.table package looks like this: DT <- data.table(col1 = c('a', 'b', 'c'), col2 = c('x', 'y', 'z')) DT[col1 ==
2005 Feb 08
4
Renaming columns in data.frame, inserting/removing columns from data.frame
Hello, I'm hoping that there is an easier way to rename columns in a data frame other than by using the names() assignment, which requires you to type in all the column names at once for a data.frame, in the case that I simply want to rename a single column in a data frame. Also, is there an easy way to move columns in a data frame around relative to the other columns? Thanks in
2016 Oct 25
2
[PATCH v2 1/2] mllib: curl: add optional tmpdir parameter
Add a new optional parameter for the Curl ADT, so temporary files can be created in a specified directory (which is supposed to be temporary, and disposed only when the application quits). --- mllib/curl.ml | 10 ++++++---- mllib/curl.mli | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mllib/curl.ml b/mllib/curl.ml index 376406e..baa75ec 100644 --- a/mllib/curl.ml +++
2012 Mar 07
1
SELECT CASE in RODBC
Hi all, I have a problem with a variable created by a SELECT CASE statement. See the code below. I would like the variable "event" to be a character variabel as I want to UNION my two SELECTs - and the "event"-variable is a character variable in the first SELECT result. I have tried different ways: * used ' ' in stead of " " around the string I want as the
2006 Jan 16
8
AJAX + Table.
Hello all. I am trying ot load table rows using AJAX based on a search. The following code results in: 1. Firefox renders correctly (Multiple rows inserted into page). 2. Opera renders the entire returned string in one <td> by the looks of it (Bunched up under first header, the <> tags arne''t visible) 3. IE6 does nothing....great ;) This is driving me nuts so any help
2016 Oct 24
2
[PATCH 1/2] mllib: curl: add optional tmpdir parameter
Add a new optional parameter for the Curl ADT, so temporary files can be created in a specified directory (which is supposed to be temporary, and disposed only when the application quits). --- mllib/curl.ml | 16 +++++++++++----- mllib/curl.mli | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mllib/curl.ml b/mllib/curl.ml index 376406e..7d07125 100644 --- a/mllib/curl.ml
2013 Apr 26
1
Stratified Random Sampling Proportional to Size
Hello R Experts, I kindly request your assistance on figuring out how to get a stratified random sampling proportional to 100. Below is my r code showing what I did and the error I'm getting with sampling::strata # FIRST I summarized count of records by the two variables I want to use as strata Library(RODBC) library(sqldf) library(sampling) #After establishing connection I query the data
2007 Mar 08
1
cant fully capture child output
I cant seem to get the io from a child process of a worker back to my client. There most be something academic I''m missing :/. I looked at examples in Pickaxe and Ruby PLEAC library ... and I believe the following should work: # called from within do_work... def backup(repo) logger.info(''SvnWorker backup repo ''+repo) tmp = [] my_project =
2011 Dec 18
1
Identifying records with the correct number of repeated measures
Dear list, I have a dataset where we sampled multiple individuals either 1 or 9 times. Our measurement variable is 'Delta13C' (see below sample dataset). I cannot figure out how to efficiently use a vector command (preferably) or a loop to create a new vector of the names of the individuals sampled 9 times. Note that the 'FeatherPosition' variable will only be "P1" for
2005 Oct 03
0
Problem building/checking library that requires input fro m user
What file are you putting these into? I believe this is the correct syntax for the \example{} section of an .Rd file. If you want to do this in a plain R file, (e.g. package/tests/somename.R), you can use if(interactive) { num_reps <- readline(""How many reps do you have... ") num_reps <- as.integer(num_reps) } else num_reps <- 10 instead. -G > -----Original