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 ug

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) %>% summarise(m

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, > > I have just started lea

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 fu

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

2016-01-13 Thread Frans Marcelissen
e 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 write.xlsx routine in >>

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 : > I have

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 = c('rater.id','observatio

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, attach.fi

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 Mend

Re: [R] Merge two vectors into one

2014-03-23 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 : > 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 message in c

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

2013-12-15 Thread Frans Marcelissen
tp://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://www.digipsy.nl/>) Pomperschans 26 5595 AV Leende tel: 040 2065030/06 2325 06 53 sky

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

2013-11-14 Thread 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 > and provide commented, minimal, self-con

[R] strange conversion char to date

2013-08-30 Thread Frans Marcelissen
oes anyone know why? And is there a simple way to specify the date? (does works 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

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

2013-04-02 Thread Frans Marcelissen
-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

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()) Fra

[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). T

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 : > Try > > sub("[(]","", names(dataFrams) > > and > > sub("[)]&qu

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 > > 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: > >

[R] How to findout the name of a dataframe

2013-02-17 Thread Frans Marcelissen
ydata['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/

[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, connected()<-function(

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: r-help-boun...

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
Frans   -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

[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
n, but p+theme(plot.margin= unit(c(0, 0, 0,3), "cm")) doesn't 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

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: amailto:r-help-boun...@r-project.org] Namens Duncan Murdoch Verzonden: vrijdag 5 oktober 2012 14:26 Aan: Berry Boessenkool CC: R Help Onderwerp: Re: [R] avoid <<- in specific case On 05/10/2012 8:19 AM, Berry Boessenkool

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: w

[R] rstudio client on the i-pad

2012-09-13 Thread Frans Marcelissen
now 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

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 [mailto:r-help-boun...@r-project.

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

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- V

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

[R] odfWeave, xtable and tex

2012-06-14 Thread Frans Marcelissen
Hello, I try to use xtable under odfWeave. With <>= library(xtable) xtable(iris) @ this results in an endless list of "xmlParseEntityRef: no name" On internet I find that results should be tex: <>= However, now the result is: 'arg' shoul

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

[R] cannot install Rcmdr on ubuntu 11.4

2011-06-16 Thread Frans Marcelissen
idea which 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] 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 score