search for: sjkiss

Displaying 20 results from an estimated 49 matches for "sjkiss".

Did you mean: kiss
2010 Oct 10
1
Create single vector after looping through multiple data frames with GREP
...r[[11]][,1]),] test<-cbind(economy, economy_2) plot(as.numeric(test), type='l') #here's another attempt I'm trying.... economy<-data.frame for (i in 15:19) { economy[i,] <-r[[i]][grep('Economy', r[[i]][,1]), ] } Begin forwarded message: > From: Simon Kiss <sjkiss at gmail.com> > Date: October 7, 2010 4:59:46 PM EDT > To: Simon Kiss <simonjkiss at yahoo.ca> > Subject: Fwd: [R] Converting scraped data > > > > Begin forwarded message: > >> From: Ethan Brown <ethancbrown at gmail.com> >> Date: October 6, 20...
2012 Nov 09
5
using lapply with recode
Hello: Forgive me, this is surely a simple question but I can't figure it out, having consulted the help archives and "Data Manipulation With R" (Spector). I have a list of 11 data frames with one common variable in each (prov). I'd like to use lapply to go through and recode one particular level of that common variable. I can get the recode to work, but it only returns the
2012 Mar 12
3
lapply to change variable names and variable values
Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation With R and the R Book and can't find an answer. Sample list of data frames looks as follows: .xx<-list(df<-data.frame(Var1=rep('Alabama', 400), Var2=rep(c(2004, 2005, 2006, 2007), 400)), df2<-data.frame(Var1=rep('Tennessee', 400), Var2=rep(c(2004,2005,2006,2007), 400)),
2010 Oct 19
2
separate elements of a character vector
Dear colleagues, this seems like an easy problem, and I found some suggestions which I've incorporated in the help list, but I can't quite get it right. I want to add a series of years to a second x-axis category label. I generate them with test and test_2 below, format them with some spacing (which is the suggestion I took from the R-list) and concatenate them and then write them with
2011 Jul 28
2
cycling from x11 window in RCommander to graphics device window: Mac Os 10.6.8
Dear Colleagues, I have recently installed R Commander on my Mac OS 10.6.8. I'd like to use it for an undergraduate class this year. Everything appears to be working fine, except for one thing. I cannot use Command-tab to cycle from the X11 window in which RCommander is running to any other window open in my workspace. This is particularly important because I cannot cycle to the graphics
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
2012 Apr 16
1
grep and XML
Hi all: I struggle a lot scraping web data. I still haven't got a handle on the XML package. I'd like to get particular exchange rates from this table: https://raw.github.com/currencybot/open-exchange-rates/master/latest.json This is the code that I'm working with: library(RCurl) library(XML)
2012 Dec 18
1
xtable with psych objects
Hello: I s there a way to use xtable with objects from the psych package, particularly principal()? Is there a difference between princomp and principal? xtable seems to play better with princomp. Thank you. Yours, Simon Kiss ********************************* Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9
2011 Jul 11
1
grep lines before or after pattern matched?
Dear colleagues, I have a series of newspaper articles in a text file, downloaded from a text file. They look as follows: Document 1 of 100 \n \n \n Newspaper Name \n \n Day Date I have a series of grep scripts that can extract the date and convert it to a date object, but I can't figure out how to grep the newspaper name. There is no field ID attached to those lines. The best I can come
2011 Mar 31
1
error in recode.defalt ....object '.data' not found
Dear colleagues, working with the data frame below, trying to reverse two variables I the error message below. i searched through the help list but could not find any postings which could help me solve the situation. I tried attaching and detaching the data frame to no avail. Yours, Simon Kiss *DATA FRAME 'data.frame': 1569 obs. of 9 variables: $ equal : num 3 4 3 2 3 4 2 3 2 2 ...
2012 Nov 20
2
Ordering List Items Chronologically
Dear colleagues, Is there a way to order list items by date? I have a series of surveys in a list where the name of each list item is the date the survey was taken but the list items are out of order. Each data frame has a variable in it with the survey date as well, if that helps. Yours, Simon Kiss #Sample Data mylist<-list('1991-01-01'=data.frame(a=rep(5,5),
2011 Jul 23
2
sum part of a vector
Dear colleagues, I have a data set that looks roughly like this; mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5), rep("California", 5)), news=runif(15, min=0, max=8), cum.news=rep(0, 15)) For each state, I'd like to cumulatively sum the value of "news" and make that put that value in cum.news. I'm trying as follows but I get
2012 Feb 14
1
txtStart creates a NULL file
Hello all: I'm trying to use the following code to get commands, comments and results to a .txt file. It only appears to capture comments. When I comment those out with #, it creates a NULL file. Someone seemed to have a similar problem with a mac GUI (https://stat.ethz.ch/pipermail/r-help/2010-September/253177.html) but the result seemed to be ambiguous. Is there a work-around?
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
2010 Jun 29
3
generate irregular series of dates
Dear colleagues, particularly academic ones, So I'm creating a Microsoft Word template for myself so that every time I teach a new course, I don't have to enter in the dates manually for each class session. I'd like to use an R script that can generate an irregular series of dates starting from one date (semester begin) to another (semester end) using an irregular interval in
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,
2010 May 27
2
help calculating variable based on factor level of another
Dear colleagues, I want to calculate the value of x2 based on the value of x1. x1 is a factor with three separate levels. I want to make sure that missing values remain as NA in X2, but non-missing values take on a value of either 0 or 1 dependending on the value in x1. This is the code I'm working with...Can any one help? I've seen some other requests on a topic like this, but not
2012 Aug 20
2
Changing line length in Sweave output works for numeric, but not for character vectors
Hi there: I'm preparing a report in RStudio 0.96.330 on a Mac OS. I'm running R 2.15.0 I understand from Ross Ihaka's document (http://www.stat.auckland.ac.nz/~stat782/downloads/Sweave-customisation.pdf) that you can modify the line length of Sweave output by a call to options(wdith=x). This works great for me for numeric output, but not for character vectors that I have to print.
2011 Nov 10
2
Listing tables together from random samples from a generated population?
. HI there, I'd like to show demonstrate how the chi-squared distribution works, so I've come up with a sample data frame of two categorical variables y<-data.frame(gender=sample(c('Male', 'Female'), size=100000, replace=TRUE, c(0.5, 0.5)), tea=sample(c('Yes', 'No'), size=100000, replace=TRUE, c(0.5, 0.5))) And I'd like to create a list of 100
2012 Nov 12
3
select different variables from a list of data frames
Hi: How do I select different variables from a list of data frames. I have a list of 13 that looks like below. Each data frame has more variables than I need. How do I go through the list and select the variables that I need. In the example below, I need to get the variables "a", and "q10" and "q14" to be returned to two separate data frames. Thank you. Yours, Simon