Re: [R] dplyr or plyr or both?

2016-09-15 Thread Frans Marcelissen
I never realised that nonsense results don’n bother experienced users….. Probably I am not experienced wiith my 6years of R professional work. I think your advise is incomplete: a %>% dplyr::group_by(groep) %>% dplyr::summarise(m=mean(v),n=dplyr::n()) Gives the same problems and makes the line

Re: [R] dplyr or plyr or both?

2016-09-15 Thread Frans Marcelissen
Hello Christopher and others : What cannot be stressed enough is: do not combine both packages, it gives errors and incorrect results! I will show that below a<-data.frame(groep=1:4,v=1:40) library(dplyr) a %>% group_by(groep) %>%

Re: [R] Need help in installing packages in R

2016-02-25 Thread Frans Marcelissen
Three remarks: 1. 'Install.Packages=="RODBC"' does nothing. Where did you find that? The command is install.packages("RODBC") 2. Sometimes it is a good idea to start reading a manual. 3. Please do not post in html Frans 2016-02-25 17:11 GMT+01:00 Bhavani Akila : > Hi, >

Re: [R] write.xlsx- writing in a single sheet

2016-01-15 Thread Frans Marcelissen
Do you mean that you try to write several dataframes to the same sheet? You have asked this before, and I think it has been said that that is not possible with write.xls. I suppose that you still try to write rows of data of varying length to one sheet. I think that is possible with the lowlevel

Re: [R] Multiple CSV files in different sheets of an Excel file

2016-01-13 Thread Frans Marcelissen
Hi Mohse, You can do that with the append parameter of the write.xlsx routine in the xlsx package: xlsx::write.xlsx(file1,file='X.xlsx',sheetName = '1') xlsx::write.xlsx(file2,file='X.xlsx',sheetName = '2',append = T) Success! Frans 2016-01-13 15:18 GMT+01:00 Mohsen Jafarikia

Re: [R] Multiple CSV files in different sheets of an Excel file

2016-01-13 Thread Frans Marcelissen
l format > and run the code you have suggested. Am I right? > > Thanks again, > Mohsen > > > On Wed, Jan 13, 2016 at 9:44 AM, Frans Marcelissen < > fransiepansiekever...@gmail.com> wrote: > >> Hi Mohse, >> You can do that with the append parameter of the wr

Re: [R] Reformatting dataframe for use with icc()

2015-10-10 Thread Frans Marcelissen
I think this is what reshape is made for... Frans -- rater.id <- c(1, 2, 1, 3, 2, 3) observation <- c(1, 1, 2, 2, 3, 3) rating <- c(6, 7, 4, 6, 2, 4) dat=data.frame(rater.id,observation,rating) library(reshape) dat2<-melt(dat, id.vars =

Re: [R] Attaching a pdf file to an email generated with sendmailR?

2015-10-08 Thread Frans Marcelissen
Hi Michael, I don't know whether there is a particulal reason for using sendmailR, but I use mailR for this without any problem. mailR::send.mail(from, to, subject = "", body = "", encoding = "iso-8859-1", html = FALSE, inline = FALSE, smtp = list(), authenticate = FALSE, send = TRUE,

Re: [R] R, RStudio, and a server for my iPad.

2014-04-12 Thread Frans Marcelissen
Running rstudio (server) on an ipad. I do'nt have an ipad anymore, but some years ago I noticed that rstudio (server) worked fine on an ipad of you have a separate keyboard. It does not work with the virtual keyboard. The same is true with android tablets. Frans 2014-04-12 3:38 GMT+02:00 Roy

Re: [R] Merge two vectors into one

2014-03-24 Thread Frans Marcelissen
Why not simply a-1:3 b-4:5 c(a,b) [1] 1 2 3 4 5 2014-03-22 23:22 GMT+01:00 Tham Tran hanhtham.t...@yahoo.com.vn: Dear R users, Given two vectors x and y a=1 2 3 b=4 5 6 i want to combine them into a single vector z as 1 4 2 5 3 6 Thanks for your help Tham -- View this

Re: [R] how to add a line in the graph?

2013-12-15 Thread Frans Marcelissen
, reproducible code. -- --- dr F.H.G. (Frans) Marcelissen DigiPsy (www.DigiPsy.nl http://www.digipsy.nl/) Pomperschans 26 5595 AV Leende tel: 040 2065030/06 2325 06 53 skype adres: frans.marcelissen email: frans.marcelis...@digipsy.nl [[alternative HTML version deleted

Re: [R] Replace NA's with value in the next row

2013-11-14 Thread Frans Marcelissen
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. -- --- dr F.H.G. (Frans) Marcelissen DigiPsy (www.DigiPsy.nl http

[R] strange conversion char to date

2013-08-30 Thread Frans Marcelissen
the same way in R 2.01 as well as in 1.9) --- dr F.H.G. (Frans) Marcelissen DigiPsy (www.DigiPsy.nl http://www.digipsy.nl/) Pomperschans 26 5595 AV Leende tel: 040 2065030/06 2325 06 53 skype adres: frans.marcelissen email: frans.marcelis...@digipsy.nl [[alternative HTML

[R] R 14.0, ggplot2: could not find function initRefFields

2013-04-02 Thread Frans Marcelissen
Hi, I have a problem combining R and SPSS (21). I do not know whether the solution is in R or in spss, so I will post both in the R group and in the SPSS group. I use the R plugin in spss(21). The most important reason to use this plugin is ggplot2 (spss does not have a decent graphical system).

Re: [R] exporting tables to word

2013-04-02 Thread Frans Marcelissen
Hi Allie, My preferred method is by means of odfWeave. Odfweave generates a libreoffice file, which can directly be transferred to word. A second way is run R from within spss. Spss has a much better output than R, but you can use the output system of spss (by means of spsspivottable.Display())

Re: [R] R 14.0, ggplot2: could not find function initRefFields

2013-04-02 Thread Frans Marcelissen
...@gmail.com On 2013-04-02 04:28, Frans Marcelissen wrote: Hi, I have a problem combining R and SPSS (21). I do not know whether the solution is in R or in spss, so I will post both in the R group and in the SPSS group. I use the R plugin in spss(21). The most important reason to use this plugin

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread Frans Marcelissen
Try sub([(],, names(dataFrams) and sub([)],, names(dataFrams) Frans 2013/2/28 Jesus Munoz Serrano jesusmunozserr...@gmail.com Dear all I'm having some problems with a data set that has parenthesis within the variable names. A example of this kind of variable names is the following:

Re: [R] Dealing with parentheses within variable names

2013-03-01 Thread Frans Marcelissen
Sorry: sub([(],, names(dataFrame) and sub([)],, names(dataFrame) Frans 2013/3/1 Frans Marcelissen fransiepansiekever...@gmail.com: Try sub([(],, names(dataFrams) and sub([)],, names(dataFrams) Frans 2013/2/28 Jesus Munoz Serrano jesusmunozserr...@gmail.com Dear all I'm

[R] How to findout the name of a dataframe

2013-02-17 Thread Frans Marcelissen
['v1'] or mydata[,'v1'] it is? Thanks Frans --- Frans Marcelissen fransiepansiekever...@gmail.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Test if mysql connection is alive

2013-02-14 Thread Frans Marcelissen
Hi fellows, I use RMySQL. I want to reconnect, if the connections is not alive anymore. if (!connected()) con-dbConnect(MySQL(),user=.., password=..,host=..,db=..) But how can I do the test connected()? I thought the way to do this was,

Re: [R] Help with functions as arguments

2013-02-12 Thread Frans Marcelissen
Hi Ian, The remark of Rainer is correct, but I think the solution is very simpe: f1 = function(a) { b = a + 1 b } f2 = function(x, z) { y = x*z(x) -2 y } f2(x = 3, z = f1) [1] 10 Or are you intending something else? Best wishes, Frans -Oorspronkelijk bericht- Van:

Re: [R] R and SSH / exchange R objects between client and server

2013-01-01 Thread Frans Marcelissen
--- dr F.H.G. (Frans) Marcelissen fransiepansiekever...@hotmail.com -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Duncan Murdoch Verzonden: dinsdag 1 januari 2013 21:39 Aan: Martin Batholdy CC: r-help@r-project.org Onderwerp: Re: [R] R

Re: [R] ggplot2: setting martin

2012-12-23 Thread Frans Marcelissen
  -Oorspronkelijk bericht- Van: Ista Zahn [mailto:istaz...@gmail.com] Verzonden: zaterdag 22 december 2012 0:47 Aan: Frans Marcelissen CC: R-help@r-project.org Onderwerp: Re: [R] ggplot2: setting martin   Well, the margin is being set large enough to accommodate  the labels. So if you want

[R] setting the margin size in ggplot2

2012-12-22 Thread Frans Marcelissen
Is it possible to set the margin in ggplot to a fixed size? I create many plots, and I want them to look the same. Especially I want them to have the same left margin, with different labels. But P-ggplot()+geom_bar(aes(c(short label1,short label2),runif(2)))+coord_flip() creates a plot with

[R] ggplot2: setting martin

2012-12-21 Thread Frans Marcelissen
work,it adds extra, external margins. Does anyone know a solution? Thanks Frans --- dr F.H.G. (Frans) Marcelissen DigiPsy ( http://www.digipsy.nl/ www.DigiPsy.nl) Pomperschans 26 5595 AV Leende tel: 040 7630487 (let op: nieuw nummer, oude nummer blijft actief) skype adres

Re: [R] avoid - in specific case

2012-10-05 Thread Frans Marcelissen
I agree with this. But there is (in my opinion) a much more dangerous point: ab If there is an object called b in the function, it uses this b. But if you forgot to inialise b in the function, it looks in the global environment. So the following happens: b-100 a-b (if there is no b in the

Re: [R] Importing a CSV file

2012-09-19 Thread Frans Marcelissen
Hi, Should'nt it be A - read.csv(C:Users\\Anthi\\Desktop\\R\\A.csv, header=TRUE) (c:\\ becomes c:\ In general I think it is better to use / and //) Frans -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Sarah Goslee Verzonden:

[R] rstudio client on the i-pad

2012-09-13 Thread Frans Marcelissen
a solution? Or know when a solution is ready? --- dr F.H.G. (Frans) Marcelissen __ 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

[R] odfWeave , UTF-8 locale and posix

2012-08-10 Thread Frans Marcelissen
Hello, I have a serious problem with odfWeave. I use odfWeave to produce on-line reports on a webserver. When the template file contains trema's (ë) or accents (é), odfWeave breaks with the unfamous error Unable to convert h.odt to the current locale. You may need to process this file in a

Re: [R] Running odfWeave on its own examples.odt

2012-08-10 Thread Frans Marcelissen
Hi, I had the same problem unde linux. My friend Albert Jan Roskam knew the solution: add Sys.setlocale(category = LC_ALL, locale = en_US.UTF-8) I suppose this also works under windows. Frans -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org

Re: [R] variable (column) in a data frame

2012-07-16 Thread Frans Marcelissen
Hoi Pauli, There is a difference between two ways of accessing columns in a matrex: df$aaa NULL df[AAA] Error in `[.data.frame`(df, AAA) : undefined columns selected So df[AAA] or df[,AAA] gives the error message you expect. --- Frans -Oorspronkelijk bericht- Van:

[R] Pass parameter to odfWeave

2012-06-15 Thread Frans Marcelissen
OdfWeave is a great way of creating reports and other quality output from R. But is there a simple way to pass a parameter to the report? What I mean is: odfWeave(templatefile,outputfile) creates the report. If would be much more flexible if it would be possible to do something like

[R] odfWeave, xtable and tex

2012-06-14 Thread Frans Marcelissen
Hello, I try to use xtable under odfWeave. With echo=FALSE,results=xml= library(xtable) xtable(iris) @ this results in an endless list of xmlParseEntityRef: no name On internet I find that results should be tex: echo=FALSE,results=tex=

[R] Print-quality output from R: some questions about R2wd

2011-08-08 Thread Frans Marcelissen
Hi,My major problem with R was always the quality of the output. Recently I found R2wd, which solved this problem. R2wd makes it possible to write output directly to a word file, end to produce high-quality tables.I have two problems with R2wd, however.1. The documentation says it is possible

[R] cannot install Rcmdr on ubuntu 11.4

2011-06-16 Thread Frans Marcelissen
stupid mistake I make? I have also installed the server version of Rstudio, I do not think this does have anything to doe with this? Thanks Frans Marcelissen [[alternative HTML version deleted]] __ R-help

[R] keys in score.items in package psych

2010-08-25 Thread Frans Marcelissen
Hi Ruru's, score.items in package psych is very handy for scoring test items. It has the structure score.items(keys,items). For instance: score.items(c(1,1,1),data.frame(a1=rep(1,5),a2=rep(1,5),a3=rep(1,5)))$scores correctly gives 1 on each case. But if key -1,0,1 the following happens