similar to: Counting non-empty levels of a factor

Displaying 20 results from an estimated 5000 matches similar to: "Counting non-empty levels of a factor"

2012 May 28
2
import contingency table
hello everyone, i often work on contingency table that I create from data.frame (with table() function) but a friend sent me an excel sheet wich *already is* a contingency table (just a simple 2 way table !...) any clue on how to import it in R (keeping row names and col names) ? any tuto I come accross only mention the table transformation, but never the import of such data I only found
2013 Apr 13
1
Reshaping Data for bi-partite Network Analysis [SOLVED]
Wow ! so many thanks Arun and Rui works like a charm problem solved 2013/4/13 arun <smartpink111@yahoo.com> > Hi, > Try this; > library(reshape2) > res<-dcast(Input,people~place,value.var="time") > res[is.na(res)]<-0 > res > # people beach home school sport > #1 Joe 5 3 0 1 > #2 Marc 0 4 2 0 > #3 Mary
2013 Apr 13
2
Reshaping Data for bi-partite Network Analysis
Hello I have a dataset of people spending time in places. But most people don't hang out in all the places. it looks like: > Input<-data.frame(people=c("Marc","Marc","Joe","Joe","Joe","Mary"), + place=c("school","home","home","sport","beach","school"), +
2010 Mar 02
1
how to import map data (maptools?) from a html set of 'coords'
Dear R users, I would like to draw map and import it in maptools/spatstat packages. The 'raw data' I have come from a web page (<map>...</map>) and are basically a list of coordinates of a polygon. I would like to know how to import them in R; I checked the maptools packages, but all the examples use existing .dbf files. I just have a (serie of) text file(s) looking like
2009 Dec 04
1
length of a density curve (or any curve)
Hello R users, When I type d <- density(MyData$x) I obtain a density object I can plot, But I wonder if there is a way to easily compute the length of the density curve ? ( I imagine I could compute the distances between the 512 equally spaced points using their x and y, but does it exist a smarter way ?) Regards, SW
2006 Mar 28
2
TukeyHSD for repeated measures aov ?
Hi all, I search the archive for finding a simple solution for using TukeyHSD with a multistratum aov result (a repeated emasure anova). The Question have been asked but I've found no clear answer. res<-aov(y~Fa*Fb+Error(Subject/(Fa*Fb)) ) I think that the problem is that res is an aovlist object instead of the "aov" object required by TukeyHSD. Is there an easy solution to
2010 May 21
3
New Linux/Wine User Needs Help!
Hello, I am running Wine with Ubuntu 10.04 on a Toshiba Laptop. I installed Wine using the Ubuntu Software Center and am using 1.1.42. I have 'installed' Adobe Reader, Firefox, IE 8 and Business Plan Pro from Palo Alto Software. Firefox will start and run, IE 8 will not fully execute, Adobe Reader gives an error for Wine C++ Runtime error and Biz Plan Pro gives an Active X error 429.
2012 Aug 27
7
Deduplication data for CentOS?
Hi list, is there any working solution for deduplication of data for centos? We are trying to find a solution for our backup server which runs a bash script invoking xdelta(3). But having this functionality in fs is much more friendly... We have looked into lessfs, sdfs and ddar. Are these filesystems ready to use (on centos)? ddar is sthg different, I know. Thx Rainer
2008 Nov 26
1
Request for Assistance in R with NonMem
Hi I am having some problems running a covariate analysis with my colleage using R with the NonMem program we are using for a graduate school project. R and NonMem run fine without adding in the covariates, but the program is giving us a problem when the covariate analysis is added. We think the problem is with the R code to run the covariate data analysis. We have the control stream, R code
2011 Sep 13
6
Install and run Wine purely in/from the home folder
Hello folks. I have a little question for you. First to the background. I have a windows program (command line based) that is able to run just fine in the wine environment. Now I want to run it on our linux HPC server (no multi-threading and so on is needed). There is no wine installed by default, and as I'm no admin I can't install it there. So is it possible to make wine run purely
2006 Feb 14
1
addmargins
> addmargins(UCBAdmissions, FUN = list(Total=sum)) works with no problems, but consider: > myFUN <- list(Total=sum) > addmargins(UCBAdmissions, FUN = myFUN) Error in "names<-.default"(`*tmp*`, value = "") : names() applied to a non-vector Is this a bug? > R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system
2018 Feb 03
2
find unique and summerize
Thank you so much Rui. 1. How do I export this table to excel file? I used this tbl1 <- table(Country, IDNum) tbl2=addmargins(tbl1) write.xlsx(tbl2,"tt1.xlsx"),sheetName="summary", row.names=FALSE) The above did not give me that table. 2. I want select those unique Ids that do have records in all countries. From the above data set, this ID
2006 Jun 29
2
zero.print in print.table after adding margins
The function addmargins() adds margins to a table, but returns a matrix. But even after converted to a table the print.zero="." option of print.table() does not work: > x <- sample( 1:7, 20, replace=T ) > y <- sample( 1:7, 20, replace=T ) > tt <- table( x, y ) > tx <- as.table( addmargins( table( x, y ) ) ) > print( tt, zero.print="." ) y x 1 2
2006 Jun 29
2
zero.print in print.table after adding margins
The function addmargins() adds margins to a table, but returns a matrix. But even after converted to a table the print.zero="." option of print.table() does not work: > x <- sample( 1:7, 20, replace=T ) > y <- sample( 1:7, 20, replace=T ) > tt <- table( x, y ) > tx <- as.table( addmargins( table( x, y ) ) ) > print( tt, zero.print="." ) y x 1 2
2013 Apr 10
2
Table with n(%) formatting: A better way to do this?
Hello All, Am learning to create tables with n(%) formatting using R. Below is a working example. I think this is not bad but wondered if there are better ways of doing it. Although it can be quite humbling, seeing good code helps me assess my progress as an R programmer. Ultimately want to have code that I can turn into a function. Will then use the output produced to make tables using
2004 Jan 23
5
Levels number of a factor object
Hi all! How to retrieve the levels number of a factor object? See this code: groups<-gl(4,10) I want to retrieve the number of levels (4) of my object "groups" I tried groups.levels but this don't work Thanks Laurent Houdusse Analyste Programmeur
2012 Jun 26
5
chisq.test
Dear list! I would like to calculate "chisq.test" on simple data set with 70 observations, but the output is ''Warning message:'' Warning message: In chisq.test(tabele) : Chi-squared approximation may be incorrect Here is an example:         tabele <- matrix(c(11, 3, 3, 18, 3, 6, 5, 21), ncol = 4, byrow = TRUE)         dimnames(tabela) <- list(        
2004 Dec 13
3
Percentages in contingency tables *warning trivial question*
I hesitate to post this question in the light of recent threads, indeed I have hesitated for several weeks, however I have come to a full stop and really need some help if I am going to progress. I am a new user of R for medical statistics. I have attempted to read all the relevant documents, but would welcome any suggestions as to what I have missed. I am trying to contruct "table 1"
2006 Sep 22
3
Compiling a contingency table of counts by case
I have asked a similar question before but this time the problem is somewhat more involved. I have the following data: case;name;x 1;Joe;1 1;Mike;1 1;Zoe;1 2;Joe;1 2;Mike;0 2;Zoe;1 2;John;1 3;Mike;1 3;Zoe;0 3;Karl;0 I would like to count the number of "case" in which any two "name" a. both have "x=1", b. the first has "x=0" - the second has
2006 Feb 14
3
A concrete type I/III Sum of square problem
Hi R-help members, I have read a lot in the Archive about the "Type I" vs "Type III" sum of square. I think I have read confusing post so I want to have a clear idea of the problem. Here is an example. I have 3 groups of subjects of unequal sample size (G1 (n=7), G2 (n=7), G3 (n=4)). for Each subject I have 4 measures corresponding to the crossing of 2 factor (A & B)