Displaying 20 results from an estimated 10000 matches similar to: "list: index of the element, that is TRUE"
2011 Sep 29
1
multiplying list with vector
hello everybody,
i have got a question about lists:
i have got the following commands:
mylist <- list("v1"=c(1,2,2,1),"v2"=c(2,2,2,1),"v3"=c(1,1,1,1))
myvector <- c(100,10000,1000000)
now i would like to multiply each element of the list with the corresponding
element of the vector, that is to say:
v1*100
v2*10000
v3*1000000
i only could think of lapply
2011 Sep 19
2
pasting elements of one character vector together
hello,
i am familiar with the paste command with which i can paste for exaple:
object <- "Hello"
paste(object,"World")
now i would like to be able to paste all the elements of the same vector
together e.g:
object <- c("Hello","World")
getting as a result also:
"Hello World".
Does anyone know the solution to this problem?
Thank you
2012 Jan 31
3
function: as.integer
dear r-helpers,
i created an object named A, which looks like this:
A <- c("4.4","1.9","4.1")
now i needed to get numbers instead of characters and for this i used the
function:
as.integer(A)
which resulted in:
[1] 4 1 4
My question is, why the numbers are rounded or more impotantly if
there is a way to keep the decimal numbers?
Thank you very much for
2011 Sep 20
4
open source editor for r for beginners
Hello all,
I am looking for an editor for R which has got functions beyond the normal R
editor that is included in the program.
I had a look at VIM but I think it's difficult if you are just starting
programming.
Could anyone recommend an editor that is suitable for beginners?
Thanks for your help.
Marion
[[alternative HTML version deleted]]
2011 Sep 16
3
writing data from several matrices in R into one excel-file with several sheets
hello,
does anyone know how I can write several matrices from R into one exel-file
using different sheets for the different matrices?
thank you very much in advance for your help.
Marion
[[alternative HTML version deleted]]
2011 Oct 11
2
binding all elements of list (character vectors) to a matrix as rows
dear r-users,
i have got a problem which i am trying to solve:
i have got the following commands:
Mymatrix <- matrix(1:9,ncol=3)
Z <-
list("V1"=c("a","",""),"V2"=c("b","",""),"V3"=c("c","",""),"V4"=c("d","",""))
Mymatrix <-
2012 Jan 02
2
syntax for reading into R
dear users,
we have got the following question:
we have got a text-file looking like this:
...
<trkpt lat="48.272000" lon="16.342984">
<ele>387</ele>
<time>2012-01-01T15:32:03Z</time>
<sat>9</sat>
</trkpt>
<trkpt lat="48.271909" lon="16.343563">
<ele>381</ele>
2012 Apr 12
3
Reading SPSS: underlying numerical codes
Dear people,
I have got a question concerning the underlying numerical codes when
reading an SPSS file into R.
I used the package foreign and when I look at a variable I get the verbal
codes.
I would like to know how it is possible to get the underlying numerical
codes as output, which are the same as in my SPSS file.
Thank you very much in advance for your help!
Marion
[[alternative HTML
2011 Sep 16
2
automatic selection of object without loop
Hello,
does anyone know the solution to this problem:
I imported a dataframe from Spss into R and saved it as an object called
"kinderrechte".
I have got the following command lines:
q1 <- kinderrechte[,"q0007_0001"]
l1 <- q0007_0001_l
now i would like to be able to change the column name in the first command
line (e.g. into q0007_0002) and to get R to automatically
2012 Jul 24
3
package memisc: recode examples
Dear people,
Yesterday I looked at the recode command in the memisc package and ran the
following example stated in the manual:
x <- as.item(sample(1:6,20,replace=TRUE),
labels=c( a=1,
b=2,
c=3,
d=4,
e=5,
f=6))
print(x)
f <- as.factor(x)
f
recode(f,
2011 Sep 15
1
Courses in R
Hello,
I have a question concerning courses in R in *Vienna, Austria*.
Does anyone know where courses in R are offered, that you can do after
having attended a course for the basics?
Thanks in advance for your help.
Marion
[[alternative HTML version deleted]]
2012 Feb 14
2
save objects of own function to workspace
Dear R-helpers,
I created an own function which looks like this
s_elternmz <- function(Var="balt")
{
Dg_a<-mz[,c("asbhh","apkz",Var)]
colnames(Dg_a)[colnames(Dg_a)=="apkz"]<-"bpkzm"
colnames(Dg_a)[colnames(Dg_a)==Var]<-paste(Var,"_m",sep="")
2012 Feb 16
2
import .csv file into R
Dear r-helpers,
I read a .csv file into R
with the following command:
A<-read.csv2(file="Mappe3.csv")
It worked fine, except that I would like to get rid of the points between
the words and get spaces instead like I have got in the .csv file.
At the moment it looks like the following:
habe.mich.gut.mit.KlassenkollegInnen.verstanden
hatte.gutes.Verhältnis.zu.Eltern
2012 May 31
1
maptools: using to sets of information (within two shape files) for one plot
Dear all,
I am using a shape file containing the information regarding the borders of
the PARISHES of Austria. I created a plot with different colours for
different percentages of child care institutions.
Now I would like to add the information of the COUNTY boundaries to this
plot which I have got in another shape file. I would like these boundaries
to be shown with bold lines so that they can
2012 Feb 20
3
Run function several times changing only one argument - without a loop
Dear people,
I created a plot which looks like this:
Ee1<-matrix(c(88,86,74,62,41),ncol=5)
colnames(Ee1)<-c("Lehrer","Lehrerinnen","Klassenkollegen","Klassenkolleginnen","Geschwister")
par(las=1)
par(mar=c(5,13,4,2))
barplot(Ee1,horiz=T,col="grey85",border="NA",xlim=c(0,100),axes=F)
axis(2,pos=10, tick=T, tcl=F,
2012 Jul 25
1
Memisc package: imported varibles from SPSS have got wrong measurement
Dear list members,
I have got another problem. I imported an SPSS file with the Memisc package
using the following commands:
mz <- spss.system.file("myspssfile.sav")
mz <- subset(mz,select=c(
bsex,balt,xurb,dtaet,kartab,bgeb,boseit,bgeblan,xnuts2,kausb,xerwstat,
asbper,asbhh,ajahr,aquartal,bstaat,xwieoft,gew1,apkz,bpkzm,bpkzv))
Afterwards I checked the measurements of the
2012 Feb 06
2
creating more vectors out of one
Dear R-helpers,
I have got a vector which looks like the following:
apkz <- c(1,2,3,4,5,6,1,1,2,1,2,3,4)
now I am trying to find a way to automatically create several vectors,
each starting with the number 1, namely:
First vector
1 2 3 4 5 6
Second vector
1
Thrid vector
1 2
Fourth vector
1 2 3 4
Does anyone know how to do that?
Thank you very much for your help in advance!
2012 Jul 05
1
Import single variables from SPSS
Dear all,
I have got a very big SPSS dataframe and I would like to just import one or
a few variables (the dataframe has got a lot of colums).
I used the package foreign but I couldn't find anything in there for my
problem.
Thank you very much for your help in advance.
Marion
[[alternative HTML version deleted]]
2012 May 11
1
plot: many bars with wide bars
Hello,
I have got another problem.
I wrote a function which is able to create plots with different numbers of
bars.
In order to give them a similar look I determined the width of the bars
using the parameters
width=0.59
AND
ylim=c(0,10))
(see function below)
Now, this only works if I have just got up to 6 double bars. In the
following example it doesn't work because the bars for the
2012 May 09
1
white lines in barplot
Dear R-helpers,
I would like to draw white lines in my barplots to improve the
visualization.
I include an example:
barplot(sample(1:100,15),width=0.59,horiz=T,col="steelblue",border="NA",axes=F,ylim=c(0,10),xlim=c(0,100))
abline(v = seq(10, zehnind, by = 10), col = "white")
axis(1,at=ticks,las=1,labels=paste(ticks,"%",sep=""))
my problem is,