[R] mlogit.effects()

2015-06-17 Thread Simon Kiss
intense to select clusters. I’m trying to do this as simply as possible while remaining loyal to the ranked structure of the data. Thanks, Simon Kiss #Loadpackages library(RCurl) library(mlogit) library(tidyr) library(dplyr) #URL where data is stored dat.url- 'https

Re: [R] recode the same subset of variables in several list elements

2015-04-06 Thread Simon Kiss
On Apr 2, 2015, at 6:30 PM, Jim Lemon drjimle...@gmail.com wrote: Hi Simon, How about this? library(plotrix) revlist-grep(i,names(df),fixed=TRUE) df[,revlist]-sapply(df[,revlist],rescale,c(3,1)) Jim On Fri, Apr 3, 2015 at 6:30 AM, Simon Kiss sjk...@gmail.com mailto:sjk...@gmail.com

[R] recode the same subset of variables in several list elements

2015-04-02 Thread Simon Kiss
Hi there: I have a list of data frames with identical variable names. I’d like to reverse scale the same variables in each data.frame. I’d appreciate any one’s suggestions as to how to accomplish this. Right now, I’m working with the code at the very bottom of my sample data. Thanks, Simon

[R] basic help with as.Date()

2015-03-26 Thread Simon Kiss
Hi there: normally I’m quite comfortable with as.Date(). But this data set is causing problems. The core of the data frame looks like the sample data frame below, but my attempt to convert df$mydate to a date object returns only NA. Can anyone provide a suggestion? Thank you, Simon Kiss

[R] foreign:::writeForeignSPSS vs. write.foreign(df, datafile, codefile, package='spss')

2015-01-29 Thread Simon Kiss
that the latter actually somehow calls the former. Am I reading this wrong? Can someone explain the difference between the two functions? Thanks. Yours, Simon Kiss __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame

2014-09-05 Thread Simon Kiss
(mymelt, row~color, value.var=rank, fill=0) #Compare str(mydf) str(d2) head(mycast) head(d4) Again, I'm grateful for assistance. I can't understand what how my data-set differs from David's sample data-set. Simon Kiss On Sep 4, 2014, at 2:35 PM, David L Carlson dcarl...@tamu.edu wrote: I think we

Re: [R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame

2014-09-04 Thread Simon Kiss
4 4 42 4 0 3 1 5 53 4 2 0 1 6 64 3 2 0 1 David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Carlson Sent: Sunday, August 17, 2014 6:32 PM To: Simon Kiss

Re: [R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame

2014-08-15 Thread Simon Kiss
Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Simon Kiss Sent: Friday, July 25, 2014 2:34 PM To: r-help@r-project.org Subject: [R] Turn Rank Ordering

[R] Turn Rank Ordering Into Numerical Scores By Transposing A Data Frame

2014-07-25 Thread Simon Kiss
Hello: I have data that looks like mydf, below. It is the results of a survey where participants were to put a number of statements (in this case colours) in their order of preference. In this case, the rank number is the variable, and the factor level for each respondent is which colour they

[R] Help with polychoric correlation in psych library

2014-06-02 Thread Simon Kiss
message: In mclapply(seq_len(n), do_one, mc.preschedule = mc.preschedule, : all scheduled cores encountered errors in user code Can anyone provide any guidance? Thanks, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George

[R] escape characters for apostrophes in a .csv file

2014-04-23 Thread Simon Kiss
Hello: I have a .csv file that includes some character strings (open ended survey responses) that includes some apostrophe. Using read.csv() the file reads in just fine, except upon being read in the apostrophes are displayed with the double-slash, i.e. 'I've' becomes 'I\\'ve'. I'd like to

[R] ggplot2 counts versus percentages

2014-02-09 Thread Simon Kiss
..)/value))+facet_grid(~X2) Thank you for your assistance! Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 __ R

Re: [R] Help using mapply to run multiple models

2013-12-19 Thread Simon Kiss
. Yours, simon Kiss f - function (modelType, responseName, predictorNames, data, ..., envir = parent.frame()) { call - match.call() call$formula - formula(envir = envir, paste(responseName, sep = ~ , paste0(`, predictorNames, `, collapse

Re: [R] Help using mapply to run multiple models

2013-12-19 Thread Simon Kiss
! Yours, Simon Kiss On 2013-12-19, at 1:55 PM, Simon Kiss sjk...@gmail.com wrote: Hello Bill, that is fantastic and it's quite a bit above what I could write. Is there a way to make the model type an argument to the function so that you can specify whether one is running glm, lm and such? I tried

[R] Searching the help archives - 404 error?

2013-12-19 Thread Simon Kiss
was not found on this server. That’s all we know. Has the search engine for the help archives moved? Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9

Re: [R] Help using mapply to run multiple models

2013-12-18 Thread Simon Kiss
# combine the model coefficients into a two-column matrix do.call(rbind, lapply(modlist, coef)) You'd probably want to rename the second column since the slopes are associated with different x variables. Dennis On Tue, Dec 17, 2013 at 5:53 PM, Simon Kiss sjk...@gmail.com wrote: I

Re: [R] Help using mapply to run multiple models

2013-12-18 Thread Simon Kiss
coefficients into a two-column matrix do.call(rbind, lapply(modlist, coef)) You'd probably want to rename the second column since the slopes are associated with different x variables. Dennis On Tue, Dec 17, 2013 at 5:53 PM, Simon Kiss sjk...@gmail.com wrote: I think I'm missing

[R] Help using mapply to run multiple models

2013-12-17 Thread Simon Kiss
I think I'm missing something. I have a data frame that looks below. sample.df-data.frame(var1=rbinom(50, size=1, prob=0.5), var2=rbinom(50, size=2, prob=0.5), var3=rbinom(50, size=3, prob=0.5), var4=rbinom(50, size=2, prob=0.5), var5=rbinom(50, size=2, prob=0.5)) I'd like to run a series of

[R] Goodness of fit statistics for cfa are missing (sem package)

2013-07-09 Thread Simon Kiss
or h) are hypothesized to load on one factor uncorrelated with the second factor, coded with a c (as in cc.c.varname.c or i). I used this for guidance http://vimeo.com/38941937 Yours, Simon Kiss #Load Libraries library(sem) #Create Covariance Matrix ff.cov - structure(c(0.0925407885304659

[R] Psych package: Error in biplot.psych(sample.mod) : Biplot requires factor/component scores:

2013-06-25 Thread Simon Kiss
the help documentation, that one really only has to use the command biplot(mod) to get the plot. Can someone please advise? Yours, Simon Kiss #Sample data sample.data-data.frame(var1=sample(c(0,0.33, 0.66, 1), size=100, replace=TRUE), var2=sample(c(0,0.33, 0.66, 1), size=100, replace=TRUE), var3

[R] Adding time series to time graphs

2013-04-11 Thread Simon Kiss
in a line plot on a graph where the x-axis is a series of dates twice as long as the time series itself? The reason I'd like this is because I'd like to add a couple of other story time series as well. They may appear at other points in time in the campaign as well. Thanks. Simon Kiss

[R] latex(test, collabel=) returns wrong latex code?

2013-03-15 Thread Simon Kiss
Hello: I'm working with a 2-dimensional table that looks sort of like test below. I'm trying to produce latex code that will add dimension names for both the rows and the columns. In using the following code, latex chokes when I include collabel='Vote' but it's fine without it. The code below

[R] Reading outdated .Rprofile file

2013-03-05 Thread Simon Kiss
Hi there: I'm having a weird problem with my startup procedure. R.app is reading an unknown .Rprofile file. First, I'm on a Mac Os 10.6.8 running R.app 2.15.0 On startup getwd() [1] /Users/simon But: the contents of my .Rprofile file in my home directory when viewed with a text editor are:

[R] Help with multiple barplots

2013-01-31 Thread Simon Kiss
Hello: I need to create a six barplots from data that looks pretty close to what appears below. There are two grouping variables (age and gender) and three dependent variables for each grouping variables. I'm not really familiar with trellis graphics, perhaps there is something that can do

[R] Function failure in tm

2013-01-15 Thread Simon Kiss
NULL I haven't seen this error reported anywhere in the R-list archives. Does anyone have any suggestions? Yours, Simon Kiss P.S. The results of sessionInfo() are R version 2.15.0 (2012-03-30) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C

[R] tm: custom reader for readPlain

2013-01-08 Thread Simon Kiss
to someone unfamiliar with the tm package as to how to go about creating a custom reader for this situation? Yours truly, Simon Kiss Document 1 of 40 First Nation agrees not to block trains Author: SHAWN BERRY Legislature Bureau

Re: [R] tm: custom reader for readPlain

2013-01-08 Thread Simon Kiss
, at 4:44 PM, Milan Bouchet-Valat wrote: Le mardi 08 janvier 2013 à 15:56 -0500, Simon Kiss a écrit : Hello: I have a series of newspaper articles from a Canadian newspaper database (Canadian Newsstand) that look just like below. I've read through this vignette (http://cran.r-project.org/web

[R] xtable with psych objects

2012-12-18 Thread Simon Kiss
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

[R] Changing Variable Names In VCD

2012-12-18 Thread Simon Kiss
something like: mosaic(~var1+var2, labelling_args=list(varnames=c('newvar1', 'newvar2')) Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada __ R-help@r

[R] Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!

2012-12-10 Thread Simon Kiss
. Calling summary(mod1) on the real data does return information about the coefficients and the model fitting. I'm grateful for any help. I'm aware that the topic of non-integer successes has been addressed before, but I could not find my answer to this question. Yours, Simon Kiss ##str

[R] Ordering List Items Chronologically

2012-11-20 Thread Simon Kiss
, Simon Kiss #Sample Data mylist-list('1991-01-01'=data.frame(a=rep(5,5), survey.date=rep(as.Date('1991-01-01', format='%Y-%m-%d'))), '1979-01-01'=data.frame(aa=rep(5,5), survey.date=rep(as.Date('1979-01-01', format='%Y-%m-%d'), 5)), '2001-01-01'=data.frame(c=rep(6,5), survey.date=rep(as.Date('2001-01

[R] select different variables from a list of data frames

2012-11-12 Thread Simon Kiss
to be returned to two separate data frames. Thank you. Yours, Simon Kiss #Sample data mylist-list(df1=data.frame(a=seq(1,10,1), c=seq(1,109,1), q10=rep('favour', 10)), df2=data.frame(a=seq(1,10,1), b=seq(15,24,1), q14=rep('favour', 10))) #The variables with different names that I need

[R] using lapply with recode

2012-11-08 Thread Simon Kiss
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

[R] Combine two variables

2012-09-11 Thread Simon Kiss
),replace=TRUE, size=100), var2=sample(c('a','b','c',NA),replace=TRUE,size=100)) df-subset(df, !is.na(var1) |!is.na(var2)) As you can see, if one variable has an NA, then the other variable has a valid value, so how do I just combine the two variables into one? Thank you for your assistance. Simon

Re: [R] Changing line length in Sweave output works for numeric, but not for character vectors

2012-08-21 Thread Simon Kiss
, 2012 at 5:03 PM, Simon Kiss sjk...@gmail.com wrote: 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

[R] Changing line length in Sweave output works for numeric, but not for character vectors

2012-08-20 Thread Simon Kiss
). This works great for me for numeric output, but not for character vectors that I have to print. The following is some sample code that illustrates my problem. Is there a different way to format character vectors that are stored in R? Yours, Simon Kiss \documentclass{article} \begin{document

[R] Rcurl, postForm()

2012-05-28 Thread Simon Kiss
the web for tutorials, but I can't crack it. I'm aware that this is probably a pretty basic question, but I need some help regardless. Yours, Simon Kiss library(XML) library(RCurl) library(scrapeR) library(RHTMLForms) #Set URL bus-c('http://www.brantford.ca/business/LocalBusinessCommunity/Pages

[R] Using xpathapply or getnodeset to get text between two distinct tags

2012-05-11 Thread Simon Kiss
Hello: The following code extracts the links to the daily transcripts of Canada's House Of Commons. 'links' is a matrix of URLs (ncol=1), each of which points to one day's transcripts. If you inspect the code for scrape(links[1]), you will find that periodically there appears an italicitze

[R] adding a caption to a mosaic plot?

2012-05-02 Thread Simon Kiss
Dear all: Is there a way to add text to the margins or outer margins of a mosaic plot using the vcd package? I understand the margins argument to mosaic, but I don't know how to add text to that. I'd like to add a caption to a plot. If possible, I'd like to know how to set the font and size

[R] Use scores from factor analysis and missing values factanal(), napredict(), na.omit()

2012-04-26 Thread Simon Kiss
Dear all, I have a series of variables that looks roughly like the sample data below and I'm trying to conduct a factor analysis. I've omitted cases with missing values for the factor analysis, but now I'd like to use the scores on each component as new variables in the *original* data set for

[R] grep and XML

2012-04-16 Thread Simon Kiss
, Simon KIss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] lapply to change variable names and variable values

2012-03-12 Thread Simon Kiss
names? I'm grateful for your suggestions! Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606 __ R-help@r-project.org

Re: [R] lapply to change variable names and variable values

2012-03-12 Thread Simon Kiss
Thanks both! That solves ! You've made a very happy newbie! Simon On 2012-03-12, at 2:52 PM, Sarah Goslee wrote: Hi Simon, On Mon, Mar 12, 2012 at 2:37 PM, Simon Kiss sjk...@gmail.com wrote: Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation With R and the R Book

[R] txtStart creates a NULL file

2012-02-14 Thread Simon Kiss
/2010-September/253177.html) but the result seemed to be ambiguous. Is there a work-around? Reproducible code and sessioninfo are below. The OS is Mac OS 10.6.8. Yours truly, Simon Kiss install.packages(HSAUR) library(HSAUR) library(TeachingDemos) data(Forbes2000, package=HSAUR) #This is a test

[R] (no subject)

2011-11-11 Thread Simon Kiss
and individual specific variables are? Yours, Simon Kiss l * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606 __ R-help@r-project.org

[R] Listing tables together from random samples from a generated population?

2011-11-10 Thread Simon Kiss
(table(.y[sample(nrow(.y), 200), ]))$statistic) } hist(.z, xlab='Chi-Square Value', main=Chi-Squared Values From 100 different samples asking\nabout gender and tea/coffee drinking) abline(v=3.84, lty=2) Thank you in advance, Simon Kiss * Simon J. Kiss, PhD

[R] Help combining cell labelling and multiple mosaic plots

2011-10-31 Thread Simon Kiss
Dear colleagues I'm using data that looks like .test and .test1 below to draw two mosaic plots with cell labelling (the row percentages from the tables). When I take out the pop=FALSE commands in the mosaic commands and comment out the two lines labelling the cells, then the plots are laid out

[R] (no subject)

2011-10-31 Thread Simon Kiss
Dear colleagues I'm using data that looks like .test and .test1 below to draw two mosaic plots with cell labelling (the row percentages from the tables). When I take out the pop=FALSE commands in the mosaic commands and comment out the two lines labelling the cells, then the plots are laid out

[R] htmlParse hangs or crashes

2011-09-05 Thread Simon Kiss
appears to work just fine, although it doesn't appear to contain the information I need (the URLs of the articles linked to on this search page). Regardless, I'd still like to understand why htmlParse doesn't work. Thank you for any insight. Yours, Simon Kiss myurl-c(http

[R] R hangs after htmlTreeParse

2011-08-25 Thread Simon Kiss
option. I'm running R 2.13 on Mac os 10.6 and the latest versions of XML and RCURL are installed. Yours, Simon Kiss __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] Comparison of means in survey package

2011-08-18 Thread Simon Kiss
be a way just to do the comparison of means test between two subgroups of a factor, and not just on all factor levels? Using 2.13 on mac os 10.6 and the latest version of survey package. Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier

[R] Applyin Weights In RCommander

2011-08-12 Thread Simon Kiss
statistics as well, in R Commander. Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606 __ R-help@r-project.org mailing

[R] Apostrophes in R Commander in recode

2011-07-29 Thread Simon Kiss
to in that instance. Is there a solution within R Commander? Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606 __ R-help

[R] cycling from x11 window in RCommander to graphics device window: Mac Os 10.6.8

2011-07-28 Thread Simon Kiss
can imagine, this is quite laborious, having to restart. I've looked through the help documentation and tried reinstalling tcltk prior to opening up Rcommander, but that does not address the problem. Any thoughts? Yours, Simon Kiss * Simon J. Kiss, PhD Assistant

Re: [R] cycling from x11 window in RCommander to graphics device window: Mac Os 10.6.8

2011-07-28 Thread Simon Kiss
John Fox Sen. William McMaster Prof. of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ On Thu, 28 Jul 2011 13:40:11 -0400 Simon Kiss sjk...@gmail.com wrote: Dear Colleagues, I have recently installed R Commander on my

[R] sum part of a vector

2011-07-23 Thread Simon Kiss
when working on a test string test-1:10 sapply(test, function(x) sum(1:x)) Any thoughts? Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606

[R] grep lines before or after pattern matched?

2011-07-11 Thread Simon Kiss
, but I don't know if there is an equivalent argument in R. Any thoughts. Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada N3T 2C9 Cell: +1 905 746 7606

Re: [R] grep lines before or after pattern matched?

2011-07-11 Thread Simon Kiss
Name \n \n Day Date, file = clipboard) ## read data in, and only select the 4th line to pass to grep() grep(pattern, x = readLines(clipboard)[4]) On Mon, Jul 11, 2011 at 9:31 AM, Simon Kiss sjk...@gmail.com wrote: Dear colleagues, I have a series of newspaper articles in a text file

Re: [R] grep lines before or after pattern matched?

2011-07-11 Thread Simon Kiss
:) On Mon, Jul 11, 2011 at 10:25 AM, Simon Kiss sjk...@gmail.com wrote: Hi Josh, Sorry for the insufficient introduction. This might work, but I'm not sure. The file that I have includes up to 100 documents (Document 1, Document 2, Document 3Document 100) with the newspaper name following 4

[R] error message trying to plot survival curves from hypothetical covariate profiles

2011-06-14 Thread Simon Kiss
Dear colleagues, following John Fox' advice in this article (http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf), I'm trying to create a new data frame to examine the differential survival curves from a combination of covariates. These are derived from a Cox

[R] indexing list elements with lapply?

2011-04-22 Thread Simon Kiss
for any suggestions. Yours, Simon Kiss **dataset ff-runif(10, 0.85, 1) ff-cbind(ff, 1-ff) gg-runif(10, 0.85, 1) gg-cbind(gg, 1-ff) hh-runif(10, 0.86, 1) hh-cbind(hh, 1-hh) ii-runif(10, 0.92, 1) ii-cbind(ii, 1-ii) jj-runif(10,0.76, 1) jj-cbind(jj, 1-jj) r-list(ff, gg, hh,ii, jj

[R] error in recode.defalt ....object '.data' not found

2011-03-31 Thread Simon Kiss
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

[R] sampling design runs with no errors but returns empty data set

2011-03-30 Thread Simon Kiss
(weight_test) contains no What am I missing? Yours, Simon Kiss P.S. The code is only reproducible if the data set is downloadable. I'm nt sure ces-read.spss(file.choose(), to.data.frame=TRUE, use.value.labels=FALSE) missing_data-subset(ces1, !is.na(ces08_NATWGT)) weight_test-svydesign(id=~0

[R] baseline hazard function

2011-01-26 Thread Simon Kiss
of minimization points ... 51 Number of estimation points . 101 Pilot Bandwidth . 0.25 Smoothing Bandwidth . 1.27 Minimum IMSE 6716.9 Can anyone provide any advice? Yours, Simon Kiss 'data.frame': 147 obs. of 7 variables: $ state : Factor w/ 50

[R] subsetting based on joint values of critera

2011-01-25 Thread Simon Kiss
of values of two variables? Yours, Simon Kiss str(bpa) 'data.frame': 150 obs. of 5 variables: $ State : Factor w/ 50 levels Alabama,Alaska,..: 1 2 3 4 5 6 7 8 9 10 ... $ year: num 2008 2008 2008 2008 2008 ... $ ban : num 0 0 0 0 0 0 0 0 0 0 ... $ partisan: Factor w/ 3 levels

[R] Counting dates in arbitrary ranges

2011-01-18 Thread Simon Kiss
arbitrary ranges. I also tried converting the dates to numeric and using histogram to try to get the data, but that doesn't work either. Cut appears to accept an arbitrary range, but I could only get it to produce NAs. Any suggestions? Yours, Simon Kiss mydata-list(x=seq(as.Date(2007-05-01), as.Date

[R] Importing multiple text files with lapply.

2011-01-17 Thread Simon Kiss
) : element 1 is empty; the part of the args list of 'is.character' being evaluated was: (file) Does anyone have any suggestions? Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario, Canada

Re: [R] Importing multiple text files with lapply.

2011-01-17 Thread Simon Kiss
the data look like? On Mon, Jan 17, 2011 at 11:47 AM, Simon Kiss simonjk...@yahoo.ca wrote: Hello, I'm trying to read in 50 text filess with dates as content to create a list of tables. a is the list of filenames that need to be read in. The following command returns the following

Re: [R] Importing multiple text files with lapply.

2011-01-17 Thread Simon Kiss
readLines worked great Jim, thanks! Simon Kiss On 2011-01-17, at 7:44 PM, jim holtman wrote: It sounds like you want to use 'readLines' and not 'read.table' x - readLines(textConnection(January 11, 2009 + January 11, 2009 + October 19, 2008 + October 13, 2008 + August 16, 2008 + June 19

Re: [R] Importing multiple text files with lapply.

2011-01-17 Thread Simon Kiss
and see if I can get it to loop through. Yours, Simon Kiss On 2011-01-17, at 7:44 PM, jim holtman wrote: It sounds like you want to use 'readLines' and not 'read.table' x - readLines(textConnection(January 11, 2009 + January 11, 2009 + October 19, 2008 + October 13, 2008 + August 16, 2008

[R] 45 Degree labels on barplot? Help understanding code previously posted.

2010-12-10 Thread Simon Kiss
. Is it necessary to create a new object via barplot and then quote that in the x,y coordinates of text? Like I said, the code works great, but I'm trying to actually understand the rationale behind the elements so I can apply it in future. Yours, Simon Kiss #Reproducible Code mydat-data.frame

[R] separate elements of a character vector

2010-10-19 Thread Simon Kiss
, Simon Kiss x1-rnorm(500) plot(x1) test-seq(1987, 2002, by=1) test_2-seq(2003, 2006, by=1) test-format(c(test, test_2), width=5) mtext(test, side=1, line=2) * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Street Brantford, Ontario

Re: [R] Create single vector after looping through multiple data frames with GREP

2010-10-10 Thread Simon Kiss
the numbers for one year, where I'd like to be able to get a string of numbers for several years.But, on the upside, grep appears to do the trick in terms of selecting rows. Can any one suggest a solution? Yours truly, Simon Kiss #This is the reproducible code to set-up all the data frames

[R] Converting scraped data

2010-10-06 Thread Simon Kiss
. I also tried this: as.numeric(as.character(test[16,c(2:5)] and that also changed the values from what they originally were. I'm grateful for any suggestions. Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George

[R] group means of multi-way table?

2010-09-21 Thread Simon Kiss
the mean score of z for NDP managers, Conservative managers and Liberal managers and then for a few other configurations. Ive played around with aggregate, tapply and by, but I can't get it to work. Cordially, Simon Kiss mydata=data.frame(cbind(x,y,z)) mydata$x=as.factor(sample(c(labourers

[R] Grouping and stacking bar plot for categorical variables

2010-07-19 Thread Simon Kiss
? Yours, Simon Kiss * Simon J. Kiss, PhD SSHRC and DAAD Post-Doctoral Fellow John F. Kennedy Institute of North America Studies Free University of Berlin Lansstraße 7-9 14195 Berlin, Germany Cell: +49 (0)1525-300-2812, Web: http://www.jfki.fu-berlin.de/index.html

Re: [R] generate irregular series of dates

2010-07-01 Thread Simon Kiss
, row.names=FALSE) Thanks a lot. Simon Kiss On 29-Jun-10, at 9:21 PM, Gabor Grothendieck wrote: On Tue, Jun 29, 2010 at 6:22 AM, Simon Kiss sjk...@gmail.com wrote: Dear colleagues, particularly academic ones, So I'm creating a Microsoft Word template for myself so that every time I teach a new

[R] generate irregular series of dates

2010-06-29 Thread Simon Kiss
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

[R] Stacked Histogram, multiple lines for dates of news stories?

2010-06-28 Thread Simon Kiss
Dear colleagues, I have extracted the dates of several news stories from a newspaper data base to chart coverage trends of an issue over time. They are in a data frame that looks just like one generated by the reproducible code below. I can already generate a histogram of the dates with

[R] Comparing a 4-point and 5-point Likert scale

2010-06-03 Thread Simon Kiss
that are either 5, 10, 15 or 20. My idea is then to add the two, average them and use that value as an index of economic egalitarianism? Yes / no? Suggestions? I am an R user and I hope that a purely statistical question is not especially misplaced. Yours truly, Simon Kiss

[R] help calculating variable based on factor level of another

2010-05-27 Thread Simon Kiss
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

[R] Compressed values on y-axis in effects plot

2010-05-20 Thread Simon Kiss
. I've looked through; all the variables included in the two models are identical save for the DV. And the DV's in both models are ordered factors. Is any one familiar with this problem in effects plots? Yours, Simon Kiss quartz() jpeg(filename=test.jpeg, type=c(quartz)) plot(effect

Re: [R] Finding different hues for a mosaic plot compatible with grayscale printing

2010-05-13 Thread Simon Kiss
, labeling=labeling_values(value_type=c(residuals), suppress=0) then I do get the residuals printed, but the labels are unattractive. How do I combine labeling_borders and labeling_values commands in one command. Yours, Simon Kiss On 12-May-10, at 2:42 PM, Jim Lemon wrote: On 05/12

[R] Finding different hues for a mosaic plot compatible with grayscale printing

2010-05-12 Thread Simon Kiss
I'm working with the following code below to generate a how do I set the h,c, and l values such that the significant, positive residuals appear different on a grayscale printer from significant grayscale residuals. The challenge as I see it is that one can only distinguish the positive and

[R] NULL variable read in from SPS

2010-04-27 Thread Simon Kiss
Hello all, I'm having difficulty getting one particular variable into R from SPSS v. 16.0 for mac. R version is 2.10.1. I saved the relevant variables from SPSS into a .csv file and then read them into R. All the variables worked fine, except for one (enviro_spending). In the SPSS file

[R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in c(0

2010-04-14 Thread Simon Kiss
data set, but get precisely the same error at precisely the same location in the command, i.e. the second colon. As far as I can tell I have the most up-to-date version of car installed. Any suggestions? Yours, Simon Kiss * Simon J. Kiss, PhD SSHRC and DAAD

[R] Summing a series made up of part of a vector

2010-04-07 Thread Simon Kiss
like this. x5 1 4.2 2 7.8 (4.2 +3.6) 3 10.5 (4.2+3.6+2.7) 308 =na So the last number in the vector x5 should be 100, as these are all percentages. Any suggestions? Yours truly, simon Kiss * Simon J. Kiss, PhD SSHRC and DAAD Post-Doctoral Fellow John F

[R] row names in regression results and saving the identification results from added variable plots

2010-03-26 Thread Simon Kiss
because av.plots brings up an interactive menu that does not appear to allow for that. If any one can help, it would be appreciated! Yours, Simon Kiss * Simon J. Kiss, PhD SSHRC and DAAD Post-Doctoral Fellow John F. Kennedy Institute of North America Studies Free

[R] R Full Screen

2010-03-24 Thread Simon Kiss
screen; I'd like to make them full screen to identify points in a dense scatterplot. Thank you for any suggestions. Yours, Simon Kiss * Simon J. Kiss, PhD SSHRC and DAAD Post-Doctoral Fellow John F. Kennedy Institute of North America Studies Free University of Berlin