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<-
> 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
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
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
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
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(&
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
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&
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 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
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
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
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
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
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 = " ~ ",
>
)
>
> 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
;
> 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.
>>
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
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(
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(
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
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
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
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
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 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
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
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
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
___
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
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
, 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)),
"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
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
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.
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
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}
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
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
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
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
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
__
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
>
;)
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
-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",
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
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
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
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
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
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
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
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
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
.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
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
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
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,
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,
#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
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
. 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
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 (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_
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
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
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
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,
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,
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.
>>
>>
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
#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
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
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
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
#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
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
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,
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
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
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
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
.
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
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.
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
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
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
*
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
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
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
90 matches
Mail list logo