Displaying 20 results from an estimated 2000 matches similar to: "creating list of lists"
2010 Nov 29
1
map() and pdf clipping
Hello,
Below is a function (test.map) that permits drawing the same map using
three different devices. The "pdf" device doesn't clip polygons to
the plot region as I see it does by both the native device (in my case
"Quartz") and the "png" device.
test.map("pdf") # produces "test-map.pdf" with no clipping
test.map("png") #
2011 Jan 30
1
Error in { : task 3 failed - "NA/NaN argument"
I'm attempting to run a rather complex routine that involves a few loops, and even some use of foreach and doMPI. I just added another external loop and now get this error message.
Error in { : task 3 failed - "NA/NaN argument"
Is there a way to debug what is causing this error or where? I really have no idea what "task 3" is?
Thanks
Jim
2012 Oct 29
1
XML namespace control
Hello,
I am working with a database system from which I can retrieve these kinds of user defined fields formed as XML ...
<udf:field unit="uM" type="Numeric" name="facs.Stain final concentration">5</udf:field>
You can see in the above example that "field" is defined in the namespace "udf", but that the "udf" namespace is
2012 Nov 14
2
How to filter xml value in R?
Hi,
I have one xml file.
<Class>
<Node1 code ="1"> First node </Node1>
<Node2 code ="1"> Second node </Node2>
<Node3 code ="1"> Third node </Node3>
<Node1 code ="2"> Fourth node </Node1>
</Class>
for (i in 1:xmlSize())
{
print(Class[i]) # how can i filter Node1 ?
}
by
2011 Oct 28
1
Polynomial regression line
The cubic regression of my model is significant and I want to plot a line
that best fits. It's not abline() function, because it has a curve. Please,
how can I plot it?
---
Fernando Andreacci
BiĆ³logo
Fone +55 47 9921 4015
fandreacci@gmail.com
[[alternative HTML version deleted]]
2012 Nov 03
1
How to make pch symbols thicker?
Hi I need to know how to make pch symbols like pch=3 (+) or pch=4(x) or even
the border of squares or triangles thicker without changing the size. I have
a lot of symbols of different colors but you can't see the colors clearly
and I don't want to change the symbol.
Thanks!
--
View this message in context: http://r.789695.n4.nabble.com/How-to-make-pch-symbols-thicker-tp4648295.html
2011 Nov 15
3
if/else scope
What is wrong with the following?
x <- 1:2
if(x[1] > 0)
{
if(x[2] > 0)
{
print("1 & 2 > 0")
}
else
{
print("1 > 0")
}
}
else
{
if(x[2] > 0)
{
2010 Dec 10
3
Textwrangler Languages Folder
Dear R Community,
I recently switched to a Mac (10.6.5), and have installed Textwrangler to
run code to R. However, I can't install the syntax highlighting file because
I can't find the directory: "~Users/username/Library/Application
Support/TextWrangler/Language Modules/". Is there a different location I can
place the syntax highlighting file?
Scott
[[alternative HTML
2011 Dec 23
2
Custom XML Readers
I need to construct a custom XML reader, the files I'm working with are in
funky XML format:
<str name="author">Paul H</str>
<str name="country">USA</str>
<date name="created_date">2010-02-16</date>
I want to read the file so it looks like:
author = Paul H
country = USA
created_date=2010-02-16
Does any one know how to
2012 Sep 26
1
RCURL ftp upload - ASCII or Binary type?
I'm trying to upload a file using RCURL:s ftpUpload() to a ftp-server using the following command:
> ftpUpload("'VERY.ODD.FILE.NAME(+1)'",to="ftp://x.x.x.x/","' VERY.ODD.FILE.NAME(+1)'",userpwd="USER:PASSWORD")
OK
0
The file I'm trying to upload is a very simple text-file but with a bit weird filename. Note the ' on each
2011 Mar 14
7
creating character vector
Is there a way to convince R to create a character vector without using the quotes?
This works
ex1 <- c("first","second")
but when I try this it doesn't
ext <- as.character(c(first,second))
it complains. I have many variables to put into character vectors so dispensing with the quotes would be useful.
Thanks
Jim
===============================
Dr. Jim Maas
2011 Sep 09
3
split variable / create categories
Hi,
is there a function or an easy way to convert a variable with continuous values into a categorial variable (with x levels)?
here is what I mean:
I want to transform x:
x <- c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1, 0.6)
into a 'categorial'-variable with four levels so that I get:
[1] 2 2 3 3 4 4 1 1
so each element is converted into its rank- value / categorial-value
(in
2012 Sep 06
1
[Rscript] difficulty passing named arguments from commandline
Wanting a commandline solution (for a problem detailed @
http://mailman.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2012/msg00279.html
) I turned to Rscript, and whacked out the q'n'd
https://github.com/TomRoche/GEIA_to_netCDF/blob/master/netCDF.stats.to.stdout.r
However it wasn't as quick as hoped, because I spent quite a bit of time
figuring out how to pass the arguments.
2012 Jan 05
4
automatic SI prefixes as ticklabels on axis
i want to plot values with frequency on a logarithmic x axis.
similar to this example that i found in the web:
http://www.usspeaker.com/jensen%20p15n-graph.gif
I would like to convert long numbers to si prefix notation
like in the example
(200000 to 200k, 35000000 to 3.5 M)
Of course i could create labels by hand, but
i have many files so i need some automatic function.
Has anyone done that
2013 Jan 22
2
Creating a Data Frame from an XML
Hello,
I'm attempting to read information from an XML into a data frame in R using
the "XML" package. I am unable to get the data into a data frame as I would
like. I have some sample code below.
*XML Code:*
Header...
Data I want in a data frame:
<data>
<row BRAND="GMC" NUM="1" YEAR="1999" VALUE="10000" />
<row
2011 Mar 30
5
save ordinary numerical calculations as pdf
I'd like to save some calculation outputs as a pdf, to incorporate with others in a document. I've tried
pdf("filename")
name_of_object_to_output
dev.off()
but it doesn't seem to work, appears that this pdf function is for graphics?
Is there a way to output numerical objects to pdf?
Thanks
J
Dr. Jim Maas
University of East Anglia
2011 Feb 17
7
removing lower and upper quantiles from an arry
I'm trying to work out the simplest way to remove the upper and lower quantiles, in this case upper and lower 25% from an array. I can do it in two steps but when I try it in one, it fails. Is there something simple missing from my syntax or are there other simple elegant way to accomplish this?
Thanks
J
> i <-1:20
> i2 <- i[i<quantile(i,.75)]
> i3 <-
2010 Aug 24
3
multiple assignments ?
Simple one, have read and googled, still no luck!
I want to create several empty vectors all of the same length.
I would like multiple empty vectors (vec1, vec2, vec3) and want to create them all in one line.
I've tried
vec1,vec2,vec3 <- vector(length=5)
and
c(vec1,vec2,vec3) <- vector(length=5)
and several other attempts but nothing seems to work ... suggestions?
Thanks
Jim
2010 Sep 16
5
using variable from for loop in naming new variables
Simple one here ... but can't get it to work ...
for (i in 1:4){
paste("stuff",[i]),sep="") <- 3 + i
}
ls()
rm(list=ls())
I just want it to create 4 new variables called stuff1, stuff2, stuff3, stuff4 with the corresponding assignments. I realise that there are more elegant functions but this is just a model of a bigger situation.
Thanks
Jim
2011 Feb 18
6
sort a 3 dimensional array across third dimension ?
I'm attempting to sort a 3 dimensional array that looks like this
> x
, , 1
[,1] [,2]
[1,] 9 9
[2,] 7 9
, , 2
[,1] [,2]
[1,] 6 5
[2,] 4 6
, , 3
[,1] [,2]
[1,] 2 1
[2,] 3 2
Such that it ends up like this ....
> y
, , 1
[,1] [,2]
[1,] 2 1
[2,] 3 2
, , 2
[,1] [,2]
[1,] 6 5
[2,] 4 6
, , 3
[,1] [,2]