similar to: Contingency table and zeros

Displaying 20 results from an estimated 2000 matches similar to: "Contingency table and zeros"

2012 Feb 26
6
loop for a large database
Yes, I am a newbie. I have a data.frame (MyTable) of 1445846 rows and 15 columns with character data. And a character vector (MyVector) of 473491 elements. I want simply to get a data.frame with the count of how many times each element of MyVector appears in MyTable. I've tried a loop with : for (i in 1 : length (myvector)) sum (MyTable== i) but it crashes my computer. I've also
2012 Mar 16
2
contingency tables
Ok, before I definetly give up, and throw the laptop out of the window, or fill my data.frame manually, I'll ask for some help. I have a data.frame named MyTable with 3 columns, that looks like this: V1 V2 V3 red-j appearanceblood-n 105.032 red-j appearanceground-n 93.749 red-j appearancesea-n 102.167 red-j appearancesky-n 10.898
2012 Mar 10
2
Window on a vector
Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis<-myVector[1] yaxis<-c(xaxis,mean(myvector[2:3]) yaxis<-c(xaxis,mean(myvector[4:8]) yaxis<c(xaxis,mean(myvector[9:16]) yaxis<c(xaxis,mean(myvector[17:32]) this has to stop when the new ..... yaxis<c(xaxis,mean(myvector[1024:2048]) will not find the correspondent number
2008 Nov 06
2
Fwd: SWIG with R and C++ STL
Hi, all I didn't get any response from swig for my question. see if I can get some help here Thanks ---------- Forwarded message ---------- From: charlie <charlie.xia.fdu@gmail.com> Date: Tue, Nov 4, 2008 at 1:55 PM Subject: SWIG with R and C++ STL To: swig-user@lists.sourceforge.net Hi all, I am new to SWIG. I encountered some problem when I try to SWIG to R some C++ modules. Here
2007 Dec 18
6
All anchored series from a vector?
>From: Johannes Graumann <johannes_graumann at web.de> >Date: 2007/12/18 Tue PM 04:40:37 CST >To: r-help at stat.math.ethz.ch >Subject: [R] All anchored series from a vector? lapply(1:length(myvector) function(.length) { c(myvector[1}:myvector[.length]) }) but test it because i didn't. >Hi all, > >What may be a smart, efficient way to get the following result:
2009 Feb 15
1
Overloading in R
I have been trying to write a new class that reimplements the vector class. As a test of my overloading I decided to try and and call t.test on two vectors which were objects of my class rather than the default class. The overloaded length I wrote seems to work correctly. I used setMethod("length", "myvector", ...) setMethod("mean", "myvector", ...)
2013 Aug 27
1
R Language Newbie
Hi, set.seed(29) myVector<- rnorm(100) ?seq(1,100,by=2) # [1]? 1? 3? 5? 7? 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 #[26] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 myVector[seq(1,100,by=2)] rev(myVector) ?sum(myVector>0) #[1] 46 #or ?table(myVector>0) # #FALSE? TRUE ?#? 54??? 46 A.K. Hey guys, this is my first week
2012 Aug 10
2
creating a contingency table from a data.frame automatically (NOT BY HAND)
Hello there! I am still struggling with a binomial response over all categorical variables (some of them with 3 levels, most with 2 levels). After initial struggles with glm's (struggle coming from the data, not the actual analysis) I have decided to prefer contingency tables. I have my data such as: response:
2008 Aug 22
1
grep, gsub and metacharacters
Hello, I have an expression that I want to substitute for something else. myvector<-c("ajkhfkiuwe","Variable(kg/min)") if I use the following code to extract "variable(kg/min)" and substitute it for "va" gsub(myvector[grep("var", myvector, ignore=T)], "va", myvector) grep identifies the element of the vector that matches my
2006 Apr 04
2
Selecting out certain values from a MATRIX
I have two objects, one matrix and one vector. I want to use my vector to subset certain values out of my matrix. For example: I want to tell R, to select out all rows in myMatrix into a new myMatrix2 IF that corresponding row is less than a 0.5 in myVector. So: myMatrix = a matrix of 8000 by 20 myVector = vector of 8000 myMatrix2 = a matrix of < 8000 by 20 (based on selection criteria in
2011 Sep 30
3
is member
Dear all, I have a vector with number that some of them are part of the   seq(1,800,4). How can I check which of the numbers belong to the seq(1,800,4)   LEt's say that is called myvector the vector with the numbers. Is there in R something like this? is.member(myvector,seq(1,800,4))   I would like to thank you in advance for your help   B.R Alex [[alternative HTML version deleted]]
2015 Oct 22
2
C_LogLin (stats/loglin)
Hi everyone, I have a question regarding a C function of the "stats" package in R. I tried to understand the ?loglin? basic function of the ?stats? package implemented in R. The implemented function itself runs without any problem (perhaps see sample). When I ran it line by line it stopped at the lines 23-24 of the loglin-function; (the following line): z <- .Call(C_LogLin,
2012 Mar 14
1
check for data in a data.frame and return correspondent number
Dear R-ers, still the newbie. With a question about coordinates of a vector appearing or not in a data.frame. I have a data.frame (MyData) with 3 columns which looks like this: V1 V4 redNew red-j 10.5032 appearance blood-n red-j 9.3749 appearance ground-n red-j 10.2167
2012 Jan 16
3
list: index of the element, that is TRUE
Dear People, I have got the following example for a vector and the index of the TRUE element: Myvector <- c(FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE) which(Myvector) Now I would like to find out the same for a list: Mylist <- list(FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE) ... Does anyone know how to do this? Thank you very much in advance, Marion [[alternative HTML
2009 Aug 25
3
Regular expression to define contents between parentheses
Hello dear R-helpers, I haven't been able to figure out of find a solution in the R-help archives about how to delete all the characters contained in groups of parenthesis. I have a vector that looks more or less like this: myvector<-c("something (80 km/h, sd) & more (6 kg/L,sd)", "somethingelse (48 m/s, sd) & moretoo (50g/L , sd)") I want to extract all
2009 Oct 16
1
Frequencies, proportions & cumulative proportions
Dear R-Helpers, I've looked high and low for a function that provides frequencies, proportions and cumulative proportions side-by-side. Below is the table I need. Is there a function that already does it? Thanks, Bob > # Generate some test scores > myValues <- c(70:95) > Score <- ( sample( myValues, size=1000, replace=TRUE) ) > head(Score) [1] 77 71 81 88 83 93 > >
2013 Mar 14
1
error: object of type 'closure' is not subsettable
Hi all, when i run this script: >read.table("Angelika.txt",header=T,sep="\t") >mytable=read.table("Angelika.txt",header=T,sep="\t") >for ( dye in c("A","B","C","F","G","K","L","M")) + { + for (cond in 1:8) + { + measurement =
2008 Jul 10
2
Finding Values that Occur Most Often in a Vector
Hi, Is there a way to do it? For example I have the following vector: > print(myvector) > [1] -295.8045 -295.8045 -295.8045 -295.8045 -325.4754 -295.8045 -295.8045 [8] -295.8045 -413.2099 -295.8045 I want it to return -295.8045, which occur most often. - Gundala Viswanath Jakarta - Indonesia
2012 Mar 06
1
frequency count by row
I feel this is a very easy thing but I've never done it before and it is getting frustrating. I have a big data.frame (1445846 rows, 15 col) that looks like this: V1 V2 V3 V4 V5 1 home sister brother chair 0 2 cat dog animal 0 0 3 girl boy 0
2012 Mar 24
1
plotting with line types... bit confusing
Dear all, I would like to print an empirical cdf on a vector I have while the plot(ecdf(myVector)) works great when I try to specify the line type to be a line (I get points) with plot(ecdf(myVector),type="lines") Error in plot.default(NA, NA, type = "n", xlim = xlim, ylim = ylim, xlab = xlab,  :   formal argument "type" matched by multiple actual arguments I get