Displaying 20 results from an estimated 20000 matches similar to: "How to handle "~" character after csv importation"
2012 Mar 07
1
Demographic Variables in AIDS (Demand System)
Hi all,
I am using aidsEst( ) in "micEconAids" package to estimate Demand system.
But I would like to add more demographic variables in demand system. How can
I add those information?
for example:
mydata<-data.frame(p1,p2,p3,p4,
s1,s2,s3,s4,
totalexp,
2013 Jan 21
1
Very slow in processing the equation in the scatter plot ggplot
Hello All,
I have plotted a scatter plot in ggplot2 and added a regression line and a
regression equation. But the processing is very very slow. One reason might
be because I have so many data pairs. Is there any way to speed up this
code ? I need to create a multiple layout as well.
The code I have used is as follows:
setwd("C:/Users/jzd0009/Documents/R software")
mydata <-
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
Hi,
# For publications, I am not allowed to repeat the axes. I have tried to
remove the axes using:
# yaxt="n", but it did not work. I have not understood how to do this in
ggplot2. Can you help me?
# I also do not want loads of space between the graphs (see below script
with Dummy Data).
# If I could make it look like the examples on the (nice) examples page:
#
2007 Nov 24
2
'Split' character
Dear R-users,
The following code splits a very simple dataframe into a list, each element of
the list being one line of the dataframe. You will see that the split function
names each element of the list by using uses the content of a and b and merging
them with a "." character. Is there a way to customize this character?
a<-1:10
b<-21:30
mydata<-data.frame(a,b)
2012 May 22
1
RNORM matrix based on CSV file values for MEAN and SD
This should (hopefully) be a pretty simple task. What I'd like to do is read
in a csv file containing means and standard deviations for a large number of
'n' parameters (up to 2000). The list would be in the following format (see
attached read.csv):
Paramter(1), mean, standard dev.,
Paramter(2), mean, standard dev.,
Paramter(3), mean, standard dev.,
...
Paramter(n), mean, standard
2010 Oct 01
1
add a new column to data frame
Hi, I am wondering if anyone can propose a simple/best way to do the following:
Let's say I have a data frame
dat <-
cbind(expand.grid(mode=c('right','left'),time=0:3,id=c('p1','p2','p3')),y=c(3,5,rep(4,6),6,2,rep(3,6),4,4,rep(2,6)))
dat
mode time id y
1 right 0 p1 3
2 left 0 p1 5
3 right 1 p1 4
4 left 1 p1 4
5 right 2
2000 Jan 06
1
nlme
Among others, datam contains the columns: logconc, tm, dose, subj, bilirubin.
None of these are factor variables.
The following compartment models work (the first still has not
converged after 100 interations):
res1 <- nlme(logconc~p2+p3+log(dose/(exp(p1)-exp(p2))*
(exp(-exp(p2)*tm)-exp(-exp(p1)*tm))),start=list(fixed=c(5,-2,-0.1)),
fixed=list(p1+p2+p3~1),control=list(maxIter=100),
2006 Jul 14
1
Optim()
Dear all,
I have two functions (f1, f2) and 4 unknown parameters (p1, p2, p3, p4). Both
f1 and f2 are functions of p1, p2, and p3, denoted by f1(p1, p2, p3) and
f2(p1,p2,p3) respectively.
The goal is to maximize f1(p1, p2, p3) subject to two constraints:
(1) c = k1*p4/(k1*p4+(1-k1)*f1(p1,p2,p3)), where c and k1 are some known
constants
(2) p4 = f2(p1, p2, p3)
In addition, each parameter
2007 Jun 18
4
triangle contour plots
Suppose I have three numbers p1, p2, p3 with
0 <= p1,p2,p3 <= 1 and p1+p2+p3=1,
and a function f=f(p1,p2,p3) = f(p1,p2,1-p1-p2).
How to draw a contour plot of f() on the p1+p2+p3=1 plane,
that is, an equilateral triangle?
Functions triplot(), triangle.plot(), and ternaryplot() give
only scatterplots, AFAICS
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre,
2011 Mar 29
4
Creating 3 vectors that sum to 1
I have 3 vectors: p1, p2, and p3. I would like each vector to be any
possible value between 0 and 1 and p1 + p2 + p3 = 1. I want to graph these
and I've thought about using scatterplot3d(). Here's what I have so far.
library(scatterplot3d)
p1 <- c(1,0,0,.5,.5,0,.5,.25,.25,.34,.33,.33,.8,.1,.1,.9,.05,.05)
p2 <- c(0,1,0,.5,0,.5,.25,.5,.25,.33,.34,.33,.1,.8,.1,.05,.9,.05)
p3 <-
2010 Jun 13
1
Pairwise cross correlation from data set
Dear list,
Following up on an earlier post, I would like to reorder a dataset and
compute pairwise correlations. But I'm having some real problems
getting this done.
My data looks something like:
Participant Stimulus Measurement
p1 s`1 5
p1 s`2 6.1
p1 s`3 7
p2 s`1 4.8
p2
2006 Mar 15
2
Regarding aov Error()
The following dummy data frame has factor Q (with 2 levels) nesting
factor P (with levels p1 and p2 nested under q1, and p3 and p4 nested
under q2), but both crossing the random variate s, which has 8
levels. The dependent measure is dv.
> # The data frame:
> testnest
dv s P Q
1 1 s1 p1 q1
2 2 s2 p1 q1
3 1 s3 p1 q1
4 2 s4 p1 q1
5 1 s5 p1 q1
6 3 s6 p1 q1
7 3 s7
2010 Aug 04
4
Passing the name of a variable to a function
Dear colleagues,
I have a problem which has bitten me occasionally. I often need to
prepare graphs for many variables in a data set, but seldom for all.
or for any large number of sequential or sequentially named variables.
Often I need several graphs for different subsets of the dataset
for a given variable. I run into similar problems with other needs
besides graphing.
What I would like to
2009 Feb 12
1
Optim
Dear R user I follow the steps defined in Modern applied statistics page(453)
to use optim. However, when I run the following code the parameters seems
way off and the third parameter(p3) stayed as the initial value.
below is the code:
## data
da=c(418,401,416,360,411,425,537,379,484,388,486,380,394,363,405,383,392,363,398,526)
### initial values
pars=c(392.25, 507.25, 0.80)
2008 Feb 04
2
make dataframe from table
Dear R-experts,
I have got a dataframe:
data
ID disease
V1 V2
1 p1 1
2 p1 3
3 p3 3
4 p3 5
5 p5 1
From which I extract a usefull table: affect
affect
1 3 5
p1 1 1 0
p3 0 1 1
p5 1 0 0
I want to merge this with anotherdataframe:
age
p1 23
p2 24
p3 23
p4 11
p5 45
If have tried as.data.frame(affect) and other solutions to get the
following comment going:
2012 Oct 05
2
problem with convergence in mle2/optim function
Hello R Help,
I am trying solve an MLE convergence problem: I would like to estimate
four parameters, p1, p2, mu1, mu2, which relate to the probabilities,
P1, P2, P3, of a multinomial (trinomial) distribution. I am using the
mle2() function and feeding it a time series dataset composed of four
columns: time point, number of successes in category 1, number of
successes in category 2, and
2023 Mar 09
1
reemplazar valores en texto según condiciones
Hola,
Algo que me está pasando con esta función es lo siguiente:
A "p1" lo tengo que reemplazar por "p1_integra_datos" y a "p10" por
"p10_cuales_rep", pero como p10 contiene p1, y así pasa con otras preguntas
(p2 y p20, por ejemplo),
me los reemplaza en ambas, cuándo lo que busco es otra cosa.
reglas$condicion_final <-
2005 Jun 21
2
TEQL and Subnet problem
TEQL and Subnet problem
I have a network topology shown below, and I am trying to use TEQL. My
problem is: When I ping to P3.teql0 from P2 ("[P2]# ping 16.119.144.66"),
the traffic can never go from P2.eth1, and all traffic only goes to
P1.eth0. What P2.eth1 (16.119.144.33) did is broadcasting an ARP asking
for the MAC address of 16.119.144.66, although I have specified the route
to
2018 Mar 18
1
How to take difference of sets when there is an empty subset involved
Hello,
Problem I am facing is as follows:
Set A is made of 2 sets x and y
x<-{"P1", "P2", "P3", "P4"}
y<-{}
A<-set(x,y)
#A={{}, {"P1", "P2", "P3", "P4"}}
i need to use A in a recursive loop where i need to take set difference of
A and it 's elements.
Example:
for (i in A){
print(i)
2010 Jul 23
1
(no subject)
Dear R list,
I use the constrOptim to maximize a function with four constriants but the answer does not leave from the starting value and there is only one outer iteration. The function is defined as follows:
tm<-function(p){
p1<-p[1]; p2<-p[2]; p3<-p[3];
p4<-1-p1-p2-p3;
p1*p2*p3*p4}
##the constraints are p1>=0; p2>=0; p3>=0 and p4>=0 i.e. p1+p2+p3<=1