similar to: Error

Displaying 20 results from an estimated 2600 matches similar to: "Error"

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
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
2010 May 13
1
Access to files downloaded
Dear All: I downloaded "gee" source code and now I am having problem accessing the file. > download.packages("gee", type="source", destdir="~") --- Please select a CRAN mirror for use in this session --- trying URL ' http://www.ibiblio.org/pub/languages/R/CRAN/src/contrib/gee_4.13-14.tar.gz' Content type 'application/x-gzip' length
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 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
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
2010 Dec 09
2
Error in vector("integer", length) : vector size cannot be NA
Hello, I have uploaded a csv file that looks like this: > gc alpha_id beta_id 1 142053 1 2 9454 1 3 295618 2 4 42691 2 5 389224 3 6 9455 3 The alpha_id contains 310660 unique values and the beta_id contains 17431 unique values. The number of rows adds up to more than 1.3 million. Now I want to convert
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 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
2011 Jan 09
1
Rectangle height in lattice xyplot key
Dear All I have a problem with the height of the boxes in the key in the following. (The text is over 2 lines to accentuate the problem of no space between the rectangles.) Is there an easy way to put a space between the rectangles; size controls the width but there appears to be nothing for the height? xyplot(1~1, key = list(corner = c(0.8,0.8),
2011 Jun 02
2
Counting occurrences in a moving window
Hi list, based on the following data.frame I would like to create a variable that indicates the number of occurrences of A in the 3 years prior to the current year: DF = data.frame(read.table(textConnection(" A B 8025 1995 8026 1995 8029 1995 8026 1996 8025 1997 8026 1997 8025 1997 8027 1997 8026 1999 8027 1999 8028 1995 8029 1998 8025 1997 8027 1997 8026 1999 8027 1999
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
2011 Feb 20
1
Conditional sum
Hi, I have a DF like this: DF = data.frame(read.table(textConnection(" A B C 1 b1 1999 0.25 2 c1 1999 0.25 3 d1 1999 0.25 4 a2 1999 0.25 5 c2 1999 0.25 6 d2 1999 0.25 7 a3 1999 0.25 8 b3 1999 0.25 9 d3 1999 0.25 10 a4 1999 0.25 11 b4 1999 0.25 12 c4 1999 0.25 13 b1 2001 0.5 14 a2 2001 0.5 15 b1 2004 0.33 16 c1 2004 0.33 17 a2 2004 0.33 18 c2 2004
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
2011 Jan 26
1
Compilation errors when installing gee
Hi, I am trying to install gee on our server but I get the error below. I do not have root on this machine so no control on how R was installed itself. It looks like it cannot find blas libs, the only ones i can find on the machine are: /usr/lib64/libblas.so.3 -> libblas.so.3.0.3 /usr/lib64/libblas.so.3.0 -> libblas.so.3.0.3 /usr/lib64/libblas.so.3.0.3 and : $ R CMD config BLAS_LIBS
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