Displaying 20 results from an estimated 10000 matches similar to: "Converting characters to numbers in data frames"
2004 Oct 20
2
Odd behaviour with scale()
Moi!
A student here has been getting a bit irritated with some side effects
of scale() (OS is Windows XP, the behaviour occurs in R 2.0.0, but not
1.7.1). The problem is that she scales a variable in a data frame, then
does a regression, and tries to get some predictions for some new data.
However, at this point she gets an error (see the example below). This
seems to be because the
2004 Sep 29
0
[Fwd: OpenBUGS]
This is slightly off-topic, but there was a discussion about MCMC a
couple of weeks ago. OpenBUGS can operate from R, at least in Windows
(there are some problems in Linux at the moment).
The interface with R is one are that there are plans to work on: it's a
bit basic at the moment.
Bob
--
Bob O'Hara
Dept. of Mathematics and Statistics
P.O. Box 68 (Gustaf H??llstr??min katu 2b)
2006 May 05
2
How to access results of survival analysis
Hi List,
A friend of mine recently asked the same question as Heinz T?chler. Since
I've already written the code I'd like to share with the list.
# x is an object returned by "survfit";
# "smed" returns a matrix of 5 columns of
# n, events, median, 0.95LCL, 0.95UCL.
# The matrix returned has rownames as the
# group labels (eg., treatment arms) if any.
smed <-
2004 Mar 19
2
Odd behaviour of step (and stepAIC)?
I can only assume I'm betraying my ignorance here, but this is not what
I would expect.
I'm getting the following from a stepwise selection (with both step and
stepAIC):
> step(lm(sqrt(Grids)~ SE + Edge + NH), scope=~ (Edge + SE + NH)^2)
Start: AIC= 593.56
sqrt(Grids) ~ SE + Edge + NH
Df Sum of Sq RSS AIC
<none> 2147.0 593.6
+ Edge:NH 1
2004 Jun 22
2
function not in load table
Hi,
I apologize for this often/old question. I found some hints but couldn't
solve the problem so far.
I have C functions (incl. the header files) as well as the R wrapper
functions which I want to use for faster calculations. These functions
are included in a R package.
The installation process seems to be ok (no errors). I also can load the
package without errors. But when I call the
2004 Mar 02
2
Problem with Integrate
The background: I'm trying to fit a Poisson-lognormal distrbutuion to
some data. This is a way of modelling species abundances:
N ~ Pois(lam)
log(lam) ~ N(mu, sigma2)
The number of individuals are Poisson distributed with an abundance
drawn from a log-normal distrbution.
To fit this to data, I need to integrate out lam. In principle, I can
do it this way:
PLN1 <- function(lam, Count,
2009 Nov 12
1
Substituting vectors into a legend
I have a simple (!) problem. What I want to do is to create a legend with
Greek letters, and substituting numbers into the legend. Like this:
mu=1:3
Mean=rep(mu, each=20)
plot(runif(60), rnorm(60,Mean,0.1), pch=Mean) # create a plot
legend(0.6,1.7, paste("mu =", 1:3), pch=mu)
but with a Greek letter mu.
I think the solution has something to do with substitute() possibly along
with
2004 Jan 26
0
isolinux 2.08: screen garbage when loading kernel?
I'm using the RIP Linux mini rescue distribution.
http://www.tux.org/pub/people/kent-robotti/looplinux/rip/
I have modified v. 7.0 for usage on our 32 node Tyan Tiger MPX Linux
cluster with a serial console. Because of a bug with Grub on this
motherboard when running headless and using a serial console I use the
optional Isolinux version 2.08 also included with RIP Linux to boot from
a
2004 Dec 19
1
Different graph type can coexisti??
Please consider a data frame
A B C D
1 4 5 0
2 3 2 75
3 4 1 84
4 5 1 90
5 3 0 100
Is there a way to plot column B and C as barplot *and* D as line on the same
graph??
R-2.0.1 powered by Mandrake 10.1
-------------------------------------------------------------------------------------------------------------------------
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39)
2013 Jan 23
4
extracting characters from a string
Dear All,
I have a data frame of vectors of publication names such as 'pub':
pub1 <- c('Brown DK, Santos R, Rome DF, Don Juan X')
pub2 <- c('Benigni D')
pub3 <- c('Arstra SD, Van den Hoops DD, lamarque D')
pub <- rbind(pub1, pub2, pub3)
I would like to construct a dataframe with only author's last name and each last name in columns and the
2008 Sep 12
4
reading in results from system(). There must be an easier way...
Hello,
I am currently using R to run an external program and then read the results
the external program sends to the stdout which are tsv data.
When R reads the results in it converts it to to a list of strings which I
then have to maniuplate with a whole slew of commands (which, figuring out how
to do was a reall challenge for a newbie like myself)--see below.
Here's the code I'm
2017 Sep 20
0
arguments imply differing number of rows
4000:6000 gives you 4000, 4001, ..., 6000. I suspect you want
population= c(seq(4000, 6000, length=5), seq(3500, 4300, length=5),
seq(3000, 3200, length=5))
Bob
On 20 September 2017 at 17:07, Shivi Bhatia <shivipmp82 at gmail.com> wrote:
> Hi Team,
>
> I using the syntax as:
>
> data.df<- data.frame(
> city= c(rep(c("Delhi",
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
2004 Feb 17
0
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
Dear friends,
Over the past weeks, I have been asking a lot of questions about how to
use R in Bayesian analysis. I am brand new to R, but I am very pleased with
it. I started with winbugs but I found winbugs to be a limited software, not
bad but has several limitations. By contrast, R allows the analyst to tackle
any problem with a huge set of tools for any kind of analysis. I love R. In
2004 Jul 24
3
Population simulation.
Hello,
can anyone tell me if R has any special function for simulating the structure
of human populations? Something like the genetic algorithm?
I need to simulate a sample of a population with a specific structure. Is
there something on R that can help me?
Thanks to everyone.
__________________________________________________________
2009 Jan 24
1
fonction PLATEAU???
Hello,
I am working on extracting data from sound recording (fee bee song of the black-capped chickadee). I obtained a two column matrix with x=time(s) and y=frequency(khz). The part of the recording that is interesting me is when the frequency is stable. Does somebody ever used a fonction that extract only constant data among a huge list of data (sample= 180000)?
Thanks
Thibault Grava
2018 Apr 24
0
How to visualise what code is processed within a for loop
The loop never assigns anything to d0, only t. The first line makes t
a character string "d0$V1" (or "d0$V2" etc.). The second line assigns
either 0 or 1 to t.
Looking at this, I don't think you've got into the R psychology (bad
news if you want to use R, good news in many other ways). I assume d0
is a list, so could you put the V's into a vector, and then just use
2017 Jun 29
0
Help : glm p-values for a factor predictor
It might help if you provided the code you used. It's possible that
you didn't use direction="backward" in stepAIC(). Or if you did, it
was still running, so whatever else you try will still be slow. The
statement "R provides only the pvalues for each level" is wrong: look
at the anova() function.
Bob
On 29 June 2017 at 11:13, Beno?t PELE <benoit.pele at
2009 Mar 19
1
subtract values
Dear R-help
I am using R version 2.6.2. I am trying to subtract specific values from a larger data frame. I feel this should be straightforward, but I am struggling.
I have a dataframe "Bk" as follows:
DateTime cumPrecip
01/01/2008 00:00 348
01/01/2008 01:00 348
01/01/2008 02:00 348
01/01/2008 03:00 347
01/01/2008 04:00 348
01/01/2008 05:00 348
01/01/2008 06:00 349
2004 Oct 31
2
(no subject)
Dear all,
I have several questions regarding fisher.test() in
R, and I'd highly appreciate any help with it.
I have a group of observations, each having people's
income, and an indicator of whether selected in or out
a program. I want to test the difference between
income of people who are in and out.
Because the distribution is far from normal, I decide
to use the fisher's exact
2004 Oct 31
2
(no subject)
Dear all,
I have several questions regarding fisher.test() in
R, and I'd highly appreciate any help with it.
I have a group of observations, each having people's
income, and an indicator of whether selected in or out
a program. I want to test the difference between
income of people who are in and out.
Because the distribution is far from normal, I decide
to use the fisher's exact