Displaying 20 results from an estimated 2000 matches similar to: "Give me all operator"
2010 Oct 22
2
create sequence of numbers
Hello.
I want to create some sequence of numbers . So far I used sequence which does
not work always
seq(CRagent[[1]]$xy[1],CRagent[[2]]$xy[1],by=0.01)
Error in seq.default(CRagent[[1]]$xy[1], CRagent[[2]]$xy[1], by = 0.01) :
wrong sign in 'by' argument
Calls: seq -> seq.default
if the parameters are in descending form.
The ideal would be to be able to use seq like this
2010 Nov 20
2
Merge two ggplots
Hello everyone.
I am using ggplot and I need some help to merge these two plots into one.
plot_CR<-function(x,y,agentid,CRagent){
library(ggplot2)
agent<-CRagent[[agentid]] # To make following expression shorter
ggplot((data.frame(x=CRX,y=CRY,sr=agent$sr)))+
geom_point(aes(x,y,colour=cut(sr,c(0,-10,-20,-30,-40,-50,-60,-70,-80))))+
geom_text(aes(x,y,color=cut(sr,
2011 May 09
3
Recursive Indexing Failed
Dear all,
I would like to ask your help concerning an error message I get.
I have the following struct
str(CRagentInTime[[1]])
List of 2
$ timelag: int 0
$ CRagent:List of 50
..$ :List of 3
.. ..$ CRmap: num [1:256, 1:256] NA NA NA NA NA NA NA NA NA NA ...
.. ..$ xy : num [1:2] 10 177
.. ..$ sr : num [1:49] -94.9 -92.8 -79.5 -97.6 -78.4 ...
and I wanted to select all the sr fields
2011 Jan 06
1
Find and remove elemnts of a data frame
Dear all,
I have a data frame that is created like that
data.frame(x=CRX[-1],y=CRY[-1],z=CRagent[[1]]$sr)
the output looks like
45 116 162 -30.89105988567164
46 128 79 -42.66296679571184
47 180 195 -30.45626175641315
48 114 83 -45.26843476475688
49 118 73 -46.85389245327003
How can I select only the rows that their third column is higher that -45?
This will return the following
116 162
2010 Nov 22
1
plot inside function does not work
Hello everyone,
when I commit a plot using console(command line?) plot works fine. I have created a function that plots based on the input. This function is called plot_shad. When I call this function alone in the command line I get my plot.
Then I tried to use another function as depicted_below to do some calculation before calling the function that does the plotting.
2010 May 19
3
save in for loop
Dear users,
My problem concerns save() within a for loop.
Here is my code:
for (i in 1:4) {
temp <- data.frame(a=(i+1):(i+10), b=LETTERS[(i+1):(i+10)])
filename <- paste("file", i, sep="")
assign(filename, temp)
save(filename, file=paste(filename, ".rda", sep=""))
}
As you can see, save() doesn't work as I would like: (1) the object
2010 Mar 11
3
Help function "?" in R 2.10.1
Hello everyone,
I have versions 2.7.2 and 2.10.1 installed on a machine that has no
access to internet.
In 2.7.2 I can use ? to get help on functions, which in 2.10.1 that
does not work, all I see is "starting httpd help server...done" and
then nothing.
Have I downloaded 2.10.1 incorrectly (=forgot to tick some box for
local help file repository) or is the internet help now the
2010 Nov 01
2
number of items to replace is not a multiple of replacement length
Hey all,
I am writing a function in which I will have a matrix of 4 columns and a
variable amount of rows.
The first to columns will always contain be of the Character type, the third
and fourth columns
can be a variation of data types, usually characters and integers, but
sometimes lists or matrices.
At one point the code makes, for each row, a copy of that row, then it makes
some adjustments
2010 Sep 21
2
labels in (box)plot
Dear users,
I would like all the ticks on a boxplot (x and y) to be labeled
I have checked all the par() arguments but couldn't find what I'm
looking for
Here is an example to show it:
df <- structure(list(SPECSHOR = structure(c(1L, 1L, 1L, 3L, 3L, 3L, 3L,
3L, 4L, 4L), .Label = c("cotau", "dibic", "eqgre", "gicam"), class =
2010 May 18
3
"Re: Change class factor to numeric"
sorry I had a mistake sending my question without a subject. I do resend again. Please excuse me.
> Hello
> I have a data array with soil variables (caperf), in which the variable "clay" is factor (as I see entering str(caperf)) . I need to do a regression model, so I need to have arcilla (=clay) as a numeric variable. For that I have entered
>
>
2010 May 20
2
Overlap of leaf labels
Hi,
I have tried looking at the archives but havent found any answer that works
till now (Sorry if i have missed anything)
I am a newbie to R and i am trying to carry out hierarchical clustering
using hclust -> as.dendrogram and then plotting the results as a dendrogram
using the plot function plot(object).
My question is :
In the function "plot", can one decrease the leaf label
2011 Aug 15
3
how can I read a xlsx file
Hello,
How can I read a xlsx file using xlsx package?
Thanks
Albert
[[alternative HTML version deleted]]
2011 Apr 20
2
user input
Dear users,
I have looked on different sources and found different functions to
prompt the user to provide input. However, I couldn't find one that does
exactly what I'm looking for.
select.list() and menu() are nice because a graphic window appears to
prompt the user. However, the user can only choose from a predefined
list of choices. readline() and scan() are more free in the
2010 Aug 17
2
dims error
Greetings,
I am a very novice user with R, and in the course of running a linking procedure :
P.old<- function (a, c, b, xi){
#a contains a parameters
#c contains c parameters
#b contains b parameters
#xi is a one column vector containing quadrature points for xi(=theta-gamma)for one item
tmp <- a*(xi-b)
2011 May 04
1
Str info. Thanks for helping
It looks from str(SA) that Response IPS1 is a data.frame of class "anova", which probably cannot be coerced to vector.
Maybe you can use unlist() instead of as.vector()
Or something like
SA[["Response IPS1"]]["as.factor(WSD)",] ## to select the first row only, even maybe with unlist()
Without a better REPRODUCIBLE example, I cannot tell more (maybe some others
2010 May 20
6
writing function
Dear group,
I am trying to write functions, but as a beginner, everything is not so
obvious.
Let's say I want the results in a list of elemts like this :
tot1, tot2, etc
Here is a function:
toto <-
function(x,y)
{
for(i in x:y){
paste(c("tot",i),collapse="")<-(i*2)
}
}
If I type this :
>toto(1,5)
I get this message error:
Error in paste(c("tot",
2010 Dec 08
5
Summing up Non-numeric column
Dear All
If I have the following dataset
V1 V2
x y
y x
z b
a c
b j
d l
c o
How do I use R command to get the total number of different letter in column
"V1"
column "V1" has 7 different letters.
Thank you
--
View this message in context: http://r.789695.n4.nabble.com/Summing-up-Non-numeric-column-tp3077710p3077710.html
Sent from the R help mailing list archive
2011 Jun 27
2
Add use of dput() to the instructions at bottom of post?
It's often difficult to figure out what a problem data set looks like when someone pastes a mess of output from R into an e-mail. The dput command, used judiciously?I would hope no one would send a 1 M data set?can make life much easier.
I wonder if it would be useful to add a hint in the instructions at the bottom of the posting page, where the list asks for self-contained reproducible
2010 Dec 13
7
descriptive statistics
Hi. In a data set I have a variable that takes values from 1 to 14. For each
subgroup of values of this variable, I would like to obtain some descriptive
statistics of other variables present in the data set. I've been trying with
a "for" loop but I couldn't get nothing. Could you please suggest me some
lines?
--
View this message in context:
2010 May 20
1
use object within rda file in for loop
Dear users,
I would like to process all the lists from all *.rda files that I have
in one folder.
Up to now, I can load all the *.rda files without any problem.
The problem is when I want to access the list saved within each *.rda
file (only one list per rda file).
Here is my code:
fpath <- "D:/R"
listnames <- list.files(path=fpath, pattern=glob2rx("*.rda"),