similar to: read.table problem with column headers

Displaying 20 results from an estimated 10000 matches similar to: "read.table problem with column headers"

2002 Mar 27
0
Any good examples of survey processing?
I'm trying to get a semi-automated approach to processing survey data that I'm getting from mod_survey, an Apache-based web survey tool. It looks like one can do this with enough experience in writing R routines. Before I start from scratch, is there a sample file that shows good techniques for producing labeled graphs and tables from survey data with R? I've looked but not found what
2002 Mar 29
0
FW: Newbie struggling with "factors"
Hint #1, to do any useful transformations on your variables you will probably need to convert them temporarily into character variables (aka strings). Do that with as.character(n$OSUSE) Probably your will want to convert each of the variables that are in this format into a set of numeric variables. Something like this: n <- data.frame(OSUSE =
2002 Mar 29
3
Newbie struggling with "factors"
I am processing some survey results, and my data are being read in as "factors". I don't know how to process these things in any way. To start with, several of the survey questions are mulit-choice check boxes on the original (web-based) survey, as in "check all that apply". These are encoded as numbers. For example, if the survey has a question: Which operating systems
2013 Apr 18
6
count each answer category in each column
Hey, Is it possible that R can calculate each options under each column and return a summary table? Suppose I have a table like this: Gender Age Rate Female 0-10 Good Male 0-10 Good Female 11-20 Bad Male 11-20 Bad Male >20 N/A I want to have a summary table including the information that how many answers in each category, sth like this: X
2006 Nov 26
2
Fixed zeros in tables
Hello All R Users, Function loglm() in library MASS can be cajoled to accomodate structural zeros in a cross-classification table. An example from Fienberg demonstrates how this can be done. My question is: Can the function glm() perform the same task? Can glm() estimate a log-linear model with fixed zeros like loglm()? Thanks for your help, Andrew ## Fienberg, The Analysis of Cross-Classified
2004 Aug 09
5
How to import specific column(s) using "read.table"?
Dear R people, I have a very big tab-delim txt file with header and I only want to import several columns into R. I checked the options for "read.table" and only found "nrows" which lets you specify the maximum number of rows to read in. Although I can use some text editors (e.g., wordpad) to edit the txt file first before running R, I feel it?s not very convenient. The
2012 May 14
1
Post stratification weights in survey package in R
Hi all, I have data collected from a survey administered on a subset of the population. I also have the population proportions of variables such as gender, race and housing type. I would like to combine the weights from each separate cross tab (of gender, race and housing type) such that the weighted proportions of my survey data matches that of the population. I have tried the following:
2006 Mar 02
5
Two foreign keys on the same column?
Let''s say I have three hypothetical MySQL tables: ? people, with columns id, gender, and source_id belongs_to :boys and :girls ? boys, with columns id and name has_many :people ? girls, with columns id and name has_many :people The gender column in people specifies which of the two source tables the source_id refers to. For example, if we have values: 1, boy, 1 in people,
2012 Aug 27
1
practical way to change column names?
Dear R helpers, I have a social network data including repated measures of ten alters (whom you contact) and their attributes(gender, age, strength of tie). I wrote variables related with alters just for wrote alter 1 and alter 2. I'd like to change the like below. I'd change each name separetely. Do you know any pratical way to change it? All the bests, Niklas variables for alter 1
2013 Jan 11
3
aggregate data.frame based on column class
Hi, When using the aggregate function to aggregate a data.frame by one or more grouping variables I often have the problem, that I want the mean for some numeric variables but the unique value for factor variables. So for example in this data-frame: data <- data.frame(x = rnorm(10,1,2), group = c(rep(1,5), rep(2,5)), gender =c(rep('m',5), rep('f',5))) aggregate(data,
2003 Feb 11
2
Periods instead of spaces in dataframe names?
Basic question: when I use names() to extract the name of a dataframe element, why does it have "." instead of " " between words? Context: I'm importing a CSV file of survey results for analysis. I read them like this: df <- read.csv("surveydata.csv",nrows=40,header=TRUE,
2003 Aug 29
3
Creating a new table from a set of constraints
Hi Everyone, Here's a silly newbie question. How do I remove unwanted rows from an R table? Say that I read my data as: X <- read.table("mydata.txt") and say that there are columns for age and gender. Call these X[5] and X[10], respectively. Here, X[5] is a column of positive integers and X[10] is binary valued i.e., zero (for male) and one (for female) Now, say that I
2012 Dec 10
3
Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!
Hi there I'm trying to fit a logistic regression model to data that looks very similar to the data in the sample below. I don't understand why I'm getting this error; none of the data are proportional and the weights are numeric values. Should I be concerned about the warning about non-integer successes in my binomial glm? If I should be, how do I go about addressing it? I'm
2010 Feb 05
2
sum a particular column by group
Dear all, I have a table like this: > eds R.ID Region Gender Agegr Time nvisits 1 1 A F 60--64 1:00 1 2 2 O F 55--59 1:20 1 3 3 O F 55--59 3:45 3 4 4 S M 60--64 1:10 3 5 5 W F 55--59 12:30 1 6
2011 Aug 18
1
Comparison of means in survey package
Dear list colleagues, I'm trying to come up with a test question for undergraduates to illustrate comparison of means from a complex survey design. The data for the example looks roughly like this: mytest<-data.frame(harper=rnorm(500, mean=60, sd=1), party=sample(c("BQ", "NDP", "Conservative", "Liberal", "None", NA), size=500,
2008 May 01
1
Data manipulation for random intercept GLMM
Hello, I am working on some examples of GLMM for my students but I am afraid that my way of preparing a dataframe to pass to lmer will make them think that R is a very difficult and un-natural language. Here is for example a simple data set about approval ratings on two different surveys for a random sample of 1600 individuals. > ## Example: Ratings of prime minister (Agresti, Table 12.1,
2008 May 02
1
Cant resolve Error Message
Hi, Im having trouble creating the following graph. Here is my code: library(plotrix) library(prettyR) female_improvement <-read.table("C://project/graphs/gender/breakdown/gender-improvement/female-improvement.csv", sep=",", header=TRUE) barp(rbind(rep(length(female_improvement$gender),2),freq(female_improvement$reason)[[1]]), ylab="22 Males participated in the
2012 Jul 23
3
How to do the same thing for all levels of a column?
Dear all, I am a R beginner, and I am looking for a way to do the same thing for all levels of a column in a table. Basically, I have a bunch of protein sequences composed of different amino acid residues, and each residue is represented by an uppercase letter. I want to calculate the ratio of different amino acid residues at each position of the proteins. Here is an example table: Proteins
2009 Sep 17
1
Filling Empty Column with String in read.table
I have a data file that looks like this. __DATA__ D7KAR5Z02F447V 176 G 0.22 D7KAR5Z02J3WLG 94 A 1.05 29 D7KAR5Z02F4K6L 198 a 0.13 D7KAR5Z02J4SYO 67 C 0.95 28 D7KAR5Z02J4SYO 83 C 1.01 29 D7KAR5Z02J4SYO 97 T 0.13 D7KAR5Z02J4SYO 166 A 0.94 27 I want the rows where the last column has no-entry to be filled with "-". Is there a way to do it with
2011 Mar 30
1
sampling design runs with no errors but returns empty data set
Dear colleagues, I'm working with the 2008 Canada Election Studies (http://www.queensu.ca/cora/_files/_CES/CES2008.sav.zip), trying to construct a weighted national sample using the survey package. Three weights are included in the national survey (a household weight, a provincial weight and a national weight which is a product of the first two). In the following code I removed variables with