gmane.comp.lang.r.general
http://blog.gmane.org/gmane.comp.lang.r.general
hourly11901-01-01T00:00+00:00Gmanehttp://gmane.org/img/gmane-25t.png
http://gmane.org
Need help with R in Boston area this Friday-Sunday paid gig
http://comments.gmane.org/gmane.comp.lang.r.general/313643
<pre>I have a project that I have to do this Friday-Sunday. I have 2 dirty excel
spreadsheets that I need brought into R, cleaned up, and then some
descriptive statistics run. I am very new to R and not having fun. I can
pay, but you will need to 1) be expert and 2) be willing to show me how the
work is done and 3) be patient.
respond if interested.
[[alternative HTML version deleted]]
</pre>Richard Lerner2014-09-24T02:20:07Optometrists and Ophthalmologists dataset
http://comments.gmane.org/gmane.comp.lang.r.general/313642
<pre>Hi,
Hope you are doing well.
My name is Tony I came across your company website and I could see
Optometrists and Ophthalmologists is your one of the targeted specialist, so
I thought of asking if you would be interested in acquiring a complete
data-set of Optometrists and Ophthalmologists?
Total contacts available:
</pre>Tony Parker2014-09-23T21:50:01taking daily modes from hourly data
http://comments.gmane.org/gmane.comp.lang.r.general/313641
<pre>Dear all,
I have a data frame (datos) of hourly wind speed and direction with 4columns (1st date, 2nd hour, 3rd wind speed and 4rth wind direction). I have been able to do the daily mean of the wind speed, but when I try to get the more frequent wind direction of every day, it doesn't work. I have tried to do it with aggregate function, but it only works for mean, max, min...
mean_wind<- aggregate(datos[range_of_dates,col_wind_speed],
list(date=format(as.Date(datos[range_of_dates,col_dates],"%d/%m/%Y"),"%d/%m/%Y")),
FUN=mean, na.rm=TRUE) #it works perfectly
mode_wind<- aggregate(datos[range_of_dates,col_wind_direction], list(date=format(as.Date(datos[range_of_dates,col_dates],"%d/%m/%Y"),"%d/%m/%Y")), FUN=mode) #it tells me "numeric"
Can anyone help me? My data have not the same length for each day, I mean, for example it is possible that for 1st of January I have 20 hours of data, but for the 2nd of January I have 24, or the 3rd of January I have 18...so I need to aggregate the data to calculate the </pre>maria cabello2014-09-23T13:40:22Is there a log file on Window keeping track of the history of package installation (when was a package installed and what package was installed)?
http://comments.gmane.org/gmane.comp.lang.r.general/313640
<pre>I'm using a package and need to keep track of the version of the database used. Initially, I was under the impression that the package was querying a remote database live and therefore the data version would be the date of my query. This turned out to be an incorrect assumption, and the database actually came with the package. Unfortunately, as I encountered discrepancy between different version of the data, I reinstalled the package and overwrite the original installation date. I wonder whether there is a log file keeping track of when and what package was installed in the system (I think Linux has one). Many thanks! -Qingqin
[[alternative HTML version deleted]]
</pre>Li, Qingqin [JRDUS]2014-09-23T18:29:32Error Reading from Connection
http://comments.gmane.org/gmane.comp.lang.r.general/313637
<pre>Hello,
I am running Rx64 3.03 under Windows 8 environment. I have been getting the following error.
when running some of my old R applications. Below is a mock-up example.
Could someone please help me resolve the issue?
Thanks,
Pradip Muhuri
setwd ("D:/")
Error: error reading from connection
Error in str(heroin) : object 'heroin' not found
[[alternative HTML version deleted]]
</pre>Muhuri, Pradip (SAMHSA/CBHSQ2014-09-24T00:36:59R Inter Process Communication tools/packages ?
http://comments.gmane.org/gmane.comp.lang.r.general/313623
<pre>
Hello All,
Is there any IPC tools like in UNIX/Linux systems in R ?
I know there is mmap package but I am looking something more like sockets .
Any example appreciated .
Thx .
</pre>ce2014-09-23T15:50:28How to combine character month and year columns into one column
http://comments.gmane.org/gmane.comp.lang.r.general/313622
<pre>Dear R users,
I have a data with month and year columns which are both characters
and wanted to create a new column like Jan-1999
with the following code. The result is all NA for the month part. What
is wrong with the and what is the right way to combine the two?
ddf$MonthDay <- paste(month.abb[ddf$month], ddf$Year, sep="-" )
Thanks
structure(list(month = c("01", "02", "03", "04", "05", "06",
"07", "08", "09", "10", "11", "12"), Year = c("1999", "1999",
"1999", "1999", "1999", "1999", "1999", "1999", "1999", "1999",
"1999", "1999"), views = c(42, 49, 44, 38, 37, 35, 38, 39, 38,
39, 38, 46), MonthDay = c("NA-1999", "NA-1999", "NA-1999", "NA-1999",
"NA-1999", "NA-1999", "NA-1999", "NA-1999", "NA-1999", "NA-1999",
"NA-1999", "NA-1999")), .Names = c("month", "Year", "views",
"MonthDay"), row.names = 109:120, class = "data.frame")
</pre>Kuma Raj2014-09-23T15:41:39division of col by the sum of the col
http://comments.gmane.org/gmane.comp.lang.r.general/313620
<pre>Hi,
If I want to divide the column of a matrix by the sum of the column, should I loop over the columns or can I use apply family?
Regards,
Carol
[[alternative HTML version deleted]]
</pre>carol white2014-09-23T15:10:37Copying tables from R to Excel
http://comments.gmane.org/gmane.comp.lang.r.general/313616
<pre>Dear Subscribers,
I've found this recommendation to paste an R table to Excel:
HTML.matrix( summary(iris), file("clipboard", "w"), append=F )
# paste into Excel
After installing R2HTML and writting that command, I get:
Error: could not find function "HTML.matrix"
Any clue?
Thank you very much,
Angel Rodr</pre>Angel Rodriguez2014-09-23T13:04:22ANOVA and permutation tests : beware of traps
http://comments.gmane.org/gmane.comp.lang.r.general/313612
<pre>Recently, I came across a strange and potentially troublesome behaviour of the lm and aov functions that ask questions about calculation accuracy. Let us consider the 2 following datasets dat1 & dat2 :
Y F
1 1 A
2 2 A
3 3 A
4 11 B
5 12 B
6 13 B
Y F
1 11 A
2 12 A
3 13 A
4 1 B
5 2 B
6 3 B
They only differ in the order of values that were exchanged between samples A and B. Thus the sd is 1 for each sample in either data sets, and the absolute mean difference |A-B| is 10 in both datasets.
Now, let us perform an anova to compare samples A and B in both datasets (of course, in such simple case, a bilateral T test would do the job, but an anova is nevertheless allowed and should give the same probability than Student's test):
Analysis of Variance Table
Response: Y
Df Sum Sq Mean Sq F value Pr(>F)
F 1 150 150 150 0.0002552 ***
Residuals 4 4 1
Analysis of Variance Table
Response: Y
Df Sum Sq Mean Sq F value Pr(>F) </pre>Stéphane Adamowicz2014-09-23T07:14:24Using factor levels as coordinates with geom_rect
http://comments.gmane.org/gmane.comp.lang.r.general/313611
<pre>Hi,
With ggplot2 I can use the following to create a rectangle
geom_rect(aes(ymin=as.Date("8-Apr-2014", format="%d-%b-%Y"),
ymax=as.Date("30-Apr-2014", format="%d-%b-%Y"),
xmin="node002",xmax="node098"),
where the x values are levels of a factor. This works if I want the
rectangle to extend across a range of factor level. My question is this:
How can I create a similar rectangle around a single factor level?
My assumption is that I should be able to convert the factor to a
numerical value. I could then subtract and add a smaller number to
obtain xmin and xmax, respectively. However, I don't know how to
convert the factor level to a value which corresponds to its
x-coordinate on the plot.
I posted a longer version of this question on StackOverflow with the
full code, input data, and a plot of the output:
http://stackoverflow.com/questions/25872633/using-factor-levels-with-geom-rect
Unfortunately, I didn't get an answer.
Cheers,
Loris
</pre>Loris Bennett2014-09-23T07:05:36Confused by dlnorm - densities do not match histogram
http://comments.gmane.org/gmane.comp.lang.r.general/313609
<pre>Good evening! I'm running into some surprising behavior with dlnorm() and
trying to understand it.
To set the stage, I'll plot the density and overlay a normal distribution.
This works exactly as expected; the two graphs align quite closely:
qplot(data=data.frame(x=rnorm(1e5,4,2)),x=x,stat='density',geom='area') +
stat_function(fun=dnorm,args=list(4,2),colour='blue')
but then I change to a log normal distribution and the behaviour gets
odd. The distribution looks nothing like the density plot:
qplot(data=data.frame(x=rlnorm(1e5,4,2)),x=x,log='x',stat='density',geom='area') + stat_function(fun=dlnorm,args=list(4,2),colour='blue')
I thought the issue might be scale transformation - if dlnorm is giving the
density per unit x this is not the same as the density after transforming
to log(x). So I tried to effect this scale transformation manually by
dividing by the derivative of log(x) - i.e. by multiplying by x - but this
also did not match:
qplot(data=data.frame(x=rlnorm(1e5,4,2)),x=x,log='x',stat='den</pre>Terran Melconian2014-09-23T02:59:19robCompositions: Using impCoda
http://comments.gmane.org/gmane.comp.lang.r.general/313605
<pre> I need to learn how to apply the methods in robCompositions and have read
the package docs. Two of my six data sets of proportions contain missing
values (not collected or not present); one set has a single missing value,
the other has 3 missing values. So my first task is to learn how to properly
apply the impCoda() method to my data to impute values for those that are
missing. After reading ?impData and emulating the syntax on that help page,
without understanding how to select appropriate options for the various
components, I end up with errors and have no clue how to correctly format
the command.
The data frame:
burns.co
Filterer Gatherer Grazer Predator Shredder
date2000-07-18 0.0550 0.5596 0.0734 0.2294 0.0826
date2003-07-08 0.0734 0.6147 0.0183 0.2294 0.0642
date2005-07-13 0.1161 0.5714 0.0357 0.1696 0.1071
date2006-06-28 0.1000 0.4667 0.1500 0.1333 0.1500
date2010-09-14 0.0778 0.6111 0.0444 0.1889 0.0778
date2011-07-13 0.0879 0.5714 0.06</pre>Rich Shepard2014-09-22T22:32:23Error in quantile.default(resids) : missing values and NaN's not allowed if 'na.rm' is FALSE
http://comments.gmane.org/gmane.comp.lang.r.general/313603
<pre>About a year ago I ran some analyses using lmer. The general syntax was:
mlm <- lmer(var1 ~ (1|dyad) + var2 + var3*var4*var5, na.action=na.exclude);
summary(mlm)
The model ran fine and I saved the output. I've recently turned back to
those analyses, however, the model no longer runs. I get the following
error:
Error in quantile.default(resids) :
missing values and NaN's not allowed if 'na.rm' is FALSE
I've searched the online forums and found that this topic has not been
touched upon since 2006, and at that time someone had indicated that it was
a bug that had been resolved. I am using the most current version of lme4,
so if the bug is fixed I am unsure why I am experiencing this problem.
I have since run the model using lmer's default for handling missing data
(na.omit), but found the results do not match what I had saved previously
when using na.exclude.
If anyone has an insight here I'd be very appreciative.
Kind regards,
Chad
</pre>Chad Danyluck2014-09-22T20:31:46error in rownames
http://comments.gmane.org/gmane.comp.lang.r.general/313602
<pre>Dear fellow R users,
I am trying to run the random forest and Yaimpute packages in R to
impute a grid to project in a gis. However, after running the
imputation I keep getting an error in the rownames. This sounds simple
enough, but I cannot figure out what these rownames are reffering to.
Any ideas? I am fairly new to R so im sure it is an easy fix. Any help
would be awesome.
Thanks,
Chris
select = c(sinaspect, habitat, slope, elevation, cosaspect, disttoroad,
disttowat)) > type.rf <- yai(x=x, y=y, method="randomForest",
rfMode="regression", ntree= 2000) > outfile <- list(Type =
"D:/R_Desktop_Data/RF_RespSurf/RespSurf_Reg.asc") > xfile <-list(sinaspect
="C:/Users/jacksonjordancm/Desktop/R_Desktop_Data/RF_NNimp/ModelI/ASCII_Files2/sinaspect.asc",
habitat
="C:/Users/jacksonjordancm/Desktop/R_Desktop_Data/RF_NNimp/ModelI/ASCII_Files2/habitat.asc",
elevation
="C:/Users/jacksonjordancm/Desktop/R_Desktop_Data/RF_NNimp/ModelI/ASCII_Files2/elevation.asc",
disttowat
="C:/Users/jacksonjordancm/Desktop/R_Desktop_</pre>Chris Jackson-Jordan2014-09-22T16:13:08Plotting boundary lines from shapefiles overtop a map of Canada
http://comments.gmane.org/gmane.comp.lang.r.general/313601
<pre>Hi. I have a requirement to plot a series of points on a map of Canada along with boundaries defining search and rescue (SAR) regions. I have been successful in plotting the map of Canada (Lambert projection) and the points, but I have been unable thus far to plot the SAR regions on top of the map. I'm at the point now where I need help to resolve the issue.
To plot the map of Canada, I have used the following line of code:
map(database= "worldHires","Canada", ylim=c(39,90), xlim=c(-150,-25), col=alpha("grey90",0.5), fill=TRUE, projection="lambert", param=c(50,65))
Note that the ylim and xlim limits go wider that the actual coordinates of Canada, but that is necessary because the SAR regions go out to sea quite a distance. Also, I need the map to go all the way to the North Pole.
To plot the points, I have used a "dummy" list of points which I will eventually replace with my real data. I convert the points to the lambert projection on the fly using the following lines of code:
lon <- c(</pre>Alain Dubreuil2014-09-22T15:27:46Dynamic regex/sub changes to function
http://comments.gmane.org/gmane.comp.lang.r.general/313591
<pre>Howdy,
I have searched the lists and can not seem to find a solution to my
problem. I need to be able to dynamically modify a string inside a
function to build a new function. "sub" replaces with a quoted
string... and "parse" of "sub" returns expression... How can I get an
unquoted string from a regex to stick into a "body" of a function?
Thanks for your help!
dan
# Original Function
fsong=function(x){
song=paste("my name is fuka,",x)
return(song)
}
fsong("I live on the second floor")
#
# Copy and modify using "sub" returns quoted string with escaped quotes
# internally... as expected.. which can not be evaluated.
nsong=fsong
body(nsong)[[grep("fuka",body(nsong))]]=
sub("fuka","muka",list(body(fsong)[[grep("fuka",body(fsong))]]))
nsong("I live on the second floor") # broken
#
# Copy and modify with "parse" of "sub", returns expression.. but
without quotes,
# o getting closer.
#
nsong=fsong
body(nsong)[[grep("fuka",body(nsong))]]=
parse(text=sub("fuka","muka",list(body(fsong)[[grep("fuka",bo</pre>Daniel Fuka2014-09-22T13:16:54Course Lisbon: Introduction to Linear mixed effects models, GLMM and MCMC with R
http://comments.gmane.org/gmane.comp.lang.r.general/313590
<pre>Apologies for cross-posting
We would like to announce the following statistics course:
Course: Introduction to Linear mixed effects models, GLMM and MCMC with R
Location: Lisbon, Portugal
Date: 9 - 13 February, 2015
Course website: http://www.highstat.com/statscourse.htm
Course flyer: http://www.highstat.com/Courses/Flyer2015_2Lisbon_GLMM.pdf
Kind regards,
Alain Zuur
</pre>Highland Statistics Ltd2014-09-22T12:42:46splm package: Spatial weights matrix of the 103 Italianprovinces
http://comments.gmane.org/gmane.comp.lang.r.general/313587
<pre>Hello,
I'm using the spatial weights matrix of the 103 Italian provinces
"itaww" of the package splm
example:
library(splm)
data(itaww)
itaww
It is a matrix of 103 rows and 103 columns. Each row (and each column)
corresponds to an italian province and I would like to know the row's
names of the matrix (currently defined by numeric ID).
Thank you for your help
Alfonso
******************************************************************************
IL MERITO DEGLI STUDENTI VIENE RICONOSCIUTO
Il 5 per mille all'Universita' degli Studi di Napoli "Parthenope" incrementa le borse di studio agli studenti - codice fiscale 80018240632
http://www.uniparthenope.it/index.php/5xmille
Questa informativa e' inserita in automatico dal sistema al fine esclusivo della realizzazione dei fini istituzionali dell'ente.
</pre>alfonso.carfora< at >uniparthenope.it2014-09-22T09:16:09How to get data from elastic search
http://comments.gmane.org/gmane.comp.lang.r.general/313585
<pre>Hi,
I want to get daat from elastic search in R.I am using package elastic
to get data but it is not giving data as a data frame in R.It is
returning data as a list which is giving following error when i am
viewing it.It is giving same problem when I am using fromjson() function
of rjson package.
>View(sample)
Error in data.frame(wasRetweetedByMe = FALSE, entityLocation =
"Bakhundole Lalitpur, Nepal", :
arguments imply differing number of rows: 1, 2, 0
Please help me how to get data from elastic search as a data frame to
analyse it.
Thanks
Madhvi
</pre>madhvi.gupta2014-09-22T06:28:38bivariate ordered probit model
http://comments.gmane.org/gmane.comp.lang.r.general/313583
<pre>Dear colleagues:
I am searching for an R package that could estimate a bivariate ordered
probit model. I am aware of the bivariate probit model in R:
http://cran.r-project.org/web/packages/ZeligChoice/vignettes/ZeligChoice-manual.pdf
However, I am searching for a model that is similar to the one described in
http://www.adeptanalytics.org/download/ado/bioprobit/bioprobit.pdf.
I truly appreciate your help with this.
Best regards,
Murtaza
[[alternative HTML version deleted]]
</pre>Murtaza Haider2014-09-22T00:51:57Search EngineSearch the mailing list at Gmanequery
http://search.gmane.org/?group=$group=gmane.comp.lang.r.general