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
Using R to fit a curve to a dataset using a specific equation
http://comments.gmane.org/gmane.comp.lang.r.general/322717
<pre>Hi there
I would like to use a specific equation to fit a curve to one of my data
sets (attached)
structure(list(Gossypol = c(1036.331811, 4171.427741, 6039.995102,
5909.068158, 4140.242559, 4854.985845, 6982.035521, 6132.876396,
948.2418407, 3618.448997, 3130.376482, 5113.942098, 1180.171957,
1500.863038, 4576.787021, 5629.979049, 3378.151945, 3589.187889,
2508.417927, 1989.576826, 5972.926124, 2867.610671, 450.7205451, 1120.955,
3470.09352, 3575.043632, 2952.931863, 349.0864019, 1013.807628, 910.8879471,
3743.331903, 3350.203452, 592.3403778, 1517.045807, 1504.491931,
3736.144027, 2818.419785, 723.885643, 1782.864308, 1414.161257, 3723.629772,
3747.076592, 2005.919344, 4198.569251, 2228.522959, 3322.115942,
4274.324792, 720.9785449, 2874.651764, 2287.228752, 5654.858696,
1247.806111, 1247.806111, 2547.326207, 2608.716056, 1079.846532), Treatment
= structure(c(2L, 3L, 4L, 5L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 5L, 1L, 2L, 3L,
4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L,
3L, 4</pre>Michael Eisenring2015-08-01T15:17:22missing data in R
http://comments.gmane.org/gmane.comp.lang.r.general/322713
<pre>Hello Mr. FeldesmanI am a master student in biostatistic
my thesis about missing values in microarray data, but </pre>asena ayça özdemir2015-08-01T12:21:40Error when compiling R-2.5.1 / *** [d-p-q-r-tests.Rout] Fehler 1
http://comments.gmane.org/gmane.comp.lang.r.general/322711
<pre>Hi everyone,
I am new to Linux and R - but I managed to build R-2.5.1 from source to use
it in Genepattern. Genepattern does only support R-2.5.1 which I could not
find anywhere for installation via apt-get or in the Ubuntu Software-Centre
(I am using Ubuntu 14.04 (Trusty Tahr) 32-bit)
But after doing
make check
I get
comparing 'method-dispatch.Rout' to './method-dispatch.Rout.save' ... OK
running code in 'd-p-q-r-tests.R' ...make[3]: *** [d-p-q-r-tests.Rout]
Fehler 1
make[3]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make[2]: *** [test-Specific] Fehler 2
make[2]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make[1]: *** [test-all-basics] Fehler 1
make[1]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make: *** [check] Fehler 2
but I can make install and use R for simple plots etc. afterwards - still I
am worried something is wrong, can you give some advice.
A closer look at the error gives
+ diff(y) > 0, # i.e. pf(1,1, *)</pre>Joerg Kirschner2015-08-01T05:48:13Clarification on Simulation and Iteration
http://comments.gmane.org/gmane.comp.lang.r.general/322706
<pre>Dear All,
I am performing some simulations for a new model. I run about 10,000 iterations with a sample of 50 datasets and this returns one set of 50 simulated data.
Now, what I need to obtain is 10 sets of the 50 simulated data out of the 10,000 iterations and not just only 1 set. The model is the Copas selection model for publication bias in Mete-analysis. Any one who knows this model has any suggestion for the improvement of my code is most welcome.
Below is my code.
Kind regards
Chris Guure
University of Ghana
install.packages("msm")
library(msm)
rho1=-0.3; tua=0.020; n=50; d=-0.2; rr=10000; a=-1.3; b=0.06
si<-rtnorm(n, mean=0, sd=1, lower=0, upper=0.2)# I used this to generate standard errors for each study
set.seed(21111) ## I have stored the data and the output in this seed
for( i in 1:rr){
mu<-rnorm(n,d,tua^2) # prob. of each effect estimate
rho<-si*rho1/sqrt(tua^2 + si^2) # estimate of the correlation coefficient
mu0<- a + b/si # mean of the truncated no</pre>Christopher Kelvin via R-help2015-08-01T01:36:12Exclude 2014 data from mean
http://comments.gmane.org/gmane.comp.lang.r.general/322699
<pre>Hello R-help,
I am trying to compute the mean of a quarterback's career fantasy football
stats, but I wish to exclude his 2014 stats from the mean, as that will be
the test data for the model I am trying to build for my academic undergrad
research.
The code for figuring out the mean of his Yds for every career Game 1 was
simple:
*mean(brady.t$Yds[brady.t$G. == 1])*
How can I make an "if-then" statement though so that his 2014 stats are
excluded? Or is there an easier way besides "if-then?"
Thank you,
AKJ
[[alternative HTML version deleted]]
</pre>Adam Jauregui2015-07-31T18:49:51x11() hangs in 3.2.1
http://comments.gmane.org/gmane.comp.lang.r.general/322698
<pre>I'm on RHEL 6.6, R version 3.2.1 Patched (2015-07-30 r68761) --
"World-Famous Astronaut". Issuing the x11() command hangs R and
does not complete. A window is partially drawn then freezes.
Does anyone know of a solution?
Thanks,
Steve
</pre>Steven Backus2015-07-31T19:22:44trojan with R download
http://comments.gmane.org/gmane.comp.lang.r.general/322692
<pre>
I am working in China for a month and needed to download an earlier version of R in order to use Deseq2 and its requirements. The download got to the last few seconds and hung up. A trojan was found. It could be coincidence that it happened when I was downloading R, or perhaps a man in the middle added a little something. Anyway, I thought you might be interested. You might want to check on this source and others from this server.
https://mirrors.ustc.edu.cn/CRAN/bin/windows/base/old/3.0.3/R-3.0.3-win.exe
</pre>tom walk2015-07-31T10:55:21question about implementation of the R
http://comments.gmane.org/gmane.comp.lang.r.general/322691
<pre>Dear Sir/MadamPlease provide me with the information how to implement R, what is a steps of implementation and obligations, difficulties and etc.
thank you in advance Mr. Beka Biashvili
Quality Management System
ISO 9001:2008 Lead Auditor
18 Lortkipanidze street, Tbilisi, Georgia.
mob: +995 599 414547
[[alternative HTML version deleted]]
______________________________________________
R-help< at >r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.</pre>Beka Biashvili via R-help2015-07-31T13:38:32R parallel / foreach - aggregation of results
http://comments.gmane.org/gmane.comp.lang.r.general/322689
<pre>Dear all,
when I am running the code attached below, it seems that no results are returned, only the predefined NAs. What mistake do I make?
Any comments and help is highly appreciated.
Thanks and best,
Martin
Simpar3 <- function(n1) {
L2distance <- matrix(NA, ncol=n1, nrow=n1)
data <- rnorm(n1)
diag(L2distance)=0
cl <- makeCluster(4)
registerDoParallel(cl)
foreach(j=1:n1) %dopar% {
library(np)
datj <- data[j]
for(k in j:n1) {
L2distance[j,k] <- k*datj
}
}
stopCluster(cl)
return(L2distance)
}
Res <- Simpar3(100)
</pre>Martin Spindler2015-07-31T12:39:00setting up R -- VM Fusion, WIndows7
http://comments.gmane.org/gmane.comp.lang.r.general/322682
<pre>Hi,
As i need R to speak to Bloomberg (and big only runs on windows), i'm
running windows 7 via VM Fusion on my mac.
I think i am having permission problems, as i cannot use install.packages,
and cannot change .libPaths via either a .Rprofile, or Profile.site.
I've posted more detail in this super-user question --
http://superuser.com/questions/948083/how-to-set-environment-variables-in-vm-fusion-windows-7
Throwing it over to this list as well, as I've spent about half the time i
had allowed for my project on (not getting) set up.
I realise this is a very niche problem - hoping that someone else has had a
similar problem, and can offer pointers.
best
mj
[[alternative HTML version deleted]]
</pre>Matthew Johnson2015-07-31T05:48:27dataframe for netcdf data
http://comments.gmane.org/gmane.comp.lang.r.general/322681
<pre>I am trying to analyse time-series .netcdf (3D lat,long and time domain)
climate data. I want to apply the SPEI package (calculation of standardized
precipitation evapotranspiration index) on it. But unable to arrange my data
in the required data frame. As I am a beginner in R, it will be very much
helpful if someone provide me the details of the code to be written before
executing the package.
The details of SPEI proggrame is as follows:
spei(data, scale, kernel = list(type = 'rectangular', shift = 0),
distribution = 'log-Logistic', fit = 'ub-pwm', na.rm = FALSE,
ref.start=NULL, ref.end=NULL, x=FALSE, params=NULL, ...)
Thanks in advance.
Prabir
[[alternative HTML version deleted]]
</pre>prabir das2015-07-31T04:46:00Looping help
http://comments.gmane.org/gmane.comp.lang.r.general/322678
<pre>I have never looped before and know I need to. I am unsure how to proceed:
- Action I need done: d(Data[1,2:399], q=0, boot=TRUE,
boot.arg=list(num.iter=1000))
- I need this to happen to all rows, I need All[1,2:399] to increase to
All[2:399], etc.
- But I also need the results from q increasing from 0 to 0.25, 0.5, 1,
2, 4,8,16,32,64 before the loop moves on to the next row.
- For each iteration I will receive two values: D and st.err. I need
this put into a matrix
I feel like this should be pretty simple to learn, but I have never looped
before.
I am hoping to get more of a tutorial on how to write loop code, then to
just be given the loop code.
Thanks,
April
[[alternative HTML version deleted]]
</pre>April Smith2015-07-31T00:20:30Problem with package plm
http://comments.gmane.org/gmane.comp.lang.r.general/322676
<pre>Hi!
I am trying yo run a regression using the plm package.
I tried in two different ways, that should give the same result, but
eventually do not; and i cannot understand the reason.
- The first way:
Accellerator.model <- read.delim("~/Desktop/Tesi/Accellerator model.txt")
data <- Accellerator.model
Panel <- plm.data(Accellerator.model,index=c("ID","Year"))
y <- data$Net.Cap.Inv
p <- data$Oil.Price
rev <- data$Revenue
ebi <- data$EBITDA
tas <- data$Tot.Assets
fas <- data$Non.current
tas1 <- data$tas1
rev1 <- data$rev1
rev2 <- data$rev2
fas1 <- data$fas1
cap1 <- data$cap1
# FIXED 1
fixed <- plm(y~fas1+rev+rev1+p,data=pdata,model="within")
summary(fixed)
Oneway (individual) effect Within Model
Call:
plm(formula = y ~ fas1 + rev + rev1 + p, data = pdata, model = "within")
Unbalanced Panel: n=19, T=6-19, N=282
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-91.6000 -8.4600 0.0711 7.1000 110.0000
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
fas1 -0.0231717 0.0096980 -2.3893 </pre>Luca Gagliardone2015-07-30T19:56:22About nls.
http://comments.gmane.org/gmane.comp.lang.r.general/322675
<pre>Hello,
I am trying to do a nls regression with R. but I always get a error
as "Error in numericDeriv(form[[3L]], names(ind), env) : Missing
value or an infinity produced when evaluating the model". I googled
it and found someone said it is because of the improper start value. I
tried many times but can not solve it. Does anyone can help me?
thanks a lot !
my code is:
fit1<-nls2(lnd~log(1/(den1/R1+den2+den3+den4+den5/R5)-1)/c+log(d50),
start=c(R1=0.9, R5=23, c=-1.1, d50=10), data=SWrt)
data (SWrt) is:
Depth lnd den1 den2 den3 den4 den5
1 20 2.995732 0.4190 0.00 0.00 0.00 0.00
2 40 3.688879 0.6725 0.00 0.00 0.00 0.00
3 60 4.094345 0.8780 0.00 0.00 0.00 0.00
4 80 4.382027 0.9660 0.00 0.00 0.00 0.00
5 100 4.605170 0.9990 0.00 0.00 0.00 0.00
6 15 2.708050 0.0000 0.38 0.00 0.00 0.00
7 30 3.401197 0.0000 0.48 0.00 0.00 0.00
8 45 3.806662 0.0000 0.85 0.00 0.00 0.00
9 60 4.094345 0.0000 0.88 0.00 0.00 0.00
10 120 4.787492 0.0000 </pre>Jianling Fan2015-07-30T19:51:22Itinerary Ticket Parser
http://comments.gmane.org/gmane.comp.lang.r.general/322674
<pre>Dear All,
I have seeing a lot of apis', (like worldmate or new product called sift from easilydo) which is used for parsing email and different itinerary tickets. Is there any packages in R which does that?
Regards,
Anshuk Pal Chaudhuri
[[alternative HTML version deleted]]
</pre>Anshuk Pal Chaudhuri2015-07-30T15:45:31Shiny help with verbatimTextOutput
http://comments.gmane.org/gmane.comp.lang.r.general/322672
<pre>Hello,
I am working with Shiny and want to use it to show user-entered input from
a check box. However, when using verbatimTextOutput with no options
selected in the check box I get "character(0)" as the output. Is there any
way to make this so it displays nothing instead?
Thanks
#Begin R code
#ui.R
checkboxGroupInput("string", label = h5("test"), choices = list("opt1" = 1,
"opt2" = 2)),
h5("User input goes here"),verbatimTextOutput("o"),
#server.R
output$o <- renderPrint({ paste(string) })
[[alternative HTML version deleted]]
</pre>Evan Kransdorf2015-07-30T20:31:45Using latticeExtra as.layer function with different number of plot panels
http://comments.gmane.org/gmane.comp.lang.r.general/322665
<pre>Hi,
When the as.layer function is used to overaly 2 lattice plots, there
seems to be an assumption that the data used in both plots will generate
the same number of panels (and, I believe, in the same order). In case
the data used in the plot within the as.layer call is incomplete , data
may be plotted on the "wrong" panel, and data seem to get re-used on the
last panel(s). See what happens in the example code below when the
records with state.region=="South" are dropped...
Is there a trick to overlay panel based upon the conditioning variable
value rather than the panel order?
require(lattice)
require(latticeExtra)
state2 <- state <- data.frame(state.x77,state.region)
state2$Income <- sample(state2$Income)
state3 <- state2[which(state2$state.region!="South"),]
foo <- xyplot(Income~Population|state.region,data=state,main='foo')
foo
bar <- update(foo,main='bar') +
as.layer(xyplot(Income~Population|state.region,data=state2,col='red'))
bar
bar2 <- update(foo,main='bar2') +
as.layer(xyplot(Income~P</pre>sbihorel2015-07-30T15:37:55ggplot2 - geom_text() with date as x-axis
http://comments.gmane.org/gmane.comp.lang.r.general/322663
<pre>I am trying to annotate a graph using geom_text() and I seem to be misunderstanding how to use a date in the co-ordinates---or, at least, I think that is the problem. Code is below.
Can anyone give me a suggestion of where I am going wrong?
Thanks,
John
John Kane
Kingston ON Canada
###===========================================
ibrary(ggplot2)
library(lubridate)
ins <- structure(list(td = structure(c(1437804720, 1437824100, 1437836220,
1437851580, 1437863460, 1437878640, 1437890640, 1437904800, 1437918240,
1437926100, 1437941340, 1437951240), tzone = "UTC", class = c("POSIXct",
"POSIXt")), glucose = c(328L, 390L, 358L, 387L, 440L, 328L, 365L,
450L, 467L, 477L, 408L, 457L), dose = c(NA, 0.5, NA, NA, 0.5,
NA, NA, 0.5, NA, NA, NA, 0.5)), .Names = c("td", "glucose", "dose"
), row.names = c(NA, -12L), class = "data.frame")
anon <- na.omit(ins) # extract shots
texdat = ymd_hm("2015-07-26 20:09")
glucose <- ggplot(ins, aes(td, glucose)) + geom_point(colour = "red") + geom_line(colour = "blue")
p1</pre>John Kane2015-07-30T15:23:55Need help
http://comments.gmane.org/gmane.comp.lang.r.general/322660
<pre>Dear All,
What are inner and outer matrix multiplication. Kindly guide me where to look for this Wikipedia was not much help.
Thanks in Advance,
Harmeet
</pre>MyList2015-07-30T14:00:16R and AWS
http://comments.gmane.org/gmane.comp.lang.r.general/322654
<pre>Hello All,
I wanted to know if there is a quick tutorial which I could be pointed to,
for the understanding of setting R and R studio on Amazon web services.
Thanks in Advance,
Harmeet
[[alternative HTML version deleted]]
</pre>My List2015-07-30T12:41:26R parallel - slow speed
http://comments.gmane.org/gmane.comp.lang.r.general/322653
<pre>Dear all,
I am trying to parallelize the function npnewpar given below. When I am comparing an application of "apply" with "parApply" the parallelized version seems to be much slower (cf output below). Therefore I would like to ask how the function could be parallelized more efficient. (With increasing sample size the difference becomes smaller, but I was wondering about this big differences and how it could be improved.)
Thank you very much for help in advance!
Best,
Martin
library(microbenchmark)
library(doParallel)
n <- 500
y <- rnorm(n)
Xc <- rnorm(n)
Xd <- sample(c(0,1), replace=TRUE)
Weights <- diag(n)
n1 <- 50
Xeval <- cbind(rnorm(n1), sample(c(0,1), n1, replace=TRUE))
detectCores()
cl <- makeCluster(4)
registerDoParallel(cl)
microbenchmark(apply(Xeval, 1, npnewpar, y=y, Xc=Xc, Xd = Xd, Weights=Weights, h=0.5), parApply(cl, Xeval, 1, npnewpar, y=y, Xc=Xc, Xd = Xd, Weights=Weights, h=0.5), times=100)
stopCluster(cl)
Unit: milliseconds
</pre>Martin Spindler2015-07-30T12:26:34Search EngineSearch the mailing list at Gmanequery
http://search.gmane.org/?group=$group=gmane.comp.lang.r.general