Displaying 8 results from an estimated 8 matches for "cragent".
Did you mean:
cfagent
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
seq(2,3,by=0.5) --&g...
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, c(0,-10,-20,-30,-40,-50,-60,-70,-80)), label=r...
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 for every of ea...
2010 Nov 17
1
Give me all operator
Hello is there in R any operator that give you all the data of a matrix
for example in matlab
x(2,3) returns the 2ndth row and 3rdth column
x(2,:) returns all the columns of the 2nd row.
In R now I would like to print all the
CRagent[[i]][2]
CRagent[[:]][2] doesnot work of course. Other option is to make a loop with an index i that spans from 1:last element of CRagent[[]] but this is not that optimal.
I would like to thank you in aavance for your help
Best Regards
Alex
[[alternative HTML version deleted]]
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
...tion 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.
plot_shad_map<-function(f,CRagent,agentid){
for (i in c(1:nrow(shad_map))){
for (j in c(1:ncol(shad_map))){
# Do something
}
}
plot_shad_f(shad_map) # This plots fine when used in command line. But inside this #function does not
return(shad_map)
}
Unfortunately I get no plot . What might be the problem?
One m...
2012 Jan 03
0
Create and Initialize List values
Dear all,
seasons greetings,
I had made a list of elements that I want to have
# list generator
Agent<-list(id=NA, position=list(x=NA,y=NA))
# Make list of Agents
AgentList<-rep(list(CRAgent),5)
# Initialization. Is it shorter to do that with a lapply statement?
for (i in c(1:length(CRAgentList))){
AgentList[[i]]$id=i
}
The created struct looks like
> str(AgentList)
List of 5
$ :List of 3
..$ id : int 1
..$ position :List of 2
.. ..$ x: log...
2010 Nov 24
0
4. Rexcel (Luis Felipe Parra)-how to run a code from excel
...tion 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.
plot_shad_map<-function(f,CRagent,agentid){
for (i in c(1:nrow(shad_map))){
for (j in c(1:ncol(shad_map))){
# Do something
}
}
plot_shad_f(shad_map) # This plots fine when used in command line. But
inside this #function does not
return(shad_map)
}
Unfortunately I get no plot . What might be the problem?
One m...