similar to: stripping #s in a text file prior to reading into table or dataframe

Displaying 20 results from an estimated 6000 matches similar to: "stripping #s in a text file prior to reading into table or dataframe"

2009 Jul 03
2
mapping states with colors
Hi folks, I'm just learning how to use maps. As an initial foray, I'm mapping the states that have "duty to retreat" (blue) and "stand your ground" (red) self-defense standards. Here is my extremely naive script: dtr <- c('alabama', 'arizona', 'conneticut', 'delaware', 'dist of columbia' , 'hawaii',
2008 May 28
1
manipulating multiply imputed data sets
Hi folks, I have five imputed data sets and would like to apply the same recoding routines to each. I could do this sort of thing pretty easily in Stata using MIM, but I've decided to go cold turkey on other stats packages as a incentive for learning more about R. Most of the recoding is for nominal variables, like race, religion, urbanicity, and the like. So, for example, to recode race
2008 Jun 22
1
two newbie questions
# I've tried to make this easy to paste into R, though it's probably so simple you won't need to. # I have some data (there are many more variables, but this is a reasonable approximation of it) # here's a fabricated data frame that is similar in form to mine: my.df <- data.frame(replicate(10, round(rnorm(100, mean=3.5, sd=1)))) var.list <- c("dv1",
2009 Aug 26
2
simple graph question: manipulating variable names
This is a simple problem that has stumped me: I'm trying to loop through a few dozen variable names in graphs. I've tried various approaches like this: attach(mydata) ivs <- c("oneiv", "anotheriv", "yetanotheriv") dvs <- c("onedv", "anotherdv", "yetanotherdv") for (iv in ivs) { for (dv in dvs) { graphname <- paste(iv,
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 Jul 15
2
sem & testing multiple hypotheses with BIC
I'm coming from the AMOS world and am wondering if there is a simple way to do multiple hypothesis testing in the manner of BIC analyses in AMOS using the sem package in R. I've read the documentation, but don't see anything in there except for basic BIC scores. Perhaps someone has devised a simple way to compare the relative likelihood of all possible path-fittings within a
2008 Sep 27
1
quantile / centile
I'm wondering if there is a simple way to assign a quantile to a vector in a data frame, much like one could in Stata using centile. Let's say I want 100 slices in my assignation. I can easily see what the limits of each slice by using quantile: quantile(my.df$my.var, probs=seq(0, 1, 0.01)) But how do I assign the appropriate value to each row/record in my data frame? Clearly the
2009 Aug 27
1
standard error associated with correlation coefficient
I want the standard error associated with a correlation. I can calculate using cor & var, but am wondering if there are libraries that already provide this function. [[alternative HTML version deleted]]
2010 Jul 24
1
latent class analysis with mixed variable types
As an alternative to Latent GOLD, I'm wondering if anyone knows of and R package that can manage Latent Class Analysis with mixed variable types (continuous, ordinal, and nominal/binary). [[alternative HTML version deleted]]
2009 Oct 17
2
repeating values in levels()
Can someone help me understand this results? > levels(as.factor(miset1$facts_convict)) [1] "1" "1" "2" "3" "4" "5" "6" converting to numeric and back doesn't seem to help: > levels(as.factor(as.numeric(miset1$facts_convict))) [1] "1" "1" "2" "3" "4" "5"
2008 May 19
2
recoding data with loops
# I'm new to R and am trying to get the hang of how it handles # dataframes & loops. If anyone can help me with some simple tasks, # I'd be much obliged. # First, i'd like to generate some random data in a dataframe # to efficiently illustrate what I'm up to. # let's say I have six variables as listed below (I really # have hundreds, but a few will illustrate the point). #
2009 Apr 05
1
inverting a table
Is there an easy way to invert a table? (not to solve for the inverted matrix, just swap rows for columns & vice versa). I've gone through my data manipulation bible (Phil Spector's book), but to no avail. [[alternative HTML version deleted]]
2006 Mar 23
1
RMySQL's column limit
Dear R-users, First, thank you to the developers for the very useful R-library RMySQL. While using this library a recieved an error message: RS-DBI driver: (could not run statement: Too many columns) The statement that generated the error was: dbWriteTable(dbcon, "simdataseries", template, overwrite = TRUE, row.names = FALSE ) I am assuming this is a RMySQL rather than MySQL limit.
2005 Apr 06
7
off-topic question: Latex and R in industries
Latex and R are really cool stuff. I am just wondering how they are used in industry. But based on my own experience, very rare. Why? How about the opinion of other listers? Thanks.
2003 Sep 20
1
modelling open source software
The following paper may be of interest to some. The author is generous about sharing a recently revised version. <A HREF="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=259648">http://papers.ssrn.com/sol3/papers.cfm?abstract_id=259648</A> [[alternative HTML version deleted]]
2007 Dec 03
1
difficulties getting coef() to work in some lmer() calls
I'm working with Andrew Gelman on a book project and we're having some difficulties getting coef() to work in some lmer() calls. Some versions of the model work and some do not. For example, this works (in that we can run the model and do coef() from the output): R2 <- lmer(y2 ~ factor(z.inc) + z.st.inc.full + z.st.rel.full + (1 + factor( z.inc) | st.num),
2008 Mar 10
1
Check errors using R2.6.2
I can successfully "check" a package with source under 2.5.1, including compiling source files and running examples with no errors or warnings. when I try with R2.6.2, I get make errors: making bayesmc.d from bayesmc.c make[3]:gcc-sjlj: Command not found etc. my gcc is version 3.4.2 I'm using Windows XP. Any thoughts? thanks! peter r ................................ Peter
2007 Sep 16
1
Factorial, L-moments, and overflows
Hi everyone, In the package POT, there is a function that computes the L-moments of a given sample (samlmu). However, to compute those L-moments, one needs to obtain the total number of combinations between two numbers, which, by the way, requires the use of a factorial. See, for example, Hosking (1990 , p. 113). How does the function "samlmu" in the package POT avoids overflows? I
2005 Apr 09
1
advice on crafting examples for packages
Folks- I have developed a package which I am planning on posting to CRAN. I include examples for each of the 40 or so functions in the package. However, since the examples are non-trivial and the package is using MCMC simulation methods, it takes about 20 minutes to run the complete set of examples on a 2.8 Ghz windows PC. The R process reaches a high water mark of about 100 MB of memory as
2005 Nov 10
6
Manually loading fixture data
Hi all, I''ve got some tables with fixed amounts of data in them (a "states" table, for example). For tables like this I can easily put *all* of the data in the fixture. For general futzing purposes, and for those times I want to reload a database from scratch outside of testing (for whatever reason), what''s the best approach? I thought perhaps ActiveRecord::Base had