Re: [R] Reading multiple files from different folders

2015-08-13 Thread PIKAL Petr
Hi First you shall move your folders to some other place than c:. Let say c:\project\country\... after that you can list folders by ?list.dirs and files by ?list.files. you can then navigate directories by ?setwd, ?getwd and read files from them. The exact code depends on what exactly you

[R] How to obtain the unique communities when plotting VENNs?

2015-08-13 Thread Krissey
Hey there guys. I am having a question about Venn diagrams. A colleague wrote a script based on the VennDiagram package a while ago, that I was able to adapt for my data. I wanted a Venn for the soil bacterial communities derived from forests of 4 different tree species. It worked fine for me,

[R] R: help with metasens

2015-08-13 Thread Mario Petretta
Obviously metafor and not metaphor. Sorry Mario [[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

[R] R: help with metasens

2015-08-13 Thread Mario Petretta
Many thanks for your suggestion. I will try a new database search and the hc metaphor function. Mario PS: what is diagonal bacn? -Messaggio originale- Da: Michael Dewey [mailto:li...@dewey.myzen.co.uk] Inviato: mercoledì 12 agosto 2015 18.19 A: petre...@unina.it; r-help@r-project.org

Re: [R] Doing PDF OCR with R

2015-08-13 Thread Duncan Murdoch
On 13/08/2015 1:29 AM, Jeff Newmiller wrote: This code is using R like a command shell... there really is not much chance that R is the problem, and this is not a tesseract support forum, so this seems quite off-topic. I would have guessed the same, but the error message looks like an R

Re: [R] add an idx column to the matrix

2015-08-13 Thread PIKAL Petr
Hi the error is not caused by missing 2 set.seed(333) x-sample(0:1, 12, rep=T) dim(x)-c(3,4) x[2,2]-NA cbind(x, idx=(rowSums(x==2, na.rm=TRUE)0)*1) idx [1,] 0 1 1 0 0 [2,] 0 NA 0 0 0 [3,] 1 1 0 0 0 As Sarah pointed out, you are the only one observing such error.

[R] Finding top 25% observations in Dplyr

2015-08-13 Thread Shivi82
Hi All, I am working on a dataset baseball where i am grouping based on one var income in descending order. Now i need to find the top 25% of the observations from the income group for which i used top_n (0.25) but it is not finding the desired. Can you please suggest. Baseball%%

Re: [R] Finding top 25% observations in Dplyr

2015-08-13 Thread John Kane
I don't know how to do it in plyr but xx - seq(1:300) nn - trunc( length(xx)/4) yy - xx[nn, ] should come close. Have a look at ?ceiling or ?floor as an alternative to trunc() John Kane Kingston ON Canada -Original Message- From: shivibha...@ymail.com Sent: Thu, 13 Aug 2015

Re: [R] Crosstabulation with a frequency variable

2015-08-13 Thread Sarah Goslee
Hi, There are lots of ways to do it in base R, but a long time ago I got frustrated and wrote a crosstab function that did exactly what I wanted: library(ecodist) mydata - data.frame(var1=c(0,0,1,1),var2=c(0,1,0,1),freq=c(11,12,13,14)) crosstab(var1, var2, freq, data=mydata) 0 1 0 11 12 1

Re: [R] Basic editing of XML file

2015-08-13 Thread Ben Tupper
Hi, Your email client is set to send in HTML format which has mangled your message. Please set your client to send plain text to R-help. You could use the XML package to modify the attributes of a given node. library(XML) # make an reproducible example z - newXMLNode(BLABLA, + attrs =

Re: [R] Crosstabulation with a frequency variable

2015-08-13 Thread Marc Schwartz
Hi, As Sarah noted, there are a variety of ways in R to accomplish this, such as: DF - data.frame(var1 = c(0, 0, 1, 1), var2 = c(0, 1, 0, 1), freq = c(11, 12, 13, 14)) xtabs(freq ~ var1 + var2, data = DF) var2 var1 0 1 0 11 12 1 13 14 See ?xtabs Regards, Marc Schwartz On

Re: [R] Crosstabulation with a frequency variable

2015-08-13 Thread Bert Gunter
Well, just using base R, ... with(mydata,tapply(freq,list(var1,var2),I)) 0 1 0 11 12 1 13 14 Cheers, Bert Bert Gunter Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. -- Clifford Stoll On Thu, Aug 13, 2015 at 6:39 AM, Sarah Goslee

Re: [R] R: help with metasens

2015-08-13 Thread Michael Dewey
diagonal bacn is a typo, sorry for that. My brain meant to type diagonal band, ie going in this case from north west to south east but my fingers failed completely. On 13/08/2015 10:25, Mario Petretta wrote: Many thanks for your suggestion. I will try a new database search and the hc

[R] Basic editing of XML file

2015-08-13 Thread Robert U
Dear RUser,I’m tryingto operate some very slight editing to the values of an XML file. I looked abit everywhere and it appears that dealing with XML files is not that easy… besidemy XML files might be a bit weirdly structured. Anyway, let me give you an exampleof it : Root(xmlfile)BLABLA

[R] Crosstabulation with a frequency variable

2015-08-13 Thread Dean1
Hi all, I've had a few years experience with R, which is why this is so frustrating, my problem seems so simple but I can't find a solution. I have a data frame in the following form: data.frame(var1=c(0,0,1,1),var2=c(0,1,0,1),freq=c(11,12,13,14)) How do I create a crosstab with frequencies?

Re: [R] How to obtain the unique communities when plotting VENNs?

2015-08-13 Thread John Kane
Hi Krissey, I don't have an answer for you but here are some hints on how to ask questions on R-help. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and http://adv-r.had.co.nz/Reproducibility.html In particular we probably need your actual code and some

[R] georeferencing image from scratch

2015-08-13 Thread Marcelo Kittlein
Hi all I want to change a MSS landsat image which has bad georeferencing. I have a grid of points with correct georeferences and want to use them to reproject the image to a correct reference system. Is there some way to this with raster or other packages? in idrisi I used to resample the

Re: [R] Crosstabulation with a frequency variable

2015-08-13 Thread Bert Gunter
Yes and yes. To be clear, 1. sum() is better. 2. xtabs is better (I just forgot about it and didn't bother to search). Maybe the best answer is in fact, ??crosstabulation which would have brought up xtabs(). So the moral is (to the OP), learn how to search before posting. Cheers, Bert Bert

[R] georeferencing image from scratch

2015-08-13 Thread kittlein
I want to change a MSS landsat image which has bad georeferencing. I have a grid of points with correct georeferences and want to use them to reproject the image to a correct reference system. Is there some way to this with raster or other packages? in idrisi I used to resample the image using a

[R] lme4 package installation

2015-08-13 Thread aurora . gonzalez
Hello I've downloaded the tar.gz file of the package lme4 and when I use the coomand: install.packages(lme4_1.1-8.tar.gz, repos = NULL, type = source) appears an error that suspends the installation: In file included from external.cpp:8:0: predModule.h:12:23: fatal error: RcppEigen.h: No

Re: [R] Crosstabulation with a frequency variable

2015-08-13 Thread peter dalgaard
On 13 Aug 2015, at 16:24 , Bert Gunter bgunter.4...@gmail.com wrote: Well, just using base R, ... with(mydata,tapply(freq,list(var1,var2),I)) 0 1 0 11 12 1 13 14 If you insist on avoiding the stats package... However, I'd use sum() rather than I() to get an xtabs() workalike. -pd

Re: [R] lme4 package installation

2015-08-13 Thread Thierry Onkelinx
Have you trying installing it directly from CRAN? install.packages(lme4) Do you have all dependencies installed? install.packages() from CRAN will take care of that. You repos = NULL you have to install all dependencies manually. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek /

Re: [R] How to obtain the unique communities when plotting VENNs?

2015-08-13 Thread Krissey
Thanks a lot John - I will set up a new post and hopefully do better :) -- View this message in context: http://r.789695.n4.nabble.com/How-to-obtain-the-unique-communities-when-plotting-VENNs-tp4711056p4711081.html Sent from the R help mailing list archive at Nabble.com.

[R-es] [Help] Oferta de trabajo en Valencia

2015-08-13 Thread Javier Villacampa González
Un excompañero de trabajo ofrece trabajo a expertos en machine learning y geolocalización. Bueno, lo de expertos es un decir, basicamente lo que quieres es un joven con ganas de aprender aunque no sepa mucho. Os pongo el enlace por si a alguien le interesa. Un abrazo

[R] Error: Gradient function might be wrong - check it! OPTMX

2015-08-13 Thread Olu Ola via R-help
Hello, I am trying to estimate a non-linear GMM in R using Optimx. However, when I do the start test to compare my analytical gradient with the numerical gradient, I get the following error message Error: Gradient function might be wrong - check it! Below are the print out of my analytical and

Re: [R] add an idx column to the matrix

2015-08-13 Thread Lida Zeighami
Hi dear all, Yes, your solution all are correct! it was my mistake and I found it. Thanks On Thu, Aug 13, 2015 at 1:07 AM, PIKAL Petr petr.pi...@precheza.cz wrote: Hi the error is not caused by missing 2 set.seed(333) x-sample(0:1, 12, rep=T) dim(x)-c(3,4) x[2,2]-NA

Re: [R] Error: Gradient function might be wrong - check it! OPTMX

2015-08-13 Thread ProfJCNash
There are tolerances in the checks, and sometimes scaling of the problem leads to false positives on the checks. Try control = list(starttest=FALSE, etc.) to suppress the test. JN On 15-08-13 01:20 PM, Olu Ola via R-help wrote: Hello, I am trying to estimate a non-linear GMM in R using

Re: [R] stringr package question

2015-08-13 Thread Mauricio Romero
thanks that makes sense... in the previous version of R it worked for some reason. On Thu, Aug 13, 2015 at 4:33 PM, Sarah Goslee sarah.gos...@gmail.com wrote: Hi, The + is a special character in regular expressions. If you want to match a literal + you need to escape it:

[R-es] Curso R por Microsoft

2015-08-13 Thread Javier Rubén Marcuzzi
Estimados Vi publicado un curso sobre R donde Microsoft está interesado, desconozco si nos es de utilidad, pero creo que es bueno que una empresa con mucho capital económico como tecnológico invierta en R. Habrá que esperar a futuro para ver los resultados y si son de nuestro agrado, pero por

Re: [R] stringr package question

2015-08-13 Thread Jeff Newmiller
Seems more likely to be related to changes in the options stringr uses when it invokes the regex code? See the different response coming from base R when told to use a different regex engine: grep( +proj, syz+project ) [1] 1 grep( +proj, syz+project, perl=TRUE ) Error in grep(+proj,

Re: [R] stringr package question

2015-08-13 Thread Sarah Goslee
Hi, The + is a special character in regular expressions. If you want to match a literal + you need to escape it: str_extract(+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0, \\+proj=[a-zA-Z0-9]*) Sarah On Thu, Aug 13, 2015 at 2:55 PM, Mauricio Romero

[R] stringr package question

2015-08-13 Thread Mauricio Romero
Hi, I'm running R 3.2.1 and im having an unexpected problem... when I run the follwing code it returns an error library(stringr) str_extract(+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0, +proj=[a-zA-Z0-9]*) But I can't find whats wrong with my code. Thanks

Re: [R] String Matching

2015-08-13 Thread MacQueen, Don
I haven't tested this, but what about: df - data.frame(mtch=c(matchString, string1, string2)) grep(searchString, df$mtch, ignore.case=FALSE) Depending on what your next step is, you might prefer grepl. Sometimes using fixed=TRUE in grep() helps. -Don -- Don MacQueen Lawrence Livermore

Re: [R] stringr package question

2015-08-13 Thread Jeff Newmiller
+ is a special character in regular expressions that requires a preceding pattern to apply to. See ?base::regex. You need to escape the special with a backslash to remove the special behavior, and escape the backslash so the R parser will be happy. str_extract(+proj=utm +zone=19 +datum=WGS84

Re: [R] lme4 package installation

2015-08-13 Thread Teck Kiang Tan
Hi all I have problem in installation lme4 and have tried over the past 2 days. It failed to install from the various countries. install.packages(lme4) Warning: unable to access index for repository http://cran.stat.nus.edu.sg/src/contrib Warning: unable to access index for repository

[R] having error of downloading multiple files from password protected ftp in R

2015-08-13 Thread Jia Shen
Hi all, I'm trying to download a bunch of files from a credential needed ftp address using R.* Below is my code:* == library(RCurl) url - ftp://xxx.com; userpwd - user:pwd filenames - getURL(url, userpwd = userpwd, ftp.use.epsv = FALSE,dirlistonly = TRUE) fn -

[R] Need help with Multi-line forestplots in R

2015-08-13 Thread mcknight e. (em8g14)
Hello, I am working on ecological data covering a meta-analysis on invasive species traits. I am not very skilled in R and would love if someone could assist me in my production of multi-line forest plots. The data I have is: random effects mixed model and

[R] Multi-line forestplots, how to in R

2015-08-13 Thread mcknight e. (em8g14)
Hello, I am working on ecological data covering a meta-analysis on invasive species traits. I am not very skilled in R and would love if someone could assist me in my production of multi-line forest plots. The data I have is: random effects mixed model and is further divided into subsets,

[R] Parallel Processing

2015-08-13 Thread Glenn Schultz
Helllo All, Need some help understanding parallel processing.  I set-up DoParallel and worked perfectly.  I tried to set-up using parallel package following the book Parallel R but I get the following error: Error in checkForRemoteErrors(val) :    4 nodes produced errors; first error: 'what'

Re: [R] lme4 package installation

2015-08-13 Thread Uwe Ligges
On 13.08.2015 22:52, Teck Kiang Tan wrote: Hi all I have problem in installation lme4 and have tried over the past 2 days. It failed to install from the various countries. install.packages(lme4) Warning: unable to access index for repository http://cran.stat.nus.edu.sg/src/contrib This