Displaying 20 results from an estimated 198 matches for "value1".
Did you mean:
value
2023 Mar 02
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
....frame(a = 1, 2, 3)
#> a X2 X3
#> 1 1 2 3
(and in general warnings make for unpleasant debugging so I prefer when we
don't add new ones if avoidable)
playing a bit more with it, it would make sense to me that the following
have the same output:
coefficient <- 3
data.frame(value1 = 5) |> transform(coefficient, value2 = coefficient *
value1)
#> value1 X3 value2
#> 1 5 3 15
data.frame(value1 = 5, coefficient) |> transform(value2 = coefficient *
value1)
#> value1 coefficient value2
#> 1 5 3 15
[[alternative HTML versio...
2012 Oct 15
1
How to read XML in UTF-8 format?
How to read xml in UTF-8 format. I have one XML file but i want to read it
in UTF-8 format. How this is possible?
<barplot>
<cd>
<name>?</name>
<value1>3</value1>
<value2>2.9</value2>
</cd>
<cd>
<name>?</name>
<value1>3.3</value1>
<value2>3</value2>
</cd>...
2023 Mar 02
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
...gt;
I find silence to be much more unpleasant in practice when debugging,
myself, but that may be a personal preference.
>
>
> playing a bit more with it, it would make sense to me that the following
> have the same output:
>
>
> coefficient <- 3
>
>
> data.frame(value1 = 5) |> transform(coefficient, value2 = coefficient *
> value1)
>
> #> value1 X3 value2
>
> #> 1 5 3 15
>
>
> data.frame(value1 = 5, coefficient) |> transform(value2 = coefficient *
> value1)
>
> #> value1 coefficient value2
>
> #&...
2010 Dec 17
4
How to arrange the data
Dear R helpers
I have one data as given below.
date value1 value2 value3
30-Nov-2010 100 40 61
25-Nov-2010 108 31 88
14-Sep-2010 11 180 56
I want the following output
date name amount
30-N...
2008 May 02
2
Accesing data frame members from within functions
I am writing a simple R program to execute a t-test repeatedly on data
contained in a data frame. My data looks like this:
Category Value1 Value2
1 .5 .8
1 .3 .9
. . . . . . . . .
2 1.4 1.3
2...
2012 Nov 28
4
remove NA or 0 values
Dear R users,
I want to remove zero's or NA values after this model.
year value1 value2
1854 0 12
1855 0 13
1866 12 16
1877 11 24
year value1 value2
1 12 12
2 11 13
3 16
4 24
Thank you!
--
---
Catalin-Constantin ROIBU
Forestry engineer, PhD
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile pho...
2011 Jul 14
2
cbind in aggregate formula - based on an existing object (vector)
...ar2","var3")
I'd like my aggregate formula (its "cbind" part) to be able to use my
"myvars" object. Is it possible?
Thanks for your help!
Dimitri
Reproducible example:
mydate = rep(seq(as.Date("2008-12-01"), length = 3, by = "month"),4)
value1=c(1,10,100,2,20,200,3,30,300,4,40,400)
value2=c(1.1,10.1,100.1,2.1,20.1,200.1,3.1,30.1,300.1,4.1,40.1,400.1)
example<-data.frame(mydate=mydate,value1=value1,value2=value2)
example$group<-c(rep("group1",3),rep("group2",3),rep("group1",3),rep("group2",3)...
2006 Dec 05
5
if(){} else{}
Dear R-community,
my data set looks like 'mat' below.
Plant<-c(NA,1,1,1,NA,NA,NA,NA,NA,1);
Value1<-rnorm(1:10);
Value2<-rnorm(1:10);
mat<-cbind(Plant,Value1,Value2);
I receive data from two different sites.
One site is identified by an interger number, the other site has no data in
column Plant=NA.
My pb:
I'm trying to assign labels "A" or "B" to these 2 sites...
2012 Nov 08
3
Beginner help about output in R
Dear R experts,
I am a beginner with R and I have a question regarding the output of a
function.
Basically, I created 2 functions, value1 and value2, that calculate two
values, and I would like to print those two values to an output datafile. I
tryed the following function:
function (x) {write.table(data.frame(value1(x),value2(x)),file=output.txt)}
My problem is that I would like to calculate those values for different
values of x...
2011 Oct 24
1
Creating data frame with residuals of a data frame
...am trying to create a data frame from the residuals I get after
having applied a linear regression to each column of a data frame, but
I don't know how to create this data frame from the resulting list
since the list has differing numbers of rows.
So for example:
age<- c(5,6,10,14,16,NA,18)
value1<- c(30,70,40,50,NA,NA,NA)
value2<- c(2,4,1,4,4,4,4)
df<- data.frame(age, value1, value2)
#Run linear regression to adjust for age and get residuals:
lm_f <- function(x) {
x<- residuals(lm(data=df, formula= x ~ age))
}
resid <- apply(df,2,lm_f)
resid<- resid[-1]
Then resid is...
2014 Feb 03
1
[PATCH] hivex: python: value_value no longer generates Unicode strings
...uot;B")
+assert B
values = [
{ "key": "Key1", "t": 3, "value": "ABC" },
{ "key": "Key2", "t": 3, "value": "DEF" }
]
-h.node_set_values (b, values)
+h.node_set_values (B, values)
value1 = { "key": "Key3", "t": 3, "value": "GHI" }
-h.node_set_value (b, value1)
+h.node_set_value (B, value1)
value1 = { "key": "Key1", "t": 3, "value": "JKL" }
-h.node_set_value (b, value1)
+h.node_set...
2008 Sep 28
2
using tapply on a data frame in a function
...m trying to use tapply to find group means in a function. It works
outside of a function, but I get the error message from the following code:
"Error in tapply(index, cluster, mean) : arguments must have same length."
Any suggestions? Thanks.
eric
d <- data.frame(cbind(cluster=1:2, value1=1:10, value2=11:20))
d
FindClusterTraits <- function(framename, index){
MeanCluster <- with(framename, tapply(index, cluster, mean))
return(MeanCluster)
}
d2 <- FindClusterTraits(d, 'value1')
[[alternative HTML version deleted]]
2013 Feb 11
2
How to plot doubles series with different location using plotCI
...argument works well. Is there any argument defining the series location within
plotCI. For example the tool “boxplot” contains the “at” argument. I found
examples of plotCI where a vertical shift is realized (e.g. “x=means+1e5”), never a horizontal shift.
Here
you find data information:
##data
value1<-c(1,2,1,2,1,3,4,2,6,1,3,4,2,6)
value2<-c(1,5,1,2,4,4,4,3,3,1,3,4,9,8)
typo<-c("C","C","C","C","A","A","A","A","A","B","B","B","B","B")
tab1<-data....
2011 Oct 21
2
[LLVMdev] Replacing uses within a function
Hi all,
I am trying to replace all uses of a value1 *inside of a given function*
to use value2. My strategy was to iterate all the basic blocks, again
iterating all the instructions in each basic block, and using
replaceUsesOfWith(value1, value2) for every instruction.
This used to work all right, but now I am finding some problems. There
are instr...
2010 Jun 17
1
big big problem
Dear list,
I'll try to be more clear in explaining my problem. I have a data frame like this called X:
CLUSTER YEAR variable value1 value2
M1 2005 EC01 NA NA
M1 2006 EC01 2 5
M1 2007 EC01 4 5
M2 2005 EC01...
2006 Apr 06
1
reshape question
Hi,
I have a data fram like this:
date column1 column2 column3 value1 value2 value3
1-1 A B C 10 5 2
2-1 A B D 5 2 0
3-1 A B E 17 10 7
How can I reshape it to:
date column1 column2 column3 v x
1-1 A B C value1 10
1-1 A B C value2 5
1-1 A B C value3 2
2-1 A B D value1 5
2-1 A B D value2 2
2-1 A B D value3 0
3-1 A B E value1 17
3-1 A B E value2 10
3-1 A B E value3 7...
2005 Sep 19
3
Lists and data frames (PR#8143)
...ws
Submission from: (NULL) (193.174.73.34)
Hi,
The pdf file R-intro descripe on page 27 that lists can be extended by adding
numbers.
Unfortunately, it's not working
## example :
# if i did not declare the variable an error occurs : object not found
mylist <- list()
mylist[1] <- list(value1=3, value2=5)
## Error
Can you please help me
Thank you
Regards
Frank Wagner
2007 Dec 03
3
Request param type of array
Hello.
I have tested such form:
<form method=''POST''>
<input type=''hidden'' name=''myfield'' value=''value1''>
<input type=''hidden'' name=''myfield'' value=''value2''>
<input type=''submit'' name=''_submit'' value=''OK''>
</form>
================
After submitting my form:
&l...
2010 Nov 30
1
more flexible "ave"
...l per group for this
data.frame:
df <- data.frame(site = c("a", "a", "a", "b", "b", "b"),
gr = c("total", "x1", "x2", "x1", "total","x2"),
value1 = c(212, 56, 87, 33, 456, 213))
df
calcPercent <- function(df) {
df <- transform(df, pct_val1 = ave(df[, -c(1:2)], df$gr,
FUN = function(x)
x/df[df$gr == "total", "value1"]) )
}
# This works as intended....
2011 May 05
3
Alter a line in a file.
Hi all R users
Ive got a file that contains diffrent settings in the manor of:
setting1="value1"
setting2="value2"
setting3="value3"
setting4="value4"
.
.
.
What I want to do is open the file and change the value of a specific
setting
like wanna change setting4="value4" -> setting4="value5" and then save the
file again.
setting1=&quo...