Hi Erin,
There is no "appropriate directory" until you have a package. Until
the package is built, R will not access and use the help
documentation. So I guess the answer is, "wherever it is convenient
for you to find and edit as your function develops until the time when
you put it in one of yo
Dear R People:
Suppose I have the following function and I generate the documentation for it:
> f <- function(x) {
+ return(x^2)
+ }
> prompt(f)
Created file named 'f.Rd'.
Edit the file and move it to the appropriate directory.
>
What would be the appropriate directory if I haven't created my ne
Actually, you can do this using locked bindings. Look at ?lockBinding
Locked bindings are how namespaces get const function definitions, and
active bindings (on the same help page) are how R CMD check notices
that you are using T and F when you mean TRUE and FALSE.
-thomas
On Wed, Mar 16, 2
Hello Mr. Grothendieck,
thanks for your reply!
Text book that I use (Spector, 2008) dind't comment about this feature of chron
function...
I just don't understand why we have 10957 days of difference between dates
(look that date on your mail seems to be 1981, not 2011), and not the 25568
d
To add to this, I am sure this have been answerted earlier on the list,
so you could try to search the archives.
On Tue, Mar 15, 2011 at 8:59 PM, Ben Bolker wrote:
> Estefania Nares hotmail.com> writes:
>
>> I have to generate 1000 transitions of a discrete time Markov Chain and
>> then give and
On 11-03-15 9:10 PM, Hadley Wickham wrote:
Could getSrcFilename() gain a default argument so that
getSrcFilename() would by default return the path of the executing
script?
No, it needs to see a function defined in that script.
But I thought default arguments were evaluated in the parent
envi
Try this:
mapply('/', l1, l2, SIMPLIFY = FALSE)
and
tapply(1:5, lapply(indxLi, as.numeric), sum)
On Tue, Mar 15, 2011 at 6:06 PM, Rohit Pandey wrote:
>
> Hello R community,
>
> I have two questions about using R.
>
> The first is about dividing each element of a list with another similar
> si
Try this:
fi_2 <- diag(1, i)
fi_2[lower.tri(fi_2)] <- 1 - runif(sum(lower.tri(fi_2))) ^ .5
fi_2[upper.tri(fi_2)] <- fi_2[lower.tri(fi_2)]
On Tue, Mar 15, 2011 at 7:51 PM, Brian Pellerin <
brianpatrickpelle...@gmail.com> wrote:
> Hello R users,
>
> I would like to reduce the number of for loops i
Estefania Nares hotmail.com> writes:
> I have to generate 1000 transitions of a discrete time Markov Chain and
> then give and estimation of the equilibrium distribution.
>
> I know the transition matrix.
>
> 0.3 0.7 0
> 0.2 0.5 0.3
> 0 0.4 0.6
> Do you know how to do it with R?
Cheer up! R is a step closer to that concept than the old FORTRAN compilers
that couldn't even guarantee that 37 was a constant if used repeatedly in a
subroutine call.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Uwe Ligges
Se
>> Could getSrcFilename() gain a default argument so that
>> getSrcFilename() would by default return the path of the executing
>> script?
>
> No, it needs to see a function defined in that script.
But I thought default arguments were evaluated in the parent
environment? Does that not follow for
Hi everyone,
this email basically pursues two distinct main goals. I appreciate any help!
First of all I was wondering if there is any possibility to get WEKA files
(coded in Java) to run in R respectively RWeka. I first considered if it was
possible with the Weka_interface implemented in RWe
Hello R,
I would like to print regression data in graph. I mean the output from:
k=lm(formula,data)
summary(k)
Or somehow extract and print only coefficients and R-squared.
--
View this message in context:
http://r.789695.n4.nabble.com/adding-linear-regression-data-to-plot-tp3357946p3357946.h
Hello R community,
I have two questions about using R.
The first is about dividing each element of a list with another similar
sized list. So, if the first list has two elements and so does the second,
then the result should also be a list with two elements.
For example, the inputs are:
list(ma
Just use vect_2_id as a subsetting index for vect_1, ie:
vect_2<-vect_1[vect_2_id]
Vincy Pyne wrote:
>
> Dear R helpers
>
> Suppose I have a vector as
>
> vect_1 = c("AAA", "AA", "A", "BBB", "BB", "B", "CCC")
>
> vect_1_id = c(1:length(vect_1))
>
> Through some process I obtain
>
> vect_2_
I want to do a daily, weekly and monthly regression between InvestmentGrade
Credit Spreads (Dependent Variable) and Treasuries (Independent Variable).
My starting point is daily spread data and daily prices for US treasuries.
Should I convert the US Prices into log returns i.e. log(Pt/Pt-1) or
I must have mixed it up. Thank you.
--
View this message in context:
http://r.789695.n4.nabble.com/Finding-coordinates-for-maximum-of-a-function-tp3355369p3357460.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mai
I have tried this with my actual data, and everything works smoothly,
including the monotonically decreasing error rates. e.g.:
formula Error
1 Cr 0.4167
2 Cr + Mg 0.1667
Dear experts,
I have to generate 1000 transitions of a discrete time Markov Chain and
then give and estimation of the equilibrium distribution.
I know the transition matrix.
0.3 0.7 0
0.2 0.5 0.3
0 0.4 0.6
Do you know how to do it with R?
Thanks a lot!
Estefania
Hi,
When I fit the mixed-effects model by lme, I got the convergence error code = 1
message = iteration limit reached without convergence (9). Even after I
increase the iteration numbers, it still did not work. The only way I found to
avoid the error message is to increase the number of iteration
The "getSrcFilename" function is exactly what I was trying to describe, and
I'm excited to know that it's on it way!
I have tried to create that type of function, but I didn't think it was
possible with currently available functions. I would be interested in
seeing how the new function works, may
Hello R users,
I would like to reduce the number of for loops in my code. I build these
matrices (5 times). The main diagonal are 1s and the two sides along the
main diagonal mirror each other as follows:
i<-5
fi<-matrix(0,nrow=i,ncol=i)#floral inhibition matrix for(r in 1:i){ for(c in
1:i){
Dear all,
I am trying to calculate sample size for a clinical research, on the basis
of generalized wilcoxon test or Tarone-Ware test.
It seems SAS can do this job using it "POWER" procedure, but SAS is not
available to me.
I would be very grateful if you could let me know if any R package or oth
Hi,
I have a vector of strings (categories), each element of which can be
uniquely found in each element of a much longer vector of about 30 or so
differeint factors. I would like to define another factor variable (drawn
from NewFactorListaccording to which string from "categories" is found in
the
On 15/03/2011 4:45 PM, Hadley Wickham wrote:
The bigger issue is that R can't tell the location of an open script,
which makes it harder to create new versions of existing work
But it can. If you open a script and choose save, it will be saved to the
same place. Or do you mean an executin
If you try more than one or two distributions the final estimates, while
appearing to have higher precision that the ECDF, will actually have the
same precision. That is because of model uncertainty. This would be
revealed by bootstrapping. There is little advantage to using a parametric
model i
Hallo
yes I tried it as well and it works;
Thank you a lot
Maria
From: Dennis Murphy [djmu...@gmail.com]
Sent: 15 March 2011 21:36
To: Lathouri, Maria
Cc: r-help@r-project.org
Subject: Re: [R] fitting a distribution to a ecdf plot
Hi:
The fitdistrplus package f
Hi,
maybe this:
df<-data.frame(a=c(1,2,3,Inf,4,Inf),b=c(Inf,2,3,4,5,8))
df[apply(df,1, function(x) !any(x==Inf)),]
df[apply(df,1, function(x) any(x==Inf)),]
Andrija
On Tue, Mar 15, 2011 at 10:44 PM, Alexy Khrabrov wrote:
> How do I apply a function to every row of a dataframe most naturally?
How do I apply a function to every row of a dataframe most naturally?
Specifically, I'd like to filter out any row which contains an Inf in any
column. Since all columns are numeric, I guess max should work on a row...
-- Alexy
__
R-help@r-project.or
Hi:
The fitdistrplus package from CRAN may be useful. I tried it on your data
and the lognormal seemed to fit well, apart from the outlier. I just
followed the vignette that accompanies the package.
library(fitdistplus)
plotdist(NOEccu) # ecdf
descdist(NOEccu, boot =
On Wed, Mar 16, 2011 at 3:18 AM, agent dunham wrote:
> Does it mean that regsubsets doesn't work with categorical variables?
No.
> It's because I'm trying the following and I don't know what happens. Any
> help would be appreciated.
>
> varin <- data.frame(v1,v2,...,v7, factor1,..., factor4)
>
>
Thank you all, it will help :-)
Bye,
Peter
__
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-contained, repr
>> The bigger issue is that R can't tell the location of an open script,
>> which makes it harder to create new versions of existing work
>
> But it can. If you open a script and choose save, it will be saved to the
> same place. Or do you mean an executing script? There are indirect ways to
On 15/03/2011 2:35 PM, Martin Morgan wrote:
On 03/15/2011 11:34 AM, Duncan Murdoch wrote:
> On 15/03/2011 2:23 PM, Uwe Ligges wrote:
>>
>> On 15.03.2011 15:53, xiagao1982 wrote:
>> > Hi, all,
>> >
>> > Does R have a "const object" concept like which is in C++ language?
>> I want to set so
On Tue, Mar 15, 2011 at 1:17 PM, hihi wrote:
> Hi All,
> is there any effiective and dense/compact method to calculate the mean of a
> list of - of course coincident - matrices on an element by element basis? The
> resulting matrix' [i, j]-th element is the mean of the list's matrices' [i,
> j]
On 15/03/2011 2:56 PM, Gene Leynes wrote:
The "getSrcFilename" function is exactly what I was trying to describe, and
I'm excited to know that it's on it way!
I have tried to create that type of function, but I didn't think it was
possible with currently available functions. I would be interest
Try this:
l <- list(matrix(rnorm(9), 3), matrix(rnorm(9), 3), matrix(rnorm(9), 3))
Reduce('+', l) / length(l)
On Tue, Mar 15, 2011 at 5:17 PM, hihi wrote:
> Hi All,
> is there any effiective and dense/compact method to calculate the mean of a
> list of - of course coincident - matrices on an e
Peter,
as the matrices in the list have the same shape, you can unlist them
into an array and then use rowMeans.
HTH
Claudia
Am 15.03.2011 21:17, schrieb hihi:
Hi All,
is there any effiective and dense/compact method to calculate the mean of a
list of - of course coincident - matrices on a
Hi All,
is there any effiective and dense/compact method to calculate the mean of a
list of - of course coincident - matrices on an element by element basis? The
resulting matrix' [i, j]-th element is the mean of the list's matrices' [i,
j]-th elements respectively...
Iterating by for statement
vect_1[vect_2_id]
and perhaps a readthrough of some of the very nice
intro to R materials available online.
Sarah
On Tue, Mar 15, 2011 at 3:41 PM, Vincy Pyne wrote:
> Dear R helpers
>
> Suppose I have a vector as
>
> vect_1 = c("AAA", "AA", "A", "BBB", "BB", "B", "CCC")
>
> vect_1_id = c(1:leng
Dear R helpers
Suppose I have a vector as
vect_1 = c("AAA", "AA", "A", "BBB", "BB", "B", "CCC")
vect_1_id = c(1:length(vect_1))
Through some process I obtain
vect_2_id = c(2, 3, 7), then I need a new vector say vect_2 which will give me
vect2 = ("AA", "A", "CCC") i.e. I need the subset of ve
The Lattice auto.key argument has a bug in R.12.2.
R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)
other attached packages:
[1] lattice_0.19-17
loaded via a namespace (and not attached):
[1] grid_2.12.2
If I set up my plot parameters as
require(lattice)
superpose.line
On Mar 15, 2011, at 1:03 PM, YAddo wrote:
Dear All:
I am a newbie to R. I am trying to use the lmsqreg.fit pack,
although I
have installed(I think) it I am not able to invoke it when write
the code
for it. Here's what I got when I installed it.
package 'lmsqreg' successfully unpacked
On Mar 15, 2011, at 1:25 PM, lafadnes wrote:
I am a new R user (am using it through the Rcmdr package) and have
struggled
to find out how to report OR and RR directly when running GLM models
(not
only reporting coefficients.)
Example of the syntax that I have used:
GLM.2 <- glm(diarsev ~
OR <- exp(coef(GLM.2)[-1])
OR.ci <- exp(confint(GLM.2)[-1,])
-Aaron
On Tue, Mar 15, 2011 at 1:25 PM, lafadnes wrote:
> I am a new R user (am using it through the Rcmdr package) and have
> struggled
> to find out how to report OR and RR directly when running GLM models (not
> only reporting coef
On 15.03.2011 19:35, Martin Morgan wrote:
On 03/15/2011 11:34 AM, Duncan Murdoch wrote:
On 15/03/2011 2:23 PM, Uwe Ligges wrote:
On 15.03.2011 15:53, xiagao1982 wrote:
> Hi, all,
>
> Does R have a "const object" concept like which is in C++ language?
I want to set some data frames as constan
I am a new R user (am using it through the Rcmdr package) and have struggled
to find out how to report OR and RR directly when running GLM models (not
only reporting coefficients.)
Example of the syntax that I have used:
GLM.2 <- glm(diarsev ~ treatmentarm +childage +breastfed,
family=binomial(lo
Dear All:
I am a newbie to R. I am trying to use the lmsqreg.fit pack, although I
have installed(I think) it I am not able to invoke it when write the code
for it. Here's what I got when I installed it.
package 'lmsqreg' successfully unpacked and MD5 sums checked
And here is what I got wit
On Tue, Mar 15, 2011 at 10:53 AM, xiagao1982 wrote:
> Hi, all,
>
> Does R have a "const object" concept like which is in C++ language? I want to
> set some data frames as constant to avoid being modified unintentionally.
> Thanks!
>
>
LockBinding will prevent a variable from being modified (but
On 03/15/2011 11:34 AM, Duncan Murdoch wrote:
On 15/03/2011 2:23 PM, Uwe Ligges wrote:
On 15.03.2011 15:53, xiagao1982 wrote:
> Hi, all,
>
> Does R have a "const object" concept like which is in C++ language?
I want to set some data frames as constant to avoid being modified
unintentionally. Th
It would be nice to have a standard directory where R can write things
this way. A semi-standard directory is given by
Sys.getenv("R_LIBS_USER"), which defaults to ~/R/.../. Maybe ~/R/
could serve as that convention? That way we (various developers etc)
would also not clutter up users home direc
On 15/03/2011 2:23 PM, Uwe Ligges wrote:
On 15.03.2011 15:53, xiagao1982 wrote:
> Hi, all,
>
> Does R have a "const object" concept like which is in C++ language? I want
to set some data frames as constant to avoid being modified unintentionally. Thanks!
Although there is almost never a "No
On 15.03.2011 15:53, xiagao1982 wrote:
Hi, all,
Does R have a "const object" concept like which is in C++ language? I want to
set some data frames as constant to avoid being modified unintentionally. Thanks!
Although there is almost never a "No" in R, the best short answer is: "No".
Best,
You could use the by() function after a little data manipulation.
The first line will create a field just of the date portion of your datetime
field. Then you can use the by() function to use the indices you desire to
calculate the mean.
mSamp$cDT <- chron(unlist(strsplit(as.character(mSamp$Col
On Mar 15, 2011, at 1:11 PM, wrote:
I think you need to read an introduction to R.
For starters, read.table returns its results as a value, which you
are not saving.
The probable answer to your question:
Read the whole file with read.table, and select columns you need,
e.g.:
tab <- read.
I think you need to read an introduction to R.
For starters, read.table returns its results as a value, which you are not
saving.
The probable answer to your question:
Read the whole file with read.table, and select columns you need, e.g.:
tab <- read.table(myfile, skip=2)[,1:5]
-Original Mes
Hi Jon, I read your question differently. Is the answer? - Rex
> ch=scan(stdin(),what=character(0),n=1)
1: f
Read 1 item
> ch
[1] "f"
>
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Bert Gunter
Sent: Tuesday, March 15, 2011 10
Hi,
One "easy" way to do that is by using the "nls" (nonlinear least square)
library.
Basically you will test with that if your distribution can be adjusted to
the distribution you say it matches (Weibull?) through the adjustment of
some parameters.
The base package includes the "nls" library, b
On Mar 15, 2011, at 12:23 PM, Lathouri, Maria wrote:
Actually I have already done a search on that but it was not much of
a help. That is why I posted it in the r-help in case it was much
more helpful.
There is a tutorial by Ricci with the exact title I suggested looking
for. At the Baro
Actually I have already done a search on that but it was not much of a help.
That is why I posted it in the r-help in case it was much more helpful.
Thank you.
Kind regards
Maria
From: David Winsemius [dwinsem...@comcast.net]
Sent: 15 March 2011 16:19
T
One things you should do, as Kate suggested, is to check whether the Jacobian
functiions are correctly code. You can do this with "numDeriv" package:
require(numDeriv)
?jacobian
Compare the jacobian from numDeriv with your jacobian for a few reasonable
parameter vectors.
Ravi.
_
On Tue, 2011-03-15 at 07:24 -0700, Carl Nim wrote:
> I am trying to calculate monthly means by year of phosphates and nitrates
> from a multi year data set. Can anybody help me out with the most effective
> way to do this?
>
> My data looks like this:
>
> Collection_Date Test.Name Value
> 2000
hi: you also may want to look at the admit package. it does metropolis
hastings using a weighted mixture of t-distributions so you just need to
write a function for the likelihood you're trying to get the parameters for.
I don't know about it's speed or efficiency for large data sets but
you could
On Mar 15, 2011, at 12:00 PM, Lathouri, Maria wrote:
Dear all,
I need to plot an cumulative distribution plot of a variable and
then to fit a distribution to that, probably a weibull or lognormal.
I have plotted the ecdf as
plot(ecdf(x))
but I haven't managed to fit the distribution. I
Dear all,
I need to plot an cumulative distribution plot of a variable and then to fit a
distribution to that, probably a weibull or lognormal.
I have plotted the ecdf as
> plot(ecdf(x))
but I haven't managed to fit the distribution. I have as well attached the data.
I would appreciate if you
Hi Keith,
how about this:
fit<-function(x,coefs) x*coefs[2]+coefs[1]
plot(1:10,1:10,type="n")
x<-par("usr")[1:2]
cf1<-c(a=3,b=.5) #eg coefs from a lm-object
cf2<-c(a=1,b=.9) #another line, coloring only intersection
polygon(c(x,rev(x)),c(fit(x,cf1),fit(rev(x),cf2)),col="red")
setting one of the c
On Tue, 15 Mar 2011, Hadley Wickham wrote:
Hi all,
Does anyone have any advice or experience storing package settings
between R runs? Can I rely on the user's home directory (e.g.
tools::file_path_as_absolute("~")) to be available and writeable
across platforms?
No. First, please use path.e
R-help,
I'm trying to read a data file with plenty of columns.
I just need the first 5 but it doe not work by doing something like:
> mycols <- rep(NULL, 430) ; mycols[c(1:4)] <- NA
> read.table(myfile, skip=2, colClasses=mycols)
Any suggestions?
Thanks in advance
_
Hi Claus,
On Tue, Mar 15, 2011 at 9:33 AM, Claus O'Rourke wrote:
> Hi,
> I am trying to recursively apply a function to a selection of columns
> in a dataframe. I've had a look around and from what I have read, I
> should be using some version of the apply function, but I'm really
> having some h
Hi,
What you are after is:
datasubset <- dataset[ dataset[,3] == "text3", ]
Equivalently, you can use:
datasubset <- subset(dataset, subset = dataset[,3] == "text3")
HTH,
Francisco
On Tue, Mar 15, 2011 at 3:09 PM, e-letter wrote:
> Readers,
>
> For a data set:
>
> text1,23,text2,45
> text1
Hi,
Le 15/03/11 16:09, e-letter a écrit :
> Readers,
>
> For a data set:
>
> text1,23,text2,45
> text1,23,text3,78
> text1,23,text3,56
> text1,23,text2,45
>
> The following command was entered:
>
> datasubset<-data.frame(dataset[,3]=="text3")
datasubset<-subset(dataset,dataset[,3]=="text3")
> The
Dear R useRs,
I have a problem with nls.lm function of minpackl.lm package.
I need to fit the Van Genuchten Model to a set of data of Theta and hydraulic
conductivity with nls.lm function of minpack.lm package.
For the first fit, the parameter estimates keep changing even after 1000
iteration
Try using which()
Something like data.frame(dataset[which(dataset[,3]=="text3"),])
e-letter wrote:
>
> Readers,
>
> For a data set:
>
> text1,23,text2,45
> text1,23,text3,78
> text1,23,text3,56
> text1,23,text2,45
>
> The following command was entered:
>
> datasubset<-data.frame(dataset[,3]
?source
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Wolfgang Raffelsberger, PhD
IGBMC,
1 rue Laurent Fries, 67404 Illkirch Strasbourg, France
wolfgang.raffelsberger (at) igbmc.fr
De : r-help-boun...@r-project.org [r-help-boun
Dear R useRs,
I am a newbie. Currently, my script is quick long, therefor I am trying to
improve the efficiency of my script.
I use often a version of the following code, the script below is just a
simple example, but I especially try to improve the last three lines:
matrix1<-diag(100)
a=2
try<
Hi, all,
Does R have a "const object" concept like which is in C++ language? I want to
set some data frames as constant to avoid being modified unintentionally.
Thanks!
xiagao1982
2011-03-15
[[alternative HTML version deleted]]
__
R-help@
I have just started using R so forgive me if this question is very
simple. I have a data set (in a data frame called dm) that looks like
this
x (Cells)y(males)
1 0
2 2
3 7
4 12
5 12
6 19
7 22
8 23
9 25
10 23
11 23
12 11
13
you could run source(directory/textfilename.txt) [and then you can use it in R]
or paste the function into the console,
or highlight and pass the function from the built in R text editor,
or highlight and pass the function from your external text editor (notepad++,
emacs, textwrangler, etc.)
Does it mean that regsubsets doesn't work with categorical variables?
It's because I'm trying the following and I don't know what happens. Any
help would be appreciated.
varin <- data.frame(v1,v2,...,v7, factor1,..., factor4)
Dependent variable: height
Then:
eu.subsets <- regsubsets(varinc ,
64 Bit R w/JAGS seems to be stalling out as well, I ran a test run of 100
iterations and it's been hanging for 8 hours so that doesn't seem to be the
solution. I'll take a look at PYMC. That CppBUGS package looks pretty
interesting, I'll keep my eye on it.
My C programming book arrives today fro
I am trying to calculate monthly means by year of phosphates and nitrates from
a multi year data set. Can anybody help me out with the most effective way to
do this?
My data looks like this:
Collection_Date Test.Name Value
2000-01-24 17:00:00 Phosphate
did you try to fit your data with a skew-normal/skew-t distribution?
If that works, you can use simulation.
Kjetil
On Tue, Mar 15, 2011 at 2:31 AM, Lao Meng wrote:
> Hi all:
> I have a question on sample size calculation of 2 groups of data. If 2
> groups of data are all normal distribution, the
Thanks! I've never come across 'while' before and it's perfect.
On Mar 15 2011, Jonathan P Daily wrote:
?"while"
You don't want a for loop. You need a while loop.
--
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville
You need to specify the group aesthetic - that defines how
observations are grouped into instances of a geom.
Hadley
On Tue, Mar 15, 2011 at 8:37 AM, joeP wrote:
> Hi,
>
> This seems like there should be a simple answer, but having spent most of
> the day trying to find it, I'm becoming less con
Readers,
For a data set:
text1,23,text2,45
text1,23,text3,78
text1,23,text3,56
text1,23,text2,45
The following command was entered:
datasubset<-data.frame(dataset[,3]=="text3")
The result of
datasubset
is
TRUE
TRUE
The required result is
text1,23,text3,78
text1,23,text3,56
What is the co
On Mar 15, 2011, at 9:21 AM, bra86 wrote:
How could one get started with a self-written function?
I have a function written in .txt format, but can not find the way
to import
it to the R space.
Would be very appreciated for help.
It would be more typical to use a file extension of .r but I
source("myfunction.R") is the usual approach. You could also
just copy your code and paste it into the R console.
Sarah
On Tue, Mar 15, 2011 at 9:21 AM, bra86 wrote:
> How could one get started with a self-written function?
> I have a function written in .txt format, but can not find the way to
This is!
Thank you everyone.
Caveman
On Tue, Mar 15, 2011 at 4:24 PM, Dimitris Rizopoulos <
d.rizopou...@erasmusmc.nl> wrote:
> try the following:
>
> DF <- as.data.frame(matrix(sample(2, 120, TRUE), 10, 12))
>
> Results <- data.frame(
>var = names(DF),
>count = colSums(DF == 1),
>
Solved. Thanks.
--
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
the thing itself have purpose? Or do we, what's the word... imbue it.
?"while"
You don't want a for loop. You need a while loop.
--
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
the thing itself have purp
On Tue, Mar 15, 2011 at 10:29 AM, Jonathan P Daily wrote:
> I apologize for being unclear in my original post. What I am trying to
> achieve is to capture the stdin() connection and read in a single
> keystroke - including arrow keys and the like - without having to have to
> use the return key ea
On Tue, Mar 15, 2011 at 10:24 AM, Gabor Grothendieck
wrote:
> On Sun, Mar 13, 2011 at 10:00 PM, Raoni Rosa Rodrigues
> wrote:
>> Hello R Help,
>>
>> I'm working in a project with a software that register date and time data in
>> serial time format. This format is used by excel, for exemple. In t
I apologize for being unclear in my original post. What I am trying to
achieve is to capture the stdin() connection and read in a single
keystroke - including arrow keys and the like - without having to have to
use the return key each time. My goal is to create a small UI for rapidly
looking th
On Sun, Mar 13, 2011 at 10:00 PM, Raoni Rosa Rodrigues
wrote:
> Hello R Help,
>
> I'm working in a project with a software that register date and time data in
> serial time format. This format is used by excel, for exemple. In this
> format, 40597.3911423958 is 2011/2/23 09:23:15. First part is
try the following:
DF <- as.data.frame(matrix(sample(2, 120, TRUE), 10, 12))
Results <- data.frame(
var = names(DF),
count = colSums(DF == 1),
percentage = colMeans(DF == 1)
)
I hope it helps.
Best,
Dimitris
On 3/15/2011 3:13 PM, Orvalho Augusto wrote:
I have a dataset like thi
Try this:
data.frame(count = colSums(x == 1), percentage = colSums(x == 1) / nrow(x))
On Tue, Mar 15, 2011 at 11:13 AM, Orvalho Augusto wrote:
> I have a dataset like this:
>
> q25_1 q25_2 q25_3 q25_4 q25_5 q25_6 q25_7 q25_8 q25_9 q25_10 q25_11
> q25_12
> 1 2 2 1 1 2
I have a dataset like this:
q25_1 q25_2 q25_3 q25_4 q25_5 q25_6 q25_7 q25_8 q25_9 q25_10 q25_11 q25_12
1 2 2 1 1 2 1 2 1 1 2 1 3
2 2 2 2 1 2 1 2 1 1 2 1 2
3 2 1 1 1 2
Hello,
I have written a 'for' loop which on the first run makes nearest neighbour
calculations for my dataset 'A' in relation to dataset 'B', then based on
these results, some of the rows from A are moved into dataset B, and the
calculation is repeated on the remaining rows in A. Therefore a s
Right.
?which.max
is what's needed.
-- Bert
On Tue, Mar 15, 2011 at 6:00 AM, nblarson wrote:
> That actually won't work. max(y) will give a value, not a coordinate, so
> x[max(y)] is definitely not what you want.
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Finding-
?strsplit
x <- "ThisIsaString"
y<- strsplit(x,"")
This gives a list, which you can convert to a vector by unlist(y)
Incidentally, you could have found out about strsplit via R's
help.search("character string") (or similar) or even googling "R
string function" . Please use R's native Help capabil
1 - 100 of 134 matches
Mail list logo