similar to: frequency count by row

Displaying 20 results from an estimated 1200 matches similar to: "frequency count by row"

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
2011 Jun 27
1
import text-records and set the fields in a table
hi! I apologize in advance if this is a newbie dumm question, but I really can't figure it ou. I have lists of sumeric and character data on some URLs, which look like this: <photo id="5876248819" owner="13716719 at N04" secret="faf9bb7f52" server="5264" farm="6" title="our rose garden" ispublic="1"
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
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,
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 =
2006 Mar 06
4
Contingency table and zeros
Hello, Let's assume I have a vector of integers : > myvector <- c(1, 2, 3, 2, 1, 3, 5) My purpose is to obtain the cumulative distribution of these numerical data, i.e. something like : value nb_occur. <=1 2 <=2 4 <=3 6 <=4 6 <=5 7 For this, I create a table with ; > mytable <- table(myvector) 1 2 3 5 2 2 2 1 However, table() returns an array
2010 Jul 26
4
using string variable as order() function argument
Hello, In my script I would like to use a loop, which sorts the dataframe according to different columns, pointed by the string variable. id col1 col2 col3 1 10 0 4 8 2 11 1 2 2 3 12 0 8 3 4 13 0 5 5 Usually the order() function can be used like this: sorted = mytable**[order(column3) , ] which results in properly sorted table: **
2009 Nov 22
3
Define return values of a function
I have created a function to do something: i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob=c(12, 7, 9, 1))) mytable <- function(x){ xtb <- x btx <- x # do more with x, not relevant here cat("The table has been created,
2007 Apr 20
2
Caching of database values
If do something like this: dbObj = MyTable.find_by_id(5) a = dbObj.name b = dbObj.name How many times will an SQL call be made to get the value of MyTable.name for id 5? In other words, are the values for dbObj cached in the object? Is there a way of controlling that? (I can imagine that sometimes you might not want to cache them if you wanted to be sure of having the latest
2007 May 12
4
Multiply and format with thousands separator
I have just started with Ruby and Rails and am still greatly confuse, finding the usual tutorials not much help. What I want to do is take two numbers from my database, multiply them together and display them in a list with a comma for the thousands separator. This would be very easy to do in a spreadsheet, so I assumed it would be easy to do in Ruby on Rails but I can''t work out how. I
2007 May 06
1
simple table ordering question
Hi all, I'm sure this is simple but I don't get it. I have a table mytable<-c(rep("Disagree",37),rep("Agree",64)) table(mytable) this gives me Agree Disagree 64 37 but I didn't ask for it to be in alphabetic order. How can I get it in original order? Disagree Agree 37 64 Thanks, Jeff Jeffrey. M. Miller, PhD
2005 Oct 31
2
nlme error message
Dear Friends, I am seeking for any help on an error message in lme functions. I use mixed model to analyze a data with compound symmetric correlation structure. But I get an error message: "Error in corMatrix.corCompSymm(object) : NA/NaN/Inf in foreign function call (arg 1)". If I change the correlation structure to corAR1, then no error. I have no clue how to solve this problem.
2008 Oct 14
2
Getting frustrated with RMySQL
Getting the basic stuff to work is trivially simple. I can connect, and, for example, get everything in any given table. What I have yet to find is how to deal with parameterized queries or how to do a simple insert (but not of a value known at the time the script is written - I ultimately want to put my script into a scheduled task, so the analysis can be repeated on updated data either daily
2009 Apr 07
2
newbie query: simple crosstabs
I've been playing around with various table tools, trying to construct a fairly simple cross-tab. It shouldn't be hard, but for some reason it turning out to be (for me). If I want to see how many men and how many women agree with a agree/disagree question (coded 1,0), I can do this: >attach(mydata) >mytable <- table(male, q1.bin) # gender and a binary response variable
2008 Mar 21
5
foreign key question
Hi- Say I have a db with following schema: MyTable: Id, name, user_id, date User: id, name, description I know that I want to add "belongs_to" in my "user" model but how can I enforce a proper constraint on the user_id in "MyTable"? Is this done using a has_one in the "MyTable" model? Thanks! --~--~---------~--~----~------------~-------~--~----~ You
2013 Jan 29
2
converting XML document to table or dataframe
I am a relatively new user to R, and I am trying to learn more about converting data in an XML document into "2-dimensional format" such as a table or array. I might eventually wish to export this data into a relational database such as SQL, and/or to work with this data within the R package. My sample XML document is located at "
2002 Aug 28
1
RODBC: sqlFetch and its argument sqtable
Calling function "sqlFetch" in library(RODBC) and specifying a character string as 2nd argument, I get an error I don't understand: library(RODBC) channel <- odbcConnect("mydatabase.mdb", case="msaccess") sqlFetch(channel, "mytable") # this works fine tabname <- "mytable"; sqlFetch(channel, tabname) # this gives an error: # Error in
2006 Nov 29
5
AR, find(:all), loops and memory usage
I''m a beginning programming using ActiveRecord outside of Rails to do conditional processing of database records. So far, I''ve been successful. However, my script loads all matching records into memory first. There are hundreds of thousands of matching records so the script quickly consumes over 500MB of RAM before any processing is done. Is there a way to avoid this preloading