Re: [R] help with reshape

2015-09-08 Thread PIKAL Petr
Hi David But the final problem was that Ivan's code with original data (with NA) provided different result on his Mac with R3.2.1 version and on my PC with R3.3.0 devel version. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David L

[R] Task Views

2015-09-08 Thread Partha Sinha
Dear All I am using R version R version 3.2.1 (2015-06-18) in windows 7. I have installed few task views like Timeseries and Graphics in R. 1. Is it possible to find out which "TASK Views" are installed in the system ? 2. Can in install multiple Task views using single command ? Regards Partha _

Re: [R] R wont accept my zero count values in the GLM with quasi_poisson dsitribution

2015-09-08 Thread Wensui Liu
based on your code "fit <- glm(abundance~Gender,data=teminfest,family=binomial())", i don't see anything related to quasi_poisson. are you sure what you are doing here? On Tue, Jul 28, 2015 at 1:33 AM, Charlotte wrote: > Hello > > I have count values for abundance which follow a pattern of over-d

Re: [R] R wont accept my zero count values in the GLM with quasi_poisson dsitribution

2015-09-08 Thread Charlotte
Hello I am going to look at the ZIP (zero-inflated poisson). I just need to ask. One of my variables is continuous data (hosts body length), is it ok to include this kind of data into this analysis or do I need to turn it into categories (29-50 mm, 51-100mm and so on)? Many Thanks Charlotte

[R] Extracting case values from ancova adjusted means

2015-09-08 Thread B Jessop
Dear Help List, Given a standard one-way ANCOVA model for comparing k groups and with one covariate factor e.g. ANC <- lm(Y ~ X + Group) run within package "car" followed by the estimation of adjusted group means with the "effects" package e.g. Effects1 <- Effect("Group", ANC, se = TRUE) h

Re: [R] extracting every nth character from a string...

2015-09-08 Thread William Dunlap
charToRaw is not good here because it splits up multibyte characters: strsplit(str, "") will split str into its characters. E.g., > str <- c("ggaaaa12:\u03b3, OOmmeeggaa12:\u03A9...") > rawToChar( charToRaw( str)[ c( TRUE, FALSE)]) [1] "gamma1:³ Omega1:©." > paste(collapse="", strsplit(str

Re: [R] extracting every nth character from a string...

2015-09-08 Thread Frank Schwidom
> rawToChar( charToRaw( str)[ c( TRUE, FALSE)]) [1] "ACEG" Regards On Sat, Sep 05, 2015 at 04:59:54PM -0400, Evan Cooch wrote: > Suppose I had the following string, which has length of integer multiple of > some value n. So, say n=2, and the example string has a length of (2x4) = 8 > characters

[R] Converting a .wav file into an mp3 file in R

2015-09-08 Thread Dimitri Liakhovitski
Hello, I know how to read in mp3 files, e.g., using tuneR. But is it possible to read in a .wav file - as below and then compress it to mp3 format? library(tuneR) mywav <- readWave("myfile.wav") Thanks a lot for any hints! -- Dimitri Liakhovitski __

Re: [R] Help with vectors!

2015-09-08 Thread Frank Schwidom
# my last one: xtfrm( VAS) On Tue, Sep 08, 2015 at 11:55:51AM -0700, Dan D wrote: > Great! > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Help-with-vectors-tp4711801p4712023.html > Sent from the R help mailing list archive at Nabble.com. > > __

Re: [R] Help with vectors!

2015-09-08 Thread Dan D
Great! -- View this message in context: http://r.789695.n4.nabble.com/Help-with-vectors-tp4711801p4712023.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.

Re: [R] Help with vectors!

2015-09-08 Thread Frank Schwidom
On Sat, Sep 05, 2015 at 02:14:18PM -0700, Dan D wrote: > # your data > VAS<-c("Green","Green","Black","Green","White","Yellow","Yellow","Black","Green","Black") > > # declare the new vector > New_Vector<-numeric(length(VAS)) > > # brute force: > New_Vector[VAS=="White"]<-1 > New_Vector[VAS=="Yell

[R] Help me in cluster

2015-09-08 Thread Ghada Almousa
I have project to study and analysis clusters algorithm in R "K-mean, Hierarchical, Density based and EM" I want to calculate Cluster instance , number of iteration , sum of squared error SSE and the accuracy for each cluster algorithms that i mention above And the log likelihood for EM and DBSCAN

Re: [R] groups Rank

2015-09-08 Thread Ragia Ibrahim
many thanks, It WORKS. But what If I want to add a condition that considered Measure_id , if it is '1'   rank reverse the probability and if it is ' 2 ' rank is ordered like probability?  Replying is highly appreciated  Ragia > From: petr.pi...@prechez

[R] mlogit data format

2015-09-08 Thread 敷田治誠 クラウジオ
Ok, here is my question. I have a data frame that looks like this: yx1 x2 (say, age)x3 yes car 23 catholic no bus34 muslim maybe bus16 jew You see, the multinomial dependen

Re: [R] Non linear regression - Von Bertalanffy Growth Function - "singular gradient matrix at initial parameter estimates"

2015-09-08 Thread Xochitl CORMON
Thank you for the tip. Indeed, nlxb in nlmrt works and results are not crazy. I would like however to assess goodness-of-fit (gof) and ultimately to compare it with gof from linear regression (fitted with same variables). Before I used AICc to compare the nls() and lm() fit, however I get now

Re: [R] names in R list's

2015-09-08 Thread William Dunlap
It is not too hard to set up some tests to show time as a function of number of named elements for lists and environments. Here is one such test test <- function (data, nToAdd, nToExtract = length(data)) { addTime <- { addedNames <- paste0("D", seq(length(data) + 1, len = nToAdd))

Re: [R] names in R list's

2015-09-08 Thread Sarah Goslee
On Tue, Sep 8, 2015 at 7:53 AM, Witold E Wolski wrote: > Hi Jeff, > > Indeed there was something about plain-text in the r-help posting > guide although I can't find it there anymore. > https://www.r-project.org/posting-guide.html > > Is it still an requirement? Yes. From that very link: Technic

Re: [R] Laplace smoothing in J48

2015-09-08 Thread Sarah Goslee
Without a reproducible example that includes some sample data provided using dput() (fake is fine), the code you used, and some clear idea of what output you expect, it's impossible to figure out how to help you. Here are some suggestions for creating a good reproducible example: http://stackoverfl

Re: [R] Counting number of rain

2015-09-08 Thread John Kane
Assuming your data is already in R format please sent it dput() format. See ?dput or http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and http://adv-r.had.co.nz/Reproducibility.html for more details. John Kane Kingston ON Canada > -Original Message--

Re: [R] help with reshape

2015-09-08 Thread David L Carlson
I don't think it is platform or version specific. The purpose of the missing value, NA (i.e. Not Available), is to flag the value for special handling in some way, often by deletion. You cannot assume that NA will be treated as any other value since that would defeat the whole purpose of flaggin

Re: [R] Counting number of rain

2015-09-08 Thread Dan D
Try the following: ## step 1: write raw data to an array junk<-scan('clipboard') # entering the numbers (not the 'year' etc. labels) into R as a vector after junk<-t(array(junk,dim=c(4,length(junk)/4))) # convert the vector into a 2-d array with 4 columns (year, month, day, amount) ## step 2:

Re: [R] help with reshape

2015-09-08 Thread Ivan Calandra
David, It seems that your solution works, but why would that be? And why would this NA behavior be platform or version specific? I really need to check with a newer version of R... Ivan -- Ivan Calandra, PhD University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Ga

Re: [R] help with reshape

2015-09-08 Thread David L Carlson
I have not followed this thread closely, but this seems to work: mydata$repet[is.na(mydata$repet)] <- 0 reshape(mydata, timevar="Elem", idvar=c("Etape","Ech", "repet", "dilution","Rincage"), direction="wide", drop=c("ID","Nom_ech")) If this is the expected outcome, the problem is the NA val

[R] Counting number of rain

2015-09-08 Thread smart hendsome via R-help
Hello R-users, I want to ask how to count the number of daily rain data.  My data as below: Year Month Day Amount 1901 1 1 0 1901 1 2 3 1901 1 3 0 1901 1 4 0.5 1901 1 5 0 1901 1 6 0 1901 1 7 0.3 1901 1 8 0 1901 1 9 0 1901 1 10 0 1901 1 11 0.5 1901 1 12 1.8 1901 1 13 0 1901 1 14 0 1901 1 15 2.5

[R] Laplace smoothing in J48

2015-09-08 Thread Priyanka Garg
Hi, I am using J48 classifier. I want to now after i set A as TRUE in control option of the classifier, how could i see its effect when using predict method ? Regards Priyanka Garg School of Computers & Information Sciences University Of Hyderabad [[alternative HTML version deleted]]

Re: [R] help with reshape

2015-09-08 Thread Ivan Calandra
Dear Petr, Thank you for your help. I might look into this issue later (with the latest version of R), but for now, your solution with package reshape2 works perfectly! Bests, Ivan -- Ivan Calandra, PhD University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Garros

Re: [R] help with reshape

2015-09-08 Thread PIKAL Petr
Hi Well, I cannot help you any further. It can be platform or version issue. You are using Mac, I work with PC, your R version is 3.2.1 mine is 3.3.0 (devel). Wizards from R core are appropriate for answering this. You can transfer our conversation to R-sig-Mac, if people using Mac found simil

Re: [R] names in R list's

2015-09-08 Thread Jeff Newmiller
Which answers why the list strips HTML out, but the reason we should compose in plain text is so we see what our readers will see. The stripping sometimes makes the result nearly impossible to read and deters people from wading in to give an answer. In addition, some HTML editors act like word p

Re: [R] help with reshape

2015-09-08 Thread Ivan Calandra
I do get only 2 lines: mydata <- structure(list(ID = c(543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 11574, 11575, 11576, 11577, 11578, 11579, 11580, 11581, 11582, 11583, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696,

Re: [R] help with reshape

2015-09-08 Thread PIKAL Petr
Hi based on your data I got 3 lines with similar results as I got from melt/dcast only the rows are not in the same order. > version _ platform i386-w64-mingw32 arch i386 os mingw32 system i386, mingw32 status Under development (unstable

Re: [R] help with reshape

2015-09-08 Thread Ivan Calandra
Thanks Petr, It looks good, but I have to check in more details. Can anyone help me with my original solution using reshape()? I'd like to understand what I did wrong. reshape(mydata, timevar="Elem", idvar=c("Etape","Ech","repet","dilution","Rincage"), direction="wide", drop=c("ID","Nom_ech"))

Re: [R] help with reshape

2015-09-08 Thread PIKAL Petr
Hi I looked into docs to reshape2 and played around a bit and by some magical feature test <- dcast(mm, Etape+Ech+repet+dilution+Rincage~Elem) probably works as you expect. I cannot comment your solution as I use reshape only sparsely. Cheers Petr > -Original Message- > From: R-help

Re: [R] Modelling categorical variables

2015-09-08 Thread PIKAL Petr
Hi You probably wont get many answers because: 1 -you post in HTML (post in plain text) 2 -you provide data which are unreadable (copy output of dput(yourdata) instead) 3 -you ask statistical question which are rarely answered here (they are better suited to stackexchange list) Regarding your m

Re: [R] help with reshape

2015-09-08 Thread Ivan Calandra
Thank you Petr, It kinda works, but not completely. The problem is that it produces a column for each value ("Moyenne"), and not each element of "Elem". That means I have only one value per column, instead of up to 3. For example, I have 3 columns for Al1670 instead of just one, and each colum

Re: [R] help with reshape

2015-09-08 Thread PIKAL Petr
Hi I am not sure if I got it library(reshape2) mm<-melt(mydata, measure.vars="Moyenne") test <- dcast(mm, Etape+Ech+repet+dilution+Rincage~Elem+value) gives me 3 rows but names need some tweaking afterwards. nn<-paste("Moyenne", unlist(lapply(strsplit(names(test)[-(1:5)], "_"), "[", 1)), sep="

Re: [R] names in R list's

2015-09-08 Thread Marc Schwartz
> On Sep 8, 2015, at 6:53 AM, Witold E Wolski wrote: > > Hi Jeff, > > Indeed there was something about plain-text in the r-help posting > guide although I can't find it there anymore. > https://www.r-project.org/posting-guide.html > > Is it still an requirement? Witold, See the first bulle

Re: [R] names in R list's

2015-09-08 Thread Witold E Wolski
Hi Jeff, Indeed there was something about plain-text in the r-help posting guide although I can't find it there anymore. https://www.r-project.org/posting-guide.html Is it still an requirement? Jeff, thanks for you constructive contribution ;) . Glad that you know about plain text mode in e-mail

Re: [R] Is there a time series resampling function ?

2015-09-08 Thread AltShift
Thanks, Sergio. Yes, resample looks promising. I'll try it out now. -- View this message in context: http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907p4711987.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Is there a time series resampling function ?

2015-09-08 Thread AltShift
Cheers, mate! I thought there must be some obscure way to search from within CRAN. After reading your reply I tried Googling "CRAN signal processing". Much better. (D'oh!) -- View this message in context: http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907p47

[R] Modelling categorical variables

2015-09-08 Thread Jessica Lavabre
Hi, I am a beginner with statistics and R and have no clue on how to model my data. I have collected information on seed traps (ID) that includes the habitat type (Hab) and different measures of distances. Also I have applied a modularity analysis, so that the seeds traps are grouped into modules.

[R] help with reshape

2015-09-08 Thread Ivan Calandra
Dear users, I'm having troubles with reshaping a data.frame from long to wide format. I copy the output of dput() at the end of the mail because it is quite long. Each row of the column "Elem" should be transposed to a new column. All variables "Etape", "Ech", "repet", "dilution", "Rincage" def

Re: [R] Lag variable by group

2015-09-08 Thread Janka VANSCHOENWINKEL
Wow! Thanks for pointing that out! And thanks for testing it out as well! It is always the first year available (unbalanced panel) that should get NA. So using the code line you provided earlier, this should work: library(data.table) data <- data.table(newdata, key = "id") ooo<-order(data$id, da