similar to: Error in vector("integer", length) : vector size cannot be NA

Displaying 20 results from an estimated 200 matches similar to: "Error in vector("integer", length) : vector size cannot be NA"

2007 Jun 21
11
one-to-one, compound primary key, naming conventions
My understanding is that, given tables Alpha and Beta that the table which holds the 1-to-1 relation will be called Alpha_Beta (or is it alpha_beta?). So far so good. alpha_beta will have, lets say, two fields: alpha_id and beta_id. Seems that it''d be a good idea for those two fields to form a compound primary key, ensuring there are no duplicates. However, RoR doesn''t
2006 Jul 03
6
help!
Hi, i''m fairly new to ruby on rails, and i know the question at hand may seem simple at first, but i''m getting really caught up in trying to understand this and the docs aren''t giving me answer. i actually thought i knew how the sql commands work (like :include, :conditions, :etc) but obviously, i don''t. there are three models M1, M2, M3 joined by a habtam
2011 Apr 09
5
Yearly aggregates and matrices
Hi, I need to perform calculations on subsets of a data frame: DF = data.frame(read.table(textConnection(" A B C D E F 1 a 1995 0 4 1 2 a 1997 1 1 3 3 b 1995 3 7 0 4 b 1996 1 2 3 5 b 1997 1 2 3 6 b 1998 6 0 0 7 b 1999 3 7 0 8 c 1997 1 2 3 9 c 1998 1 2 3 10 c 1999 6 0 0 11 d 1999 3 7 0 12 e 1995 1 2 3 13 e 1998 1 2 3 14 e 1999 6
2011 Apr 29
4
For loop and sqldf
Hi list, Can anyone tell my why the following does not work? Thanks a lot! Your help is very much appreciated. DF = data.frame(read.table(textConnection(" B C D E F G 8025 1995 0 4 1 2 8025 1997 1 1 3 4 8026 1995 0 7 0 0 8026 1996 1 2 3 0 8026 1997 1 2 3 1 8026 1998 6 0 0 4 8026 1999 3 7 0 3 8027 1997 1 2 3 9 8027 1998 1 2 3 1 8027 1999
2012 Nov 01
7
Reduce(paste, x) question
I have a question about the Reduce function: x <- list() x[[1]] <- LETTERS[1:5] x[[2]] <- LETTERS[11:15] Reduce(paste, x) [1] "A K" "B L" "C M" "D N" "E O" How do I get this?: [1] "A" "K" [2] "B" "L" [3] "C" "M" [4] "D" "N" [5] "E" "O"
2010 Dec 10
2
Projecting data on a world map using long/lat
Hi, I have a dataset (CSV) with some counts of firms located around the globe. Each count is assigned to the longitude and latitude of the specific location. Now I want to plot these counts on a world map using dots (size of dots represent the count). I have been unable to find any info on whether this is possible and if so, how? Can you please help me? Thanks! Mathijs -- View this message
2011 Feb 25
4
Error
Hi, I am running the following script for a different (much larger data frame): DF = data.frame(read.table(textConnection(" A B C D E 1 1 a 1999 1 0 2 1 b 1999 0 1 3 1 c 1999 0 1 4 1 d 1999 1 0 5 2 c 2001 1 0 6 2 d 2001 0 1 7 3 a 2004 0 1 8 3 b 2004 0 1 9 3 d 2004 0 1 10 4 b 2001 1 0 11 4 c 2001 1 0 12 4 d 2001 0
2011 Feb 14
5
Transforming relational data
Hi, I have a large dataset with info on individuals (B) that have been involved in projects (A) during multiple years (C). The dataset contains three columns: A, B, C. Example: A B C 1 1 a 1999 2 1 b 1999 3 1 c 1999 4 1 d 1999 5 2 c 2001 6 2 d 2001 7 3 a 2004 8 3 c 2004 9 3 d 2004 I am interested in how well all the individuals in a project know each other. To
2011 Mar 10
1
Moving window per group
Hi, I have a data.frame of the following type: F = data.frame(read.table(textConnection(" A B 1 1 4 2 1 3 3 1 1 4 1 4 5 1 2 6 1 2 7 1 2 8 2 1 9 2 1 10 2 1 11 2 1 12 3 2 13 3 4 14 3 1 15 3 1 16 3 1"),head=TRUE,stringsAsFactors=FALSE)) F A B 1 1 4 2 1 3 3 1 1 4 1 4 5 1 2 6 1 2 7 1 2 8 2 1 9 2 1 10 2 1 11 2 1 12 3 2 13 3 4 14 3 1 15 3 1 16 3 1
2011 Apr 14
1
Create matrices for time series
Hi list, I would like to use the following data.frame to generate matrices over a 3 year moving window: DF = data.frame(read.table(textConnection(" A B C 80 8025 1995 80 8026 1995 80 8029 1995 81 8026 1996 82 8025 1997 82 8026 1997 83 8025 1997 83 8027 1997 84 8026 1999 84 8027 1999 85 8028 1995 85 8029 1998"),head=TRUE,stringsAsFactors=FALSE)) Function to be
2011 Feb 23
1
conditional seq
Hi, I have two questions: 1. How do I combine "DF$F =" and "DF$G =" into one function? (The original dataset contains many more columns for which I want to execute the same operation) 2. How do I improve the ave function so that the value DF(12,G) = 0 instead of 1 (see bold font)? Both DF(12,B)=DF(6,B) and DF(12,C)=DF(6,C), so I cannot distinguish between both rows, which is
2011 Feb 15
2
Count factor if
Hi, I have a data frame containing two columns: x<-as.factor(c('a','a','a','a','a','b','b','b','c','d','d','d')) y<-c(1,3,6,8,12,3,4,7,5,6,7,10) X<-data.frame(x,y) X x y 1 a 1 2 a 3 3 a 6 4 a 8 5 a 12 6 b 3 7 b 4 8 b 7 9 c 5 10 d 6 11 d 7 12 d 10 I would like to
2010 Dec 10
3
Delete observations with a frequency < x
Hi, I have two columns with data (both identifiers - it's an affiliation list) and I would like to delete the rows in which the observations in the second column have a frequency < 5 in the entire second column. Example: 1 a 1 b 1 c 2 a 2 b 2 d Let's say, I would like to delete the rows in which the observation in the second column has a frequency < 2 in
2011 Mar 22
1
Find Principal Component Score per year
Hi, I am trying to calculate Principal Component Scores per id per year using the psych package. The following lines provide the scores per obeservation pca = data.frame(read.table(textConnection(" id year A B C D 1001 1972 64 56 14 23 1003 1972 60 55 62 111 1005 1972 57 51 10 47 1007 1972 59 49 7 10 1009 1972 65 50 9 32 1011 1972 52 58 3 5 1013
2012 Jul 06
2
Maximum number of patterns and speed in grep
Hi, I am using R's grep function to find patterns in vectors of strings. The number of patterns I would like to match is 7,700 (of different sizes). I noticed that I get an error message when I do the following: data <- array() for (j in 1:length(x)) { array[j] <- length(grep(paste(patterns[1:7700], collapse = "|"), x[j], value = T)) } When I break this up into 4 chunks of
2012 Jan 24
4
Select elements from text
Hi, I have a series of MS word files and each file contains plain text. From these texts I would like to extract only those elements (read: words) that are between square brackets. Example of a text: Most fundamentally, it has led to an effort to clarify the organizational form concept. According to them [see also Smith, Jones and Carroll 2002], categories emerge as audience members recognize
2006 Jan 03
1
Summary functions to dataframe
I have written a few different summary functions. I want to calculate the statistics by groups and I am having trouble getting the output as a dataframe. I have attached one example with a small dataset that calculates summary stats and percentiles, I have others that calculate upper confidence limits etc. I would like the output to be converted to a dataframe with one of the columns as the
2010 Dec 21
1
Matching 2 SQL tables
Hi, I have a postgresql and a mysql database and I would like to combine the info from two different tables in R. Both databases contain a table with three columns: project_name, release_id and release_date. So each project output could be released multiple times (I am interested in the first release_date). However, some of the data is missing. Basically, what I want to do is to try and fill the
2012 May 25
1
evaluate whether function returns error
Hi, The following returns an error message. How do I evaluate (TRUE or FALSE) the function? require(XML) readHTMLTable("http://www.sec.gov/Archives/edgar/data/2969/000095012399010952/0000950123-99-010952.txt") Thanks in advance! Math -- View this message in context: http://r.789695.n4.nabble.com/evaluate-whether-function-returns-error-tp4631406.html Sent from the R help mailing list
2012 May 30
1
gsub/strsplit with multiple patterns/splits
Hi, I have a vector like this: DF <- c("Aetna, Inc.", "Alexander's Inc.", "Allegheny Energy, Inc") For each element in the vector I would like to remove the "incorporated" info, so that my vector looks like this: DF <- c("Aetna", "Alexander's", "Allegheny Energy") That means that I have to strip: strip <-