similar to: Function to "lump" factors together?

Displaying 20 results from an estimated 4000 matches similar to: "Function to "lump" factors together?"

2017 Nov 01
1
Correct subsetting in R
But they row.names() cannot give me the IDs On Wednesday, November 1, 2017 9:45 AM, David Wolfskill <r at catwhisker.org> wrote: On Wed, Nov 01, 2017 at 04:13:42PM +0000, Elahe chalabi via R-help wrote: > Hi all, > I have two data frames that one of them does not have the column ID: > > > str(data) > 'data.frame': 499 obs. of 608 variables:
2017 Jun 11
3
post ino64: lockd no runs?
On Sun, Jun 04, 2017 at 08:57:44AM -0400, Michael Butler wrote: > It seems that {rpc.}lockd no longer runs after the ino64 changes on any > of my systems after a full rebuild of src and ports. No log entries > offer any insight as to why :-( > > imb I don't tend to use NFS on my systems that are running head, so I haven't had occasion to test this as stated. However, I
2011 Jan 10
2
Calculating Portfolio Standard deviation
Dear R helpers I have following data stocks <- c("ABC", "DEF", "GHI", "JKL") prices_df <- data.frame(ABC = c(17,24,15,22,16,22,17,22,15,19),                                          DEF = c(22,28,20,20,28,26,29,18,24,21),                                           GHI = c(32,27,32,36,37,37,34,23,25,32),                                          
2006 Oct 27
3
Suppress blanks/spaces in character
Hi all I'm have a character vector and would like to suppress the blanks if there are more than one after the other. Example: Character value is: "abc def ghi" The result should be: "abc def ghi" I know that it's possible to delete the leading blanks with the command "trim". But how can I delete blanks within a character? Thank you very much in
2005 May 30
4
Very simple traffic shaping script for H.323
Hello - What I want to do seems very simple - I want to make sure any H.323 traffic gets processed before anything else entering or leaving this network. The network has a videoconferencing device on the LAN at 192.168.16.4. A Linux firewall NATs an external IP Address to this internal address and I have appropriate SNAT and DNAT rules that work. The NAT and connection tracking rules all work
2011 Feb 14
2
Is there a way to force counters to be treated as "unsigned?"
I am acquiring some sampled data that is time-stamped (with a POSIXct). Some of the data is in the form of "counters" -- that is, what is interesting isn't value of a given counter at a given time, but the change in the counter from one sample to a later one. As the counters are only incremented, they would be perceived to be monotonically increasing -- ideally. Unfortunately, the
2012 Aug 27
4
?nchar ?strsplit
Hi, my data frame is x<-data.frame(ID=c("abc/def","abc/def/ghi","abc","mno/pqr/st/ab")) I want to split my column ID using "/" as the place to split. How can I do that without telling the code how many sub-columns. I could use nchar(gsub("[^/]","",x$ID)) to get how many "/" are in each row of the column, but could
2010 Jul 14
1
Arrange values on a timeline
I have a set of labels arranged along a timeframe in a. Each label has a timestamp and marks a state until the next label. The dataframe a contains 5 such timestamps and 5 associated labels. This means, on a continious scale between 1-100, there are 5 markers. E.g. 'abc' marks the timestampls between 10 and 19, 'def' marks the timestamps between 20 and 32, and so on. a <-
2006 Mar 07
3
Expanding partial names
I'm writing wrappers for some functions that change some of the default arguments. I'd rather not list all of the arguments for the low level functions because there are about a dozen wrapper functions, and about 20 arguments to lowlevel. Instead I'm trying something like this: lowlevel <- function(longname = 1) { cat("longname = ", longname, "\n") }
2003 Aug 26
3
matching-case sensitivity
Hi All, I am trying to match two character arrays (email lists) using either pmatch(), match() or charmatch() functions. However the function is "missing" some matches due to differences in the cases of some letters between the two arrays. Is there any way to disable case sensitivity or is there an entirely better way to match two character arrays that have identical entries but written
2013 Jul 15
1
pmatch inconsistency
The pmatch help (see also section 4.3.2 in the R Language Definition) claims that pmatch with duplicates.ok=FALSE provides the same functionality as R's argument matching algorithm, modulo how empty strings are matched. Here's an undocumented inconsistency between pmatch and R's argument matching algorithm: > sessionInfo() R version 3.0.1 (2013-05-16) Platform:
2005 Aug 15
3
How to repeat code snippet for several variables in a data frame?
Dear all, I have a data frame containing the results of an experiment. Like this: a<-seq(1,4,by=1) b<-seq(1,2,by=1) test<-expand.grid(b,a,a) colnames(test)<-c("replicates","bins", "groups") test$abc <- rnorm(32) test$def <- rnorm(32) test$ghi <- rnorm(32) test The following code snippet aggregates the data for one variable and then draws a
2015 Aug 23
3
Shortcomings of Maildir++ layout
Hi, I am trying to deal with the problem, that under regular mbox format a path can lead to either a file or a directory, but not both, while under IMAP, a path is usually both, a message folder containing subfolders. I found dovecot's approach to this problem, the Maildir++ layout described under http://wiki2.dovecot.org/MboxChildFolders , and was astonished to see, what problems come with
2006 Mar 15
5
Recent 6.1-PRE: burncd: ioctl(CDRIOCFIXATE): Input/output error
I'm running: localhost(6.1-P)[21] uname -a FreeBSD localhost 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #19: Wed Mar 15 07:15:25 PST 2006 root@g1-18.catwhisker.org.:/common/S2/obj/usr/src/sys/LAPTOP_30W i386 localhost(6.1-P)[22] I figured I'd grab a copy of the recent 6.1-BETA4 (disc1) ISO to try it out & hand it out to folks.... It seems to have worked, but I got a bit of a whine
1999 Jan 20
0
dist(*, "euclidean") [was "dist function suggestion"]
> BDR> You will need to call it something else: dist is a clone of an S > BDR> function, and dist(X, "manhattan") is well-established usage. > > one could still imagine an extra Y argument such that > dist(X, Y=myY, method="euclidean") > and dist(X, "euclidean", Y=myY) > would work > one could even make it such that > both
2014 Jan 23
7
[PATCH 0/7] Various fixes for Ceph drives and parsing libvirt XML.
Miscellaneous fixes to: - Handling of Ceph drives now works end-to-end (RHBZ#1026688). - In particular, you can now use rbd:/// URIs in guestfish (and they work). - Parse Ceph & NBD network drives from libvirt XML correctly, so that existing domains with Ceph/NBD drives can be added (eg. using guestfish -d option). - Add more testing of the above.
2011 Dec 01
2
Counting the occurences of a charater within a string
I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. My dataframe, x, is structured as below: Col1 abc/def ghi/jkl/mno I found this code on the board but it counts all occurrences of "/" in the dataframe. chr.pos <- which(unlist(strsplit(x,NULL))=='/') chr.count <-
2009 Oct 02
3
break up a string into strings with a fixed length
dear all, I have some very long strings and would like to break up each long string into multiple strings with a fixed length, e.g. to break up abcdefghijkl into abc, def, ghi, jkl I tried a couple of commands but was not successful. Any help will be appreciated. Best, Jimmy -- View this message in context:
2012 Feb 03
2
Having trouble controlling plot() output (e.g., color)
I expect that there's something glaringly obvious that I'm overlooking, as I'm justr getting back involved in using R after a several-month hiatus (from R). So I welcome clues. When I invoke plot(), merely specifying a data.frame with 2 columns, specify the plot type ("type") of "p" ("points"), and that I want the point to be green ('col =
2011 Feb 10
1
"Error in plot.window(...) : invalid 'xlim' value" from plot(...par(new = TRUE))
[New to the community; still in early part of R's learning curve.] Several months ago, I was requested to generate some graphs on a periodic basis. Accordingly, I managed to figure out a way to do so, using a combination of Perl and R (in a FreeBSD environment). While I've needed to adjust a few things here and there, the general approach has been pretty solid , and the R part has had