Re: [R] Find maxima of a function

2017-08-26 Thread David Winsemius
") > x2 <- seq(1, max(x), 0.1) > y2 <- fun(x2) > plot(x, y, type = "l") > lines(x2, y2, col = "red") > > max.x <- optimize(fun, interval = range(x), maximum = TRUE) > print(max.x) # x coordinate of global maximum of y by spline and optimize > x[which(y == max(y))] # global maximum of dicrete x-y ve

Re: [R] help with read.csv() for files with different number of columns

2017-08-29 Thread David Winsemius
c Foxc18Sox10 >>>>> Smarca2 9 1810019D21Rik%%% Asb8 >>>>> 10 1810037I17Rik%%%Zfp612 11 >>>>> 1810055G02Rik%%% >>>>> Nkx2-3 Maged1 Runx1Ugp212Elk4

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread David Winsemius
ow can I convert the numbers which are stored as characters to numeric? Have you tried using the formatting features of Excel to change the default "auto" sttings of black columns? You could select an entire column and set its format to numeric. I know this sometimes fixes the annoyin

Re: [R] correlation between nominal and ordinal

2017-09-03 Thread David Winsemius
> On Sep 2, 2017, at 3:41 AM, Jim Lemon wrote: > > hi merlin, > Check out the hetcor package. I found a hetcor function in the polycor package. Another method might be to use the lrm function in the rms package. It supports proportional odds ordinal logistic regression models. -- David.

Re: [R] Interesting behavior of lm() with small, problematic data sets

2017-09-05 Thread David Winsemius
> On Sep 5, 2017, at 6:24 AM, Glover, Tim wrote: > > I've recently come across the following results reported from the lm() > function when applied to a particular type of admittedly difficult data. > When working with > small data sets (for instance 3 points) with the same response for diffe

Re: [R] Geom_smooth

2017-09-07 Thread David Winsemius
quot;) mean +/- 2* similarly localized standard error of the estimate. To find out what the base R version of loess does consult `?predict.loess` and to find out what `geom_smooth` does, you can try to find documentation on the `predictdf` fucntion, but the geom_smooth help pages warns you it

Re: [R] ISO3 code to 7 continents names

2017-09-07 Thread David Winsemius
re, see > 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. David Winsemius Alameda, CA, USA 'Any techno

Re: [R] ISO3 code to 7 continents names

2017-09-07 Thread David Winsemius
region [1] "Latin America and Caribbe" "South Asia""Europe" [4] "Europe" "Central and Eastern Europ" "North America" -- David. > > Sincerely, > > Milu > > On

Re: [R] ISO3 code to 7 continents names

2017-09-08 Thread David Winsemius
> On Sep 7, 2017, at 12:56 PM, David Winsemius wrote: > > >> On Sep 7, 2017, at 12:21 PM, Miluji Sb wrote: >> >> df is a data frame consisting of one variable (iso3 codes) such as >> >> USA >> RUS >> ARG >> BGD >> ITA >>

Re: [R] quote()/eval() question

2017-09-08 Thread David Winsemius
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. David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insuf

Re: [R] list subselect by name ?

2017-09-09 Thread David Winsemius
quot; "L" "M" "N" "O" "P" "Q" "R" > "S" > [20] "T" "U" "V" "W" "X" "Y" "Z" > >> str( list(letters=letters, LETTERS=LETTERS)?

Re: [R] Case statement in sqldf

2017-09-11 Thread David Winsemius
Peter Makananisa (0005786) > South African Revenue Service (SARS) > Specialist: Statistical Support > TCEI_OR (Head Office) > Tell: +272 422 7357, Cell: +2782 456 4669 > > Please Note: This email and its contents are subject to our email legal > notice which can be viewed at

Re: [R] Help understanding why glm and lrm.fit runs with my data, but lrm does not

2017-09-14 Thread David Winsemius
' in the Value section. -- David. > > Kind regards, > Laura > > Dr Laura Bonnett > NIHR Post-Doctoral Fellow > > Department of Biostatistics, > Waterhouse Building, Block F, > 1-5 Brownlow Street, > University of Liverpool, > Liverpool, > L69 3GL

Re: [R] help matching rows of a data frame

2017-09-18 Thread David Winsemius
,2,1,1,3,1)) apply(x, 1, paste, collapse=".") [1] "A.1" "B.2" "C.1" "C.1" "D.3" "A.1" > The result does not have to be fast: the data set will have < 100 elements. > Since this is inside the survival package, and

Re: [R] Help/information required

2017-09-18 Thread David Winsemius
.org/search/?q=list%3Aorg.r-project.r-help+memory+limitations+windows -- David. > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mail

Re: [R] pheatmap: incomplete figure

2017-09-18 Thread David Winsemius
If not, how do I get the left end of the graph. > Why not define a graphics device that is wider? -- David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law __

Re: [R] Network meta-analysis help

2017-09-19 Thread David Winsemius
; I really need to finish this analysis. I think that if you read the Posting Guide you will find that your question is rather off-topic for rhelp. I think it may be more on-topic at https://crossvalidated.com/ > > Sorry for any inconvenience. -- David Winsemius Alameda, CA, U

Re: [R] Keep on getting message errors when trying to install and load packages 2

2017-09-20 Thread David Winsemius
do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's

Re: [R] "XLConnect" packages; Excel dates read incorrectly

2017-09-23 Thread David Winsemius
;2004-01-27" "2004-01-28" "2004-01-29" "2004-02-01" >>>> >>> >>> >>> Thanks!! >>> __ >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>

Re: [R] Help on adding a negative binomial density plot

2017-10-02 Thread David Winsemius
see > 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. David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficien

Re: [R] Help on adding a negative binomial density plot

2017-10-03 Thread David Winsemius
dership. > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html -- David. > > Thanks, > > David > De: David Winsemius > Enviado: lunes, 2 de octubre de 2017 18:18:36 > Para: David > Cc: R-help > Asunto: Re: [R] Help on adding a negat

Re: [R] Issue calling MICE package

2017-10-05 Thread David Winsemius
ilman/listinfo/r-help >>> PLEASE do read the posting guide http://www.R-project.org/posti >> ng-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >> >> -- >> Peter Dalgaard, Professor, >> Center for Statistics,

Re: [R] Help in R package

2017-10-06 Thread David Winsemius
g forward to hear from you. > > Akram > ______ David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law _

Re: [R] Adjusted survival curves

2017-10-06 Thread David Winsemius
hen ERROR > treat <- with(colon, > data.frame( > treatment = levels(df$treatment), > age = rep(levels(df$age)[1], 2), > sex = rep(levels(df$sex)[1], 2), > stage = rep(levels(df$stage)[1], 2))) > > str(treat) > 'data.frame': 0 obs. of 0 variables > [[al

Re: [R] beta binomial distribution

2017-10-07 Thread David Winsemius
n plain text. Also read these documents. > > 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. David Winsemius Alameda, CA, USA 'Any t

Re: [R] Adjusted survival curves

2017-10-07 Thread David Winsemius
) > library(survminer) > df<-read.csv("base.csv", header = TRUE, sep = ";") > head(df) > ID start stop censor sex age stage treatment > 1 1 0 66 0 2 1 3 1 > 2 2 0 18 0 1 2 4 2 > 3 3 0 43 1 2 3 3 1 > 4 4 0 47 1 2 3 NA 2 > 5 5 0 26 0 1 4 3 NA > > #

Re: [R] [FORGED] bootstrapping results in table format

2017-10-07 Thread David Winsemius
Rolf makes good points. What sort of table do you want? Have you looked at the structure of `A`? str(A) # output omitted in the interest of brevity # It's an unnamed list of two 'boot' objects (one for each group), each of which is a named list. > names(A[[1]]) [1]

Re: [R] example of geom_contour() with function argument

2017-10-09 Thread David Winsemius
t; The remaining figures in my document are in ggplot2 and therefore I >>>>> am looking for a ggplot2 solution. >>>>> >>>>> Thanks in advance! >>>>> >>>>> BFD >>>>> >>>>> [[alternative H

Re: [R] Regular expression help

2017-10-10 Thread David Winsemius
t; >> when there might be zero, one or two slashes. Any suggestions? >> >> Duncan Murdoch >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/li

Re: [R] Power test binominal GLM model

2017-10-10 Thread David Winsemius
___ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, repr

Re: [R] about taylor.diagram

2017-10-11 Thread David Winsemius
tings that fail to do this. > > [[alternative HTML version deleted]] And HTML mail is not the proper mode for sending postings. > PLEASE,PLEASE, > PLEASE,PLEASE > do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-co

Re: [R] How to define proper breaks in RFM analysis

2017-10-12 Thread David Winsemius
[[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-gu

Re: [R] Quotation marks hinder for loop

2017-10-13 Thread David Winsemius
e it if someone would help me. > > Best regards, > Yohei Tanaka > ====== > Yohei Tanaka > Tohoku University > Graduate school of Economics > Doctoral student > email: marineband2...@gmail.com > > [[alternative HTML version deleted]] >

Re: [R] How to define proper breaks in RFM analysis

2017-10-13 Thread David Winsemius
uartile its >> not giving the optimal results. >> so I'm looking for a better approach where i can define breaks dynamically >> because after visualization i can do it easily but i want to apply this >> model so >> that it can automatically define the breaks according

Re: [R] Download data from NASA for multiple locations - RCurl

2017-10-15 Thread David Winsemius
ta$city <- rep(cities[1,1], nrow(mydata)) > mydata$state <- rep(cities[1,2], nrow(mydata)) > mydata$lon <- rep(cities[1,3], nrow(mydata)) > mydata$lat <- rep(cities[1,4], nrow(mydata)) > ### > > Help and advice would be greatly appreciated. Thank you! > > Since

Re: [R] Download data from NASA for multiple locations - RCurl

2017-10-16 Thread David Winsemius
", "265.812", "267.769"), class = "factor"), city = > structure(c(1L, > 1L, 1L, 1L, 1L, 1L), .Label = "Boston", class = "factor"), > state = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = " MA ", class = > &

Re: [R] survival analysis - predict function

2017-10-16 Thread David Winsemius
___ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, mi

Re: [R] Download data from NASA for multiple locations - RCurl

2017-10-16 Thread David Winsemius
c(42.36, > 41.18, 42.37, 41.7, 41.77)), .Names = c("city", "state", > "lon", "lat"), row.names = c(NA, 5L), class = "data.frame") > ### > > Apologies if this seems trivial but I have been having a hard time. Thank you > ag

Re: [R] greport

2017-10-17 Thread David Winsemius
> On Oct 17, 2017, at 10:32 AM, Andreas Betz wrote: > > Hello, > > I am trying to setup grereport by Frank Harell on my Fedora system. > Unfortunately some links for latex on the homepage are disabled. Thus I > cannot find ocgtools for Fedora. Have you tried searching on google? The first hi

Re: [R] Can I use PhantomJS or assume a firefox instalattion for usage with RSelenium in CRAN Machines?

2016-05-19 Thread David Winsemius
nterface. Nonetheless, he does use it on occasion and it clearly "works" on more than one platform. If your code is not confidential and the website has at least a guest login capacity, you could post it here and ask for trial runs on whatever platform(s) you may not have testing cap

Re: [R] Grep command

2016-05-19 Thread David Winsemius
; [1] "ants" "cats" "fox" > j<-c( > grep(some[1],all,value=F), > grep(some[2],all,value=F), > grep(some[3],all,value=F)); j; all[j] > [1] 1 3 6 > [1] "ants" "cats" "fox" j <- grep( paste0( some, collapse="|&

Re: [R] how to perform multiple comparison?

2016-05-19 Thread David Winsemius
> and provide commented, minimal, self-contained, reproducible code. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-pr

Re: [R] Plots for lmrob function

2016-05-20 Thread David Winsemius
uot; is not a graphical parameter 5: In box(...) : "plot" is not a graphical parameter 6: In title(...) : "plot" is not a graphical parameter 7: In plot.xy(xy.coords(x, y), type = type, ...) : "plot" is not a graphical parameter 8: In title(sub = sub.caption, ...) :

Re: [R] Choosing subset of data

2016-05-20 Thread David Winsemius
h/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. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSU

Re: [R] (no subject)

2016-05-20 Thread David Winsemius
-- To UNSUBSCRIBE and more, see > 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. David Winsemius Alameda, CA, USA ___

Re: [R] An averaged model based on Quartile and Mean of Quartiles

2016-05-21 Thread David Winsemius
instead use a name for the dataframe which is not also a function name: aggregate( dfrm[ , sapply( dfrm, inherits, "numeric")], # logical indexing for `[, j]` dfrm['quant'] # using "[" keeps it a list mean) -- David Winsemius Alameda, CA, US

Re: [R] if else condition - help

2016-05-22 Thread David Winsemius
> 1.5,1,-1))) >>> >>>> k1 >>> C1 C2 C3 C4 >>> A -1 -1 -1 -1 >>> B 1 -1 -1 -1 >>> C -1 -1 -1 -1 >>> D -1 1 -1 -1 >>> >>> >>> >>> Thanks >>> Adrian >>> >>> _

Re: [R] Merging 2 files with different timestamp

2016-05-22 Thread David Winsemius
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. David Winsemius Alameda, CA,

Re: [R] need help to convert animal ID to a factor

2016-05-22 Thread David Winsemius
>>>>> Reagdrs, >>>>> >>>>> >>>>> >>>>> >>>>> *Mohammad * >>>>> >>>>>[[alternative HTML version deleted]] >>>>> >>>>> _

Re: [R] numeric inputs to sweep produce NaN...

2016-05-24 Thread David Winsemius
; > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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,

Re: [R] Sprintf to call data frame from environment

2016-05-24 Thread David Winsemius
ere considering the next step of hoping to pass a computed item to `$`, then forget that as well, and learn to use `[`. -- David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mai

Re: [R] mixed models

2016-05-27 Thread David Winsemius
t; the >>>>>> data file is attached as ‘Eboni2.txt. >>>>>> >>>>>> library("nlme") >>>>>> >>>>>> str(Eboni2) >>>>>> >>>>>> head(Eboni2) >>>>>

Re: [R] Creating R file

2016-05-28 Thread David Winsemius
> On May 27, 2016, at 4:40 PM, jay28 via R-help wrote: > > Hi. I am new to R and confused by some conflicting and contradictory > information about it. Where and how do I create a numeric data file with .csv > extension for use in R? So numbers meaning numeric data will be separated by > com

Re: [R] Fitting quantile (or cdf?) function to data with specified percentiles

2016-05-29 Thread David Winsemius
> On May 26, 2016, at 7:51 PM, Franco Danilo Roca Landaveri > wrote: > > Hello, > > I hope you can help me. In class, we were given an Excel worksheet with > specified formulas that take the total score from a survey (or from a > specific section) and convert it to a percentage, according to

Re: [R] Merging variables

2016-06-06 Thread David Winsemius
You loop through each Sent from my iPhone > On Jun 6, 2016, at 8:29 AM, g.maub...@weinwolf.de wrote: > > Hi All, > > I merged two datasets: > > ds_merge1 <- merge(x = ds_bw_customer_4_match, y = > ds_zww_customer_4_match, > by.x = "customer", by.y = "customer", > all.x = TRUE, all.y = FALSE

Re: [R] Merging variables

2016-06-06 Thread David Winsemius
You loop through each row but during each iteration you assign a value to the entire "mismatch" column. The last value assigned was 1. Sent from my iPhone > On Jun 6, 2016, at 8:29 AM, g.maub...@weinwolf.de wrote: > > Hi All, > > I merged two datasets: > > ds_merge1 <- merge(x = ds_bw_custome

Re: [R] save rgl.sphere plot

2016-06-10 Thread David Winsemius
http://stackoverflow.com/questions/7663982/r-using-rgl-to-generate-3d-rotatable-plots-that-can-be-viewed-in-a-web-browser Sent from my iPhone > On Jun 10, 2016, at 9:14 AM, ch.elahe via R-help wrote: > > Hi all > I have generated a 3D interactive rgl.sphere but I don't know how to save it > t

Re: [R] is there a package in R or functions to calculate odds/hasard ratio from spline regression

2016-06-15 Thread David Winsemius
list -- To UNSUBSCRIBE and more, see > 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. David Winsemius Alameda, CA, USA _

Re: [R] is there a package in R or functions to calculate odds/hasard ratio from spline regression

2016-06-15 Thread David Winsemius
ction you anticipate using. On the Rhelp mailing list you are requested to present questions with sufficient code to support a coding response. -- David > Thank's again for the answers > > > > > 2016-06-15 17:56 GMT+02:00 David Winsemius : > > > On Jun 14

Re: [R] dplyr's arrange function

2016-06-15 Thread David Winsemius
9.Mammogram 72.6 (1.82) > 10 10. Pap Smear test 73.3 (2.37) > 11. Health check-up 77.2 (1.19) > 2 2. Blood cholesterol checked 84.5 (1.14) > 4 4. Blood pressure checked 88.7 (0.88) The mixedorder function splits the strings at the space boundarie

Re: [R] Package rms: c-statistic from lrm function with weights

2016-06-16 Thread David Winsemius
led as possibly fractional case weights. -- David. > > Best regards, > MP > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat

Re: [R] dplyr's arrange function - 3 solutions received - 1 New Question

2016-06-16 Thread David Winsemius
ks to Daniel Nordlund for the tips - replacing leading space with a 0 > in the data. > > 2) Thanks to David Winsemius for his solution with the gtools::mixedorder > function. I have added an argument to his. > > mydata[ mixedorder(mydata$prevalence_c, decreasing=TRUE),

Re: [R] Excluding coordinates that fall within a circle

2016-06-17 Thread David Winsemius
dfrm[ (dfrm$lat - .5)^2+(dfrm$long-.5)^2 > .25 , ] with( reduced, plot(lat,long) ) Rplot.pdf Description: Adobe PDF document Probably should have plotted (long, lat), and it might have been more eser freindly to use subset instead of `[ logical-vector, ]` but I think

Re: [R] extracting coefficients from ar() output

2016-06-17 Thread David Winsemius
, see >>> 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. >>> >> >> [[alter

Re: [R] extracting coefficients from ar() output

2016-06-17 Thread David Winsemius
n the help page quotes the names of dataframe objects and the help page says the x values should be _character_ (rather than R symbol/names). You didn't provide a character vector as the first argument which, since it was unnamed, was therefore matched to the 'x' parameter. -- David.

Re: [R] merging df with world map

2016-06-17 Thread David Winsemius
ot;) >str(world_map) > >'data.frame': 0 obs. of 133 variables: >$ region: chr >$ long : num >$ lat : num >$ group : num >$ order : int >$ subregion : chr &g

Re: [R] Extract character strings from a vector

2016-06-21 Thread David Winsemius
Thank you very much for your help. >> >> Have a nice day >> >> Marine >> >> >>[[alternative HTML version deleted]] >> >> ______ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, se

Re: [R] Saving .eps files with Times New Roman font

2016-06-23 Thread David Winsemius
[[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/pos

Re: [R] What's box() (exactly) doing?

2016-06-23 Thread David Winsemius
avoid? > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, min

Re: [R] Help with the Cut Function

2016-06-25 Thread David Winsemius
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. David Win

Re: [R] Help with the Cut Function

2016-06-25 Thread David Winsemius
d in another item to the 'labels' vector. Perhaps: c( "<= 20", "(20,30]", "(30,40], "> 40"") > i receive an error message as below: > > lengths of 'breaks' and 'labels' differ. Now as a result i have values > e

Re: [R] How I can calculate the value of response variable

2016-06-26 Thread David Winsemius
tinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Help please with error from nnet::multinom

2016-06-26 Thread David Winsemius
ps://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. >> > > [[alternative HTML version deleted]] > > __

Re: [R] Help please with error from nnet::multinom

2016-06-26 Thread David Winsemius
ype = "probs") : > >>> NAs are not allowed in subscripted assignments > >>> In addition: Warning message: > >>> 'newdata' had 200 rows but variables found have 300 rows > >>> > >>> Thanks, > >>> Lars.

Re: [R] Help please with error from nnet::multinom

2016-06-26 Thread David Winsemius
sses(cl, m) keep <- match(row.names(m), rn) X <- model.matrix(Terms, m, contrasts = object$contrasts) Y1 <- predict.nnet(object, X) Y <- matrix(NA, nrow(newdata), ncol(Y1), dimnames = list(rn, colnames(Y1))) Y[keep, ] <- Y1 } I failed wi

Re: [R] Turning a variable name into a function argument

2016-06-28 Thread David Winsemius
tinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE a

Re: [R] Turning a variable name into a function argument

2016-06-28 Thread David Winsemius
347-730-4813 (fax) >>>> >>>> >>>> >>>>> On Jun 28, 2016, at 3:42 PM, Greg Snow <538...@gmail.com> wrote: >>>>> >>>>> There are several options. The option that is most like search and >>>>>

Re: [R] ggplot2 stat_smooth

2016-06-29 Thread David Winsemius
> __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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-c

Re: [R] Difficulty subsetting data frames using logical operators

2016-07-01 Thread David Winsemius
")]]) If you want to do selection and rejection of NA's inside the "[" function, both operations should be done in the first argument rather than the second: mean( data[ data$Ozone > 31 & !is.na(data$Ozone) , "Ozone"]) Alternates (but not recommended for program

Re: [R] Can R read Word fonts and comments?

2016-07-01 Thread David Winsemius
It’s my understanding that docx and xlsx files are zipped containers that have their data in XML files. You should try unzipping one and examining it with a viewer. You may then be able to use pkg:XML. — David. > On Jul 1, 2016, at 3:13 PM, Bert Gunter wrote: > > No, sorry -- all I would do

Re: [R] lineplot.CI xaxis scale change in sciplot?

2016-07-04 Thread David Winsemius
> On Jun 29, 2016, at 7:04 PM, Clemence Henry > wrote: > > Hi, > > I am trying to change the values of the tick marks on the xaxis of the > following multipanel plot (see relevant bits of script below) to increments > of 50 or to a custom scale (ie. 50, 100, 150, 200, 300...). > So far I tri

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-04 Thread David Winsemius
> On Jul 4, 2016, at 6:56 AM, mai...@infomed.sld.cu wrote: > > Hello, > How can I aggregate row total for all groups in dplyr summarise ? Row total … of what? Aggregate … how? What is the desired answer? > library(dplyr) > mtcars %>% > group_by (am, gear) %>% > summarise (n=n()) %>% > muta

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-04 Thread David Winsemius
gt; library("dplyr") > > > mtcars %>% >group_by (am, gear) %>% >summarise (n=n()) %>% >mutate(rel.freq = paste0(round(100 * n/sum(n), 0), "%")) %>% >ungroup() %>% > mutate(row.tot = sum(n)) > > HTH > Ulrik > >&g

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-04 Thread David Winsemius
nrow(mtcars) Sent from my iPhone > On Jul 4, 2016, at 9:03 PM, Ulrik Stervbo wrote: > > That will give you the wrong result when used on summarised data > > > David Winsemius schrieb am Di., 5. Juli 2016 02:10: >> I thought there was an nrow() function? &g

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-05 Thread David Winsemius
he data is summarised. In which case you get 4 >> rows and not the correct 32. >> >> On Tue, 5 Jul 2016, 07:48 David Winsemius, wrote: >> >>> nrow(mtcars) >>> >>> >>> Sent from my iPhone >>> >>> On Jul 4, 2016, at 9:03

Re: [R] Antwort: Re: dplyr : row total for all groups in dplyr summarise

2016-07-05 Thread David Winsemius
2 0.014705882 > 7Horror17 0.12500 > 8 Romance11 0.080882353 > 9 Thriller13 0.095588235 > > Here the % correspond to the count and the sum of count, e. g. sum = 136 > and 32 / 136 = 0,2352941. > > What is the difference when counting? What do the r

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-06 Thread David Winsemius
infomed.sld.cu >>> Cc: r-help@r-project.org >>> Betreff: Re: [R] dplyr : row total for all groups in dplyr summarise >>> >>> >>> >>> mtcars %>% >>> group_by (am, gear) %>% >>> summarise (n=n()) %>% >>&

Re: [R] dplyr : row total for all groups in dplyr summarise

2016-07-06 Thread David Winsemius
> On Jul 6, 2016, at 9:45 AM, rmendelss gmail wrote: > > >> On Jul 6, 2016, at 9:36 AM, David Winsemius wrote: >> >> n this case the text was cut from the R session console text and pasted >> without modification into Mail.app version 8.2. In replicatin

Re: [R] GAMS, std errors and confidence intervals

2016-07-06 Thread David Winsemius
sion deleted]] Plain text requested. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >

Re: [R] R code for multilevel latent class analysis

2016-07-07 Thread David Winsemius
f all variables: lchar <- character(); for( i in 2:4){ lchar=c(lchar, as.character(lca[[2]][[i]][[2]]))} lchar #[1] "ppltrst" "pplfair" "pplhlp" all( c( lchar, 'cntry') %in% colnames(mydata) ) > > How can I solve this? Is the code complet

Re: [R] r code for multilevel latent class analysis

2016-07-07 Thread David Winsemius
d(ppltrst+1,pplfair+1,pplhlp+1)~cntry >> lc <- poLCA(lca,mydata) >> >> However, I get an error message: >> Error in `[.data.frame`(data, , match(colnames(y), colnames(data))[j]) : >> undefined columns selected >> >> How can I solve this? Is the code c

Re: [R] WRS2 package problems with post hoc test lincon

2016-07-08 Thread David Winsemius
___ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. Davi

Re: [R] 'ref' must be an existing level

2016-07-09 Thread David Winsemius
mail.com >> >> >> >> >> >> >> >> >> >> > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Office:

Re: [R] R council with regard to the analysis needd

2016-07-09 Thread David Winsemius
5 are nested in M0. You should clarify with your research professor what your research hypothesis (or hypotheses) might be. That is what should determine your model comparison hierarchy. -- David Winsemius Alameda, CA, USA __ R-help@r-project.org mail

Re: [R] Reading a large directory of compressed zips into a data frame

2016-07-09 Thread David Winsemius
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. David Winsemius Alameda, CA, USA __ R-help@r-project.or

Re: [R] [FORGED] Regression with factors ?

2016-07-11 Thread David Winsemius
>>> yx1 x2 >>>> 0.96 Alice Bob >>>> 0.84 Alice Charlie >>>> 0.96 Bob Charlie >>>> 0.64 Dave Alice >>>> etc. >>>> >>>> Each person has a numerical value. Here for example Alice = 0.2 and &g

Re: [R] use value in variable to be name of another variable

2016-07-11 Thread David Winsemius
orking. Starting with a test data structure that > is a little simpler I have tried: > for (i in 1:4) > { ATG <- tTargTFS[1, i] > assign(cat(ATG), tTargTFS[-1, i]) } Your efforts will come to naught (or more prezactly... NULL) when you use `cat` as a value. You are essentially d

Re: [R] [R-pkgs] archivist.github 0.2.1 on CRAN - Task View: Reproducible Research

2016-07-11 Thread David Winsemius
o-boost-reproducibility-of-your-research> > > If you would like to boost your reproducible engines then this is a talk > for you :) This is a link to a video of the talk: https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/How-to-use-the-archivist-pac

Re: [R] Aggregate rainfall data

2016-07-12 Thread David Winsemius
0 0 > 963 8 2008 8:00:00 0 > 973 8 2008 9:00:00 0 > 983 8 2008 10:00:00 0 > 993 8 2008 11:00:00 0 > 100 3 8 2008 12:00:00 0 > > The rainfall data is in hourly unit, and I would like to sum the Rain.mm > according to month. I tried to use aggregate()

Re: [R] Aggregate rainfall data

2016-07-13 Thread David Winsemius
15:00:00 NA > 8 30 7 2008 16:00:00 NA > 9 30 7 2008 17:00:00 NA > 10 30 7 2008 18:00:00 NA > > Than

<    1   2   3   4   5   6   7   8   9   10   >