[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<- &#x

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 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, S

[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
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
at d4 appears to provide a binary variable for one if a respondent checked the option, but does not provide information as to which rank they assigned each option, but also seems to summarize the number of missing values #David Carlson's Code mydf <- data.frame(t(replicate(100, sample(c(&

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

2014-09-04 Thread Simon Kiss
1 3 > 3 33 2 0 1 4 > 4 4 2 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

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

2014-08-15 Thread Simon Kiss
df2) > blue green red yellow > 14 2 3 1 > 22 1 4 3 > 34 1 3 2 > 44 3 2 1 > 54 3 2 1 > 63 4 2 1 > > - > David L Carlson > Department of Anthropology > Texas A&

[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 a

[R] Help with polychoric correlation in psych library

2014-06-02 Thread Simon Kiss
r of response alternatives, global set to FALSE Error in poly[1, ] : incorrect number of dimensions In addition: Warning 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

[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 pri

[R] ggplot2 counts versus percentages

2014-02-09 Thread Simon Kiss
at='identity', aes(y=value/(..sum..)/value))+facet_grid(~X2) Thank you for your assistance! Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier University 73 George Stre

[R] Searching the help archives - 404 error?

2013-12-19 Thread Simon Kiss
sa=Google+Search 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, Canad

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

2013-12-19 Thread Simon Kiss
2: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : extra argument ‘modelType’ is disregarded. 3: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : extra argument ‘modelType’ is disregarded. But again, it actually looks like it worked. So, thank you very much

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

2013-12-19 Thread Simon Kiss
27;t work. Yours, simon Kiss > f <- function (modelType, responseName, predictorNames, data, ..., envir = > parent.frame()) >{ >call <- match.call() >call$formula <- formula(envir = envir, paste(responseName, sep = " ~ ", >

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

2013-12-18 Thread Simon Kiss
) > > To give you an idea of some of the things you can do with the list: > > sapply(modlist, class)# return class of each component > lapply(modlist, summary) # return the summary of each model > > # combine the model coefficients into a two-column matrix > do.c

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

2013-12-18 Thread Simon Kiss
; > 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 wrote: >> I think I'm missing something. I have a data frame that looks below. >>

[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] ggplot2 percentages of subpopulations

2013-09-10 Thread Simon Kiss
s), rather than as a percentage of *all* the responses. Can someone provide a suggestion? Thank you Yours, Simon Kiss #Sample Code sample.dat<-data.frame(response.category=rep(c('A', 'B','C'), 2), value=c(50,25,25, 25,25,25), pop=c(rep('Males', 3), rep(

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

2013-07-09 Thread Simon Kiss
cc.h.varname.e 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(

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

2013-06-25 Thread Simon Kiss
from 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

[R] Adding time series to time graphs

2013-04-11 Thread Simon Kiss
o I overlay the frequency of newspaper stories 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

[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 pr

[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 what

[R] Function failure in tm

2013-01-15 Thread Simon Kiss
r in UseMethod("stripWhitespace", x) : no applicable method for 'stripWhitespace' applied to an object of class "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 resu

Re: [R] tm: custom reader for readPlain

2013-01-08 Thread Simon Kiss
8, 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 r

[R] tm: custom reader for readPlain

2013-01-08 Thread Simon Kiss
ome suggestions 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 Leg

[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] 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] Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!

2012-12-10 Thread Simon Kiss
data, you only get the warning. 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 ques

[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)), &#x

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

2012-11-12 Thread Simon Kiss
"q10" and "q14" 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

[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 leve

[R] Combine two variables

2012-09-11 Thread Simon Kiss
o how do I just combine the two variables into one? Thank you for your assistance. 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/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

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

2012-08-21 Thread Simon Kiss
tistics, Iowa State University > 2215 Snedecor Hall, Ames, IA > > > On Mon, Aug 20, 2012 at 5:03 PM, Simon Kiss 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&#

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

2012-08-20 Thread Simon Kiss
wdith=x). 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}

[R] Rcurl, postForm()

2012-05-28 Thread Simon Kiss
d 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/Local

[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 t

[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 fo

[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
I get: integer(0) Can anyone suggest a way forward? 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] 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 wrote: >> Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation >

[R] lapply to change variable names and variable values

2012-03-12 Thread Simon Kiss
;) just changes the actual list of data frames to a list of the character string ('State' and 'Year') How do I actually change the underlying variable names? I'm grateful for your suggestions! Simon Kiss * Simon J. Kiss, PhD Assistant

[R] txtStart creates a NULL file

2012-02-14 Thread Simon Kiss
-help/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",

[R] (no subject)

2011-11-11 Thread Simon Kiss
c 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-projec

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

2011-11-10 Thread Simon Kiss
for demonstration's sake. .z<-vector() for (i in 1:100) { .z<-c(.z, chisq.test(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

[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 e

[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 e

[R] htmlParse hangs or crashes

2011-09-05 Thread Simon Kiss
lTreeParse 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, Si

[R] R hangs after htmlTreeParse

2011-08-25 Thread Simon Kiss
t=T) This prints approximately 15 lines of the output from the html document and then mysteriously stops. The command line prompt does not reappear and force quit is the only 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] Comparison of means in survey package

2011-08-18 Thread Simon Kiss
timates: difference in mean 38.80387 This is from my data, not the code above. Would there also 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 pack

[R] Applyin Weights In RCommander

2011-08-12 Thread Simon Kiss
ptive 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 ma

[R] Apostrophes in R Commander in recode

2011-07-29 Thread Simon Kiss
original .sav file in PASW and hunt down what the underlying factor levels refer to in that instance. Is there a solution within R Commander? Yours, Simon Kiss * Simon J. Kiss, PhD Assistant Professor, Wilfrid Laurier

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

2011-07-28 Thread Simon Kiss
.5.5-x11. > > I hope this helps, > John > > > 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 -0

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

2011-07-28 Thread Simon Kiss
s you 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

[R] sum part of a vector

2011-07-23 Thread Simon Kiss
sum(1:x)) } I can sort of get the same sapply function to do what I want 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

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

2011-07-11 Thread Simon Kiss
er each line where Document occurred. No > loop needed :) > > On Mon, Jul 11, 2011 at 10:25 AM, Simon Kiss 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,

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

2011-07-11 Thread Simon Kiss
ur data to clipboard > cat("Document 1 of 100 \n \n \n Newspaper 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,

[R] grep lines before or after pattern matched?

2011-07-11 Thread Simon Kiss
#x27;pattern' infile>outfile, 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, Can

[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 Proport

[R] indexing list elements with lapply?

2011-04-22 Thread Simon Kiss
. I'm grateful 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

[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
data frame (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_

[R] baseline hazard function

2011-01-26 Thread Simon Kiss
1 Maximum Time 3 Number 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.fram

[R] subsetting based on joint values of critera

2011-01-25 Thread Simon Kiss
t to return a dataset based on the joint occurrence 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

[R] Counting dates in arbitrary ranges

2011-01-18 Thread Simon Kiss
ccept 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("200

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

2011-01-17 Thread Simon Kiss
l try readLines 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,

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,

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

2011-01-17 Thread Simon Kiss
or really '\n' meaning a new-line? What exactly > does the data look like? > > On Mon, Jan 17, 2011 at 11:47 AM, Simon Kiss wrote: >> Hello, >> I'm trying to read in 50 text filess with dates as content to create a list >> of tables. >> >>

[R] Importing multiple text files with lapply.

2011-01-17 Thread Simon Kiss
header = TRUE, sep = "\n") : 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 Universi

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

2010-12-10 Thread Simon Kiss
#x27;t work; all the labels got bunched up on the left. 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

[R] separate elements of a character vector

2010-10-19 Thread Simon Kiss
aced x-labels? Yours, 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 Unive

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

2010-10-10 Thread Simon Kiss
plotable format. It only partially works. I can only get 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

[R] Converting scraped data

2010-10-06 Thread Simon Kiss
ng from character to numeric but can't find a solution. 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. Kis

[R] group means of multi-way table?

2010-09-21 Thread Simon Kiss
#x27;d like to find out 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

[R] Grouping and stacking bar plot for categorical variables

2010-07-19 Thread Simon Kiss
p class category. Within each class category I would like a cluster of stacked bars that show the distribution of spending support for each issue. Can anyone suggest something? Yours, Simon Kiss * Simon J. Kiss, PhD SSHRC and DAAD Post-Doctoral Fellow J

Re: [R] generate irregular series of dates

2010-07-01 Thread Simon Kiss
te.table(a, "INSERT FILE LOCATION WHERE YOU WISH TO SAVE DATES", quote=FALSE, col.names=FALSE, 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 wrote: Dear colleagues, particularly academic ones,

[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 f

[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 vari

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

2010-06-03 Thread Simon Kiss
stion by five to get responses 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. You

[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 wo

[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(&q

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

2010-05-13 Thread Simon Kiss
take out the labeling_borders commands and insert the following, >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.

[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
ed it with a second numerical variable in the same 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 *

[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
ar) as you can with other standard plots 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. Ke

[R] R Full Screen

2010-03-24 Thread Simon Kiss
the monitor's 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