Displaying 20 results from an estimated 20000 matches similar to: "write.csv permissions"
2013 Mar 18
4
Counting confidence intervals
Hi,
I have a 2 x 10000 matrix of confidence intervals. The first column is the
lower and the next column is the upper. I want to cont how many times a
number say 12 lies in the interval. Can anyone assist?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2012 Apr 29
2
Xy plot help
Dear R group,
Tried to turn off the html in yahoo. So far not successful. Apologies!
I tried to get xyplot shrink fit for my mixed model. But, the mixed model line is not seen in the graph.
I would like to know if there is anything wrong with my code.
Thanks,
A.K.
(fm1 <- lmer(Response3 ~1+ Wavelength*Start_Resp*time + (1|resid) + (1+time|Subject_BDat), family=binomial,
data=Behavdat,
2013 May 07
4
how to calculate the mean in a period of time?
Hi,
Your question is still not clear.
May be this helps:
dat2<- read.table(text="
patient_id????? t???????? scores
1????????????????????? 0??????????????? 1.6
1????????????????????? 1??????????????? 2.6
1????????????????????? 2???????????????? 2.2
1????????????????????? 3???????????????? 1.8
2????????????????????? 0????????????????? 2.3
2?????????????????????? 2???????????????? 2.5
2013 Jan 16
4
Get a percent variable based on group
Dear all, I'd like to get a percentage variable based on a group, but without creating a new data frame.
For example:
data(iris)
iris$percent <-unlist(tapply(iris$Sepal.Length,iris$Species,function(x) x/sum(x, na.rm=TRUE)))
This does not work, I should have only three standard values, respectively for setosa, versicolor, and virginica. How can I do this?
MANY THANKS,
Karine
2012 May 25
4
Hash Table - Select and Change Data iniside Matrix
Hi,
Here i have been a matrix like this,
*NAME AGE PALCE TRUE/FALSE*
ABC 20 INDIA
XYZ 30 FRANCE
PQR 40 USA
MNO 30 KENIYA
DEF 25 AUSTRALIA
Here,* TRUE/FALSE* Column containing empty values.
So my requirement what is , need to change all the *TRUE/FALSE *column value
into "*TRUE*" where *AGE =
2012 Sep 24
3
List creation based on matrix
Hi guys,
It would be great if you could help me with this one...
I'm looking to create a script to convert a matrix of species abundance e.g:
<http://r.789695.n4.nabble.com/file/n4643978/species_matrix.jpg>
into two vectors e.g:
<http://r.789695.n4.nabble.com/file/n4643978/communitylist.jpg>
----------------
If you feel there is no easy answer to this and that it would be
2013 Apr 15
6
Sorting data.frame and again sorting within data.frame
Dear R forum,
I have a data.frame as defied below -
df = data.frame(names = c("C", "A", "A", "B", "C", "B", "A", "B", "C"), dates = c("4/15/2013", "4/13/2013", "4/15/2013", "4/13/2013", "4/13/2013", "4/15/2013", "4/14/2013",
2013 Sep 02
3
Product of certain rows in a matrix
Hi,
You could try:
A<- matrix(unlist(read.table(text="
1 2 3
4 5 6
7 8 9
9 8 7
6 5 4
3 2 1
",sep="",header=FALSE)),ncol=3,byrow=FALSE,dimnames=NULL)
library(matrixStats)
?res1<-t(sapply(split(as.data.frame(A),as.numeric(gl(nrow(A),2,6))),colProds))
?res1
#? [,1] [,2] [,3]
#1??? 4?? 10?? 18
#2?? 63?? 64?? 63
#3?? 18?? 10??? 4
2013 Jun 10
4
Combining CSV data
Hello R community,
I am trying to combine two CSV files that look like this:
File A
Row_ID_CR, Data1, Data2, Data3
1, aa, bb, cc
2, dd, ee, ff
File B
Row_ID_N, Src_Row_ID, DataN1
1a, 1, This is comment 1
2a, 1, This is comment 2
3a,
2012 May 25
4
Problem sourcing file
Hi all,
I created a file to define some functions. When I try to source this file,
sometimes it works but sometimes I get the following error:
>Source(‘File.R’)
Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) :
unused argument(s) (file.info(filename)[1, "mtime"])
It works when I just started the R session, but after using some
2013 Apr 29
1
how to add new rows in a dataframe?
Hi,
dat1<- read.table(text="
id??????????????? t???????????????????? scores
2???????????????? 0??????????????????????? 1.2
2???????????????? 2???????????????????????? 2.3
2???????????????? 3??????????????????????? 3.6
2???????????????? 4??????????????????????? 5.6
2???????????????? 6??????????????????????? 7.8
3???????????????? 0??????????????????????? 1.6
3????????????????
2013 Nov 21
1
how can I import a number of datsets in a folder in my working directory to a list in R
Hi,
Suppose, if I create 15 files in my working directory.
set.seed(48)
lapply(1:15,function(i) {m1 <- matrix(sample(1:20,1686*2,replace=TRUE),nrow=1686,ncol=2); write.table(m1,paste0("file_",i,".txt"),row.names=FALSE,quote=FALSE)})
?D <-dir()
D1 <- D[order(as.numeric(gsub("\\D+","",D)))]
D1
?res <- t(sapply(D1,function(x) {x1<-
2012 Oct 24
3
Results not dispalying in R console
Hi
I'm not getting any results in R console when i run commands. I reinstalled
R but the results are same
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Results-not-dispalying-in-R-console-tp4647271.html
Sent from the R help mailing list archive at Nabble.com.
2013 Feb 17
6
histogram
HI Elisa,
You could use ?cut()
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2013 Feb 17
3
Select components of a list
Hi Gustav,
Try this:
lapply(1:length(models),function(i) lapply(models[[i]],function(x) summary(x)$coef[2,]))[[1]] #1st list component
[[1]]
#??? Estimate?? Std. Error????? z value???? Pr(>|z|) # pm10
#5.999185e-04 1.486195e-04 4.036606e+00 5.423004e-05
#[[2]]
#??? Estimate?? Std. Error????? z value???? Pr(>|z|) #ozone
#0.0010117294 0.0003792739 2.6675428048 0.0076408155
#[[3]]
#???
2012 Feb 17
1
Creating XML using apply
Hi
My data looks like this
data is a vector
data= var1 var2 var3
100 120 130
i want to put it in an XML
xmlOutput=NULL
xmlOutput<- newXMLNode("results")
for( i in 1 : length(data))
{
newXMLNode("variable",attrs=c(name =names(data)[i] ), value =
data[i]), parent = xmlOutput)
}
is it possible to use apply here
If there more variables it
2012 Apr 20
1
what is the maximum number of records that we can load using dbwrite
Hi
I'm using the dbwrite to insert a large dataset. There are about 10 million
rows. But i'm not able to load the records.
Please can anyone tell me the way to load or maximum number of records that
dbwrite does. so that i can load it in batches
-----
Thanks in Advance
Arun
--
View this message in context:
2013 Mar 22
3
Distance calculation
Hi Elisa,
I hope this is what you wanted.
dat1<-read.csv("peaks.csv",sep=",")
#Subset
dat2<-dat1[1:5,]
res1<-do.call(cbind,lapply(seq_len(nrow(dat2)),function(i) do.call(rbind,lapply(split(rbind(dat2[i,],dat2[-i,]),1:nrow(rbind(dat2[i,],dat2[-i,]))), function(x) {x1<-rbind(dat2[i,],x);
2013 Sep 25
1
Computing calculation among two vectors
Hi,
Try:
x<- 1:4
?y<- c("*","/","-","+")
res<-sapply(y,function(i) {x1<-expand.grid(x,x); unlist(lapply(paste0(x1[,1],i,x1[,2]),function(u) eval(parse(text=u))))})
row.names(res)<- as.character(interaction(expand.grid(x,x),sep="_"))
head(res)
#??? *?? /? - +
#1_1 1 1.0? 0 2
#2_1 2 2.0? 1 3
#3_1 3 3.0? 2 4
#4_1 4 4.0? 3 5
#1_2 2 0.5
2012 Jul 04
3
How to use Sys.time() while writing a csv file name
Dear R helpers,
I am using Beta distribution to generate the random no.s (recovery rates in my example). However, each time I need to save these random no.s in a csv format. To distinguish different csv files, one way I thought was use of Sys.time in the file name. My code is as follows -
# My code
rr = rbeta(25, 6.14, 8.12)
lgd = 1 - mean(rr)
write.csv(data.frame(recovery_rates = rr), file =