similar to: Counting character occurrences in data frame

Displaying 20 results from an estimated 5000 matches similar to: "Counting character occurrences in data frame"

2006 Nov 08
2
Apache 2.2.3 setup woes
Good morning everyone, I am running apache 2.2.3 compiled from source and proxy load balancer as described on the mongrel site. I have a total of three sites, this setup works really well for two of them but for one of them, I keep getting "Forbidden" errors and this error in the apache logs: [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of
2008 Mar 12
1
ftable and xtabs
Hoping someone can help me with xtabs and ftable. I'm trying to get a pair of ftables (possibly more) next to each other. For example: > dunhill_lights_xtab<-ftable(xtabs(grossedupobs ~ gender+age_group + dunhill_lights, data = ciggs)) > dunhill_lights_xtab dunhill_lights No Yes gender age_group Female
2006 Dec 31
3
tabulate: switching columns and rows
Hi all, Please, is there any way of controlling factors in row/columns when using ftable/xtabs? As far as I can see, the last cross-clasifing variable in the formula will appear in columns. The previous ones, in rows. For instance, is it possible to make tension and replicate appear in columns? ftable(xtabs(breaks ~ wool + tension + replicate, data = warpbreaks)) After some years using SAS
2008 Jan 23
3
How to do more advanced cross tabulation in R?
Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I couldn't figure out how to do it. I am wondering if this is even possible in R. Does anyone know? Here is an example: year=rep(2003,16) quarter=rep(1:4,each=4) sales=1:16 company=rep(c("a","b","c","d"),4) df=data.frame(year,quarter,sales,company) #this is the
2009 May 23
2
counting occurrence of text in a dataframe
Hello list. I am hoping for some help with a relatively simple problem. I have a data frame arranged as below. I want to be able to count the occurrence of each gene (eg let-7e) by Experiment. In other words how many times does a given gene crop up in the dataframe. I tried table but couldn't work out how to get the output I want. I have also considered rearranging this data into a list (by
2011 Apr 30
1
More flexible aggregate / eval
Dear list, I would like to do some calculation using different grouping variables. My 'df' looks like this: # Some data set.seed(345) id <- seq(200,400, by=10) ids <- sample(substr(id,1,1)) group1 <- rep(1:3, each=7) group2 <- rep(1:2, c(10,11)) group3 <- rep(1:4, c(5,5,5,6)) df <- data.frame(id, ids, group1, group2, group3) df <- rbind(df, df, df) df$time <-
2006 Aug 30
4
Barplot
Dear all, I have a dataset. I want to make barplot from this data. Zero1 <- " V1 V2 V3 V4 V5 V6 V7 V8 V9 1 1 0 0 0 1 0 0 0 Positive 2 0 0 1 0 1 0 1 1 Negative 3 0 0 1 0 0 0 1 1 Positive 4 0 1 0 1 1 1 0 1 Negative 5 0 0 1 0 1 1 0 0 Positive 6 0 1 0 0 1 1 1 1 Negative 7 1 0 1 1 1 1 1 1 Negative 8 0 0 0 0 1 0 0 1
2011 Jun 24
1
Converting an ftable (contingency table) to a dataframe in R
I am generating an ftable (by running ftable on the results of a xtabs command) and I am getting the following. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Var1? Var2 date ? ? ? ? ? ? ? ? group? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2007-01-01? ? ? ? ? q1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1? ? 9 ? ? ? ? ? ? ? ? ? ? ?q2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
2020 May 13
7
justify hard coded in format.ftable
Dear all, I haven't received any feedback so far on my proposal to make "justify" argument available in stats:::format.ftable Is this list the appropriate place for this kind of proposal? I hope this follow-up to my message won't be taken as rude. Of course it's not meant to be, but I'm not used to the R mailing lists... Thank you in advance for your comments, Best,
2012 Sep 14
1
parallel version of tapply() or table()?
Hello R-helpers. I've tried to recreate a parallel version of tapply() and table() using a combination of the parallel functions mclapply() and pvec() and papply(), but haven't been successful. In the end, I'm trying to get a cross tab of two vectors. I currently (can) use tapply(..., sum) and table(), and even xtabs() and ftable(), but with tens of millions of words and tens of
2006 Oct 22
2
cross tabs with percents?
-- apologies if this is a dup - i got a bounce saying the message was unprocessed. Is there a straightforward way to get a table with percents in the cells rather than counts? I've looked at table, ftable, xtabs, and ctab, which did the conversion but returned the results in a single row without labels. any suggestions are appreciated. thank you.
2005 Jan 17
5
find source code
I am using R 2.0.2 on a WinXP I am trying to get the code of the Kruskal-Wallis test but > kruskal.test function (x, ...) UseMethod("kruskal.test") <environment: namespace:stats> > ls(3) [1] "acf" "acf2AR" "add.scope" .............. [181] "kruskal.test" "ks.test"
2009 Feb 20
2
why doesn't table() have a data=argument?
In an Rweave tutorial written for possibly naive R users, I felt it necessary to explain why table() had to be used inside with(), whereas other tools like xtabs() had a data= argument. with() is quite nice for such cases, but it seems an unnecessary thing to learn right off. Before I turn this question into a request for R-devel, is there any inherent reason why it might be hard to add a
2017 Nov 09
2
R basic
Can anyone help with scripting the commands below? 1. Add/create a new column to df and name it as ShortPause . 2. Convert ShortPause as a factor variable. 3. ShortPause will have two levels (short and long). Assign short if pause is smaller than 0.1, and assign long otherwise. 4. How many ?syntax==intransitive? observations were realized with a tap (tapped==Tapped)? (Use xtabs() and ftable() to
2003 May 30
1
cbind order
Hello I need to use this command: cbind(ftable(xtabs(cnt~geo+slp+con+hey,data=dt3)) hey is in count of success /failure value but cbind gives failure/success counts. I want to change the order of this cbind as success /failure counts. for instance: I want cbind to give counts as 32-4552 rather than 4552-32 what should I do ? thanks in advance Ahmet TURKEY
2009 Jul 03
2
table () for more variables
Dear All, I want to create a table for several variables. As example. I have a dataframe with following data: Gender transport driving 1 0 1 0 1 0 1 0 1 Now I want to create a table in the following form: Gender
2001 Sep 05
3
Bug in ftable?? (Was: Two-way tables of data, etc)
Further to the discussion between Murray Jorgensen and Brian Ripley, it seems to me better to choose tabulations that will not come and bite you. Suppose your data are sligtly irregular, e.g. (for the sake of the argument): data( warpbreaks ) warpbreaks$variant <- rep( 1:5, len=54 ) attach( warpbreaks ) tb <- table( wool, tension, variant ) tb # in this case you would like to see: tp
2001 Sep 05
3
Bug in ftable?? (Was: Two-way tables of data, etc)
Further to the discussion between Murray Jorgensen and Brian Ripley, it seems to me better to choose tabulations that will not come and bite you. Suppose your data are sligtly irregular, e.g. (for the sake of the argument): data( warpbreaks ) warpbreaks$variant <- rep( 1:5, len=54 ) attach( warpbreaks ) tb <- table( wool, tension, variant ) tb # in this case you would like to see: tp
2001 Dec 11
1
how can i have the total for each level using table,ftable,xtabs etc. etc. ?
I have a list with four fields and 3500 records, from a MySQL table. How can i have the total for each level using table, ftable, xtabs? ex: print(ftable(table[,"field1"]~table[,"field2"])) thanks Danilo Maurizio Veneto Lavoro - Area Osservatorio - -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2004 Dec 22
4
Make a table
Dear useR, I have a dataset like this below, > prevRND.dat <- read.table("C:\\workdir\\prevRND.txt", + header=FALSE, # No header. + col.names = c("X","Y","Z"), + sep = ",") > prevRND.dat X Y Z 1 A A 0.950933 2 A B 0.143600 3 A C 0.956133 4 B A